示例#1
0
 /**
  * @inheritdoc
  */
 public function parse(TokenStream $tokenStream)
 {
     if ($tokenStream->test(Token::T_GLOB)) {
         return new Glob($tokenStream->next()->getValue());
     }
     if ($tokenStream->nextIf(Token::T_TYPE, 'glob')) {
         $tokenStream->expect(Token::T_COLON);
     }
     return new Glob(Glob::encode($tokenStream->expect(static::$allowedTypes)->getValue()));
 }
示例#2
0
 private function decodeGlob($glob)
 {
     return preg_replace_callback('/[^\\*\\?]+/i', function ($encoded) {
         return Glob::encode(rawurldecode($encoded[0]));
     }, $glob);
 }