private function detectEol($content)
    {
        $maxCount = 0;
        $preferredEol = $this->preferredEol;
        $eols = ["\n", "\r", "\n\r", "\r\n"];

        foreach ($eols as $eol) {
            if (($count = substr_count($content, $eol)) >= $maxCount) {
                $maxCount = $count;
                $preferredEol = $eol;
            }
        }

        $this->preferredEol = $preferredEol;

        return $preferredEol;
    }
private function detectEol($content)
    {
        $maxCount = 0;
        $preferredEol = $this->preferredEol;
        $eols = ["\n", "\r", "\n\r", "\r\n"];

        foreach ($eols as $eol) {
            if (($count = substr_count($content, $eol)) >= $maxCount) {
                $maxCount = $count;
                $preferredEol = $eol;
            }
        }

        $this->preferredEol = $preferredEol;

        return $preferredEol;
    }
private function detectEol ( $ content ) { $ maxCount = 0 ; $ preferredEol = $ this -> preferredEol ; $ eols = [ "\n" , "\r" , "\n\r" , "\r\n" ] ; foreach ( $ eols as $ eol ) { if ( ( $ count = substr_count ( $ content , $ eol ) ) >= $ maxCount ) { $ maxCount = $ count ; $ preferredEol = $ eol ; } } $ this -> preferredEol = $ preferredEol ; return $ preferredEol ; }
Detect most frequently used end of line sequence.

@param  string $content The content to detect the eol in.

@return string
Detect most frequently used end of line sequence .