protected function parseLines(array $lines, $lineParser)
    {
        return array_filter(
            array_map(
                function ($line) use ($lineParser) {
                    $line = trim($line);

                    if (!$line || 0 === strpos($line, '#')) {
                        return;
                    }

                    return call_user_func($lineParser, $line);
                },
                $lines
            ),
            function ($pattern) {
                return $pattern !== null;
            }
        );
    }
protected function parseLines(array $lines, $lineParser)
    {
        return array_filter(
            array_map(
                function ($line) use ($lineParser) {
                    $line = trim($line);

                    if (!$line || 0 === strpos($line, '#')) {
                        return;
                    }

                    return call_user_func($lineParser, $line);
                },
                $lines
            ),
            function ($pattern) {
                return $pattern !== null;
            }
        );
    }
protected function parseLines ( array $ lines , $ lineParser ) { return array_filter ( array_map ( function ( $ line ) use ( $ lineParser ) { $ line = trim ( $ line ) ; if ( ! $ line || 0 === strpos ( $ line , '#' ) ) { return ; } return call_user_func ( $ lineParser , $ line ) ; } , $ lines ) , function ( $ pattern ) { return $ pattern !== null ; } ) ; }
Processes a file containing exclude rules of different formats per line

@param array    $lines      A set of lines to be parsed
@param callback $lineParser The parser to be used on each line

@return array Exclude patterns to be used in filter()
Processes a file containing exclude rules of different formats per line