src/helpers/BaseFileHelper.php
private static function firstWildcardInPattern($pattern)
    {
        $wildcards = ['*', '?', '[', '\\'];
        $wildcardSearch = function ($carry, $item) use ($pattern) {
            $position = strpos($pattern, $item);

            if ($position === false) {
                return $carry === false ? $position : $carry;
            }

            return $carry === false ? $position : min($carry, $position);
        };

        return array_reduce($wildcards, $wildcardSearch, false);
    }
private static function firstWildcardInPattern($pattern)
    {
        $wildcards = ['*', '?', '[', '\\'];
        $wildcardSearch = function ($carry, $item) use ($pattern) {
            $position = strpos($pattern, $item);

            if ($position === false) {
                return $carry === false ? $position : $carry;
            }

            return $carry === false ? $position : min($carry, $position);
        };

        return array_reduce($wildcards, $wildcardSearch, false);
    }
private static function firstWildcardInPattern ( $ pattern ) { $ wildcards = [ '*' , '?' , '[' , '\\' ] ; $ wildcardSearch = function ( $ carry , $ item ) use ( $ pattern ) { $ position = strpos ( $ pattern , $ item ) ; if ( $ position === false ) { return $ carry === false ? $ position : $ carry ; } return $ carry === false ? $ position : min ( $ carry , $ position ) ; } ; return array_reduce ( $ wildcards , $ wildcardSearch , false ) ; }
Searches for the first wildcard character in the pattern.
@param string $pattern the pattern to search in
@return int|bool position of first wildcard character or false if not found
Searches for the first wildcard character in the pattern .