private function normalizeEndings($source, Isolator $isolator)
    {
        //Step #1, \n only
        $source = $isolator->isolatePHP(preg_replace('/[\n\r]+/', "\n", $source));

        //Step #2, chunk by lines
        $sourceLines = explode("\n", $source);

        //Step #3, no blank lines and html comments (will keep conditional commends)
        $sourceLines = array_filter($sourceLines, function ($line) {
            return trim($line);
        });

        $source = $isolator->repairPHP(join("\n", $sourceLines));
        $isolator->reset();

        return $source;
    }
private function normalizeEndings($source, Isolator $isolator)
    {
        //Step #1, \n only
        $source = $isolator->isolatePHP(preg_replace('/[\n\r]+/', "\n", $source));

        //Step #2, chunk by lines
        $sourceLines = explode("\n", $source);

        //Step #3, no blank lines and html comments (will keep conditional commends)
        $sourceLines = array_filter($sourceLines, function ($line) {
            return trim($line);
        });

        $source = $isolator->repairPHP(join("\n", $sourceLines));
        $isolator->reset();

        return $source;
    }
private function normalizeEndings ( $ source , Isolator $ isolator ) { //Step #1, \n only $ source = $ isolator -> isolatePHP ( preg_replace ( '/[\n\r]+/' , "\n" , $ source ) ) ; //Step #2, chunk by lines $ sourceLines = explode ( "\n" , $ source ) ; //Step #3, no blank lines and html comments (will keep conditional commends) $ sourceLines = array_filter ( $ sourceLines , function ( $ line ) { return trim ( $ line ) ; } ) ; $ source = $ isolator -> repairPHP ( join ( "\n" , $ sourceLines ) ) ; $ isolator -> reset ( ) ; return $ source ; }
Remove blank lines.

@param string   $source
@param Isolator $isolator

@return string
Remove blank lines .