protected function convertPattern($pattern)
    {
        $prefix = 0 === strpos($pattern, '!') ? '!' : '';
        $searchPattern = trim(ltrim($pattern, '!'), '/');
        $pattern = $prefix.$searchPattern;

        if (\in_array($searchPattern, array('*', '*.*'), true)) {
            $this->doAddPattern($prefix.'.*');
        } elseif (0 === strpos($searchPattern, '**/')) {
            $this->doAddPattern($prefix.'**/'.$searchPattern);
            $this->doAddPattern($prefix.substr($searchPattern, 3));
        } else {
            $this->convertPatternStep2($prefix, $searchPattern, $pattern);
        }

        return $pattern;
    }
protected function convertPattern($pattern)
    {
        $prefix = 0 === strpos($pattern, '!') ? '!' : '';
        $searchPattern = trim(ltrim($pattern, '!'), '/');
        $pattern = $prefix.$searchPattern;

        if (\in_array($searchPattern, array('*', '*.*'), true)) {
            $this->doAddPattern($prefix.'.*');
        } elseif (0 === strpos($searchPattern, '**/')) {
            $this->doAddPattern($prefix.'**/'.$searchPattern);
            $this->doAddPattern($prefix.substr($searchPattern, 3));
        } else {
            $this->convertPatternStep2($prefix, $searchPattern, $pattern);
        }

        return $pattern;
    }
protected function convertPattern ( $ pattern ) { $ prefix = 0 === strpos ( $ pattern , '!' ) ? '!' : '' ; $ searchPattern = trim ( ltrim ( $ pattern , '!' ) , '/' ) ; $ pattern = $ prefix . $ searchPattern ; if ( \ in_array ( $ searchPattern , array ( '*' , '*.*' ) , true ) ) { $ this -> doAddPattern ( $ prefix . '.*' ) ; } elseif ( 0 === strpos ( $ searchPattern , '**/' ) ) { $ this -> doAddPattern ( $ prefix . '**/' . $ searchPattern ) ; $ this -> doAddPattern ( $ prefix . substr ( $ searchPattern , 3 ) ) ; } else { $ this -> convertPatternStep2 ( $ prefix , $ searchPattern , $ pattern ) ; } return $ pattern ; }
Converter pattern to glob.

@param string $pattern The pattern

@return string The pattern converted
Converter pattern to glob .