protected function exclude(string $path): bool
    {
        foreach ($this->exclude as $pattern) {
            $replacements = [
                '\\,' => ',',
                '*' => '.*',
            ];

            $pattern = strtr($pattern, $replacements);

            if (preg_match("|{$pattern}|i", $path) === 1) {
                return true;
            }
        }

        return false;
    }
protected function exclude(string $path): bool
    {
        foreach ($this->exclude as $pattern) {
            $replacements = [
                '\\,' => ',',
                '*' => '.*',
            ];

            $pattern = strtr($pattern, $replacements);

            if (preg_match("|{$pattern}|i", $path) === 1) {
                return true;
            }
        }

        return false;
    }
protected function exclude ( string $ path ) : bool { foreach ( $ this -> exclude as $ pattern ) { $ replacements = [ '\\,' => ',' , '*' => '.*' , ] ; $ pattern = strtr ( $ pattern , $ replacements ) ; if ( preg_match ( "|{$pattern}|i" , $ path ) === 1 ) { return true ; } } return false ; }
Check if path should be excluded.

@param string $path

@return bool True if path has matched pattern
Check if path should be excluded .