public function getGitignoredPatterns()
    {
        $gitignoreFile = $this->getDirectory() . DIRECTORY_SEPARATOR . '.gitignore';

        if (!file_exists($gitignoreFile)) {
            return [];
        }

        $gitignoreContent = (string) file_get_contents($gitignoreFile);
        $eol = $this->detectEol($gitignoreContent);

        $gitignoreLines = preg_split(
            '/\\r\\n|\\r|\\n/',
            $gitignoreContent
        );

        $gitignoredPatterns = [];

        array_filter($gitignoreLines, function ($line) use (&$gitignoredPatterns) {
            $line = trim($line);
            if ($line !== '' && strpos($line, '#') === false) {
                if (substr($line, 0, 1) === "/") {
                    $gitignoredPatterns[] = substr($line, 1);
                }
                if (substr($line, -1, 1) === "/") {
                    $gitignoredPatterns[] = substr($line, 0, -1);
                }
                $gitignoredPatterns[] = $line;
            }
        });

        return $gitignoredPatterns;
    }
public function getGitignoredPatterns()
    {
        $gitignoreFile = $this->getDirectory() . DIRECTORY_SEPARATOR . '.gitignore';

        if (!file_exists($gitignoreFile)) {
            return [];
        }

        $gitignoreContent = (string) file_get_contents($gitignoreFile);
        $eol = $this->detectEol($gitignoreContent);

        $gitignoreLines = preg_split(
            '/\\r\\n|\\r|\\n/',
            $gitignoreContent
        );

        $gitignoredPatterns = [];

        array_filter($gitignoreLines, function ($line) use (&$gitignoredPatterns) {
            $line = trim($line);
            if ($line !== '' && strpos($line, '#') === false) {
                if (substr($line, 0, 1) === "/") {
                    $gitignoredPatterns[] = substr($line, 1);
                }
                if (substr($line, -1, 1) === "/") {
                    $gitignoredPatterns[] = substr($line, 0, -1);
                }
                $gitignoredPatterns[] = $line;
            }
        });

        return $gitignoredPatterns;
    }
public function getGitignoredPatterns ( ) { $ gitignoreFile = $ this -> getDirectory ( ) . DIRECTORY_SEPARATOR . '.gitignore' ; if ( ! file_exists ( $ gitignoreFile ) ) { return [ ] ; } $ gitignoreContent = ( string ) file_get_contents ( $ gitignoreFile ) ; $ eol = $ this -> detectEol ( $ gitignoreContent ) ; $ gitignoreLines = preg_split ( '/\\r\\n|\\r|\\n/' , $ gitignoreContent ) ; $ gitignoredPatterns = [ ] ; array_filter ( $ gitignoreLines , function ( $ line ) use ( & $ gitignoredPatterns ) { $ line = trim ( $ line ) ; if ( $ line !== '' && strpos ( $ line , '#' ) === false ) { if ( substr ( $ line , 0 , 1 ) === "/" ) { $ gitignoredPatterns [ ] = substr ( $ line , 1 ) ; } if ( substr ( $ line , - 1 , 1 ) === "/" ) { $ gitignoredPatterns [ ] = substr ( $ line , 0 , - 1 ) ; } $ gitignoredPatterns [ ] = $ line ; } } ) ; return $ gitignoredPatterns ; }
Return patterns in .gitignore file.

@return array
Return patterns in . gitignore file .