src/DataBuilder.php
private function getSourceLines($filename)
    {
        $rawSource = file_get_contents($filename);

        $source = explode(PHP_EOL, $rawSource);

        if (count($source) === 1) {
            if (substr_count($rawSource, "\n") > substr_count($rawSource, "\r")) {
                $source = explode("\n", $rawSource);
            } else {
                $source = explode("\r", $rawSource);
            }
        }

        $source = str_replace(array("\n", "\t", "\r"), '', $source);

        return $source;
    }
private function getSourceLines($filename)
    {
        $rawSource = file_get_contents($filename);

        $source = explode(PHP_EOL, $rawSource);

        if (count($source) === 1) {
            if (substr_count($rawSource, "\n") > substr_count($rawSource, "\r")) {
                $source = explode("\n", $rawSource);
            } else {
                $source = explode("\r", $rawSource);
            }
        }

        $source = str_replace(array("\n", "\t", "\r"), '', $source);

        return $source;
    }
private function getSourceLines ( $ filename ) { $ rawSource = file_get_contents ( $ filename ) ; $ source = explode ( PHP_EOL , $ rawSource ) ; if ( count ( $ source ) === 1 ) { if ( substr_count ( $ rawSource , "\n" ) > substr_count ( $ rawSource , "\r" ) ) { $ source = explode ( "\n" , $ rawSource ) ; } else { $ source = explode ( "\r" , $ rawSource ) ; } } $ source = str_replace ( array ( "\n" , "\t" , "\r" ) , '' , $ source ) ; return $ source ; }
Parses an array of code lines from source file with given filename.

Attempts to automatically detect the line break character used in the file.

@param string $filename
@return string[] An array of lines of code from the given source file.
Parses an array of code lines from source file with given filename .