/** * @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())); }
/** * @inheritdoc */ public function supports(TokenStream $tokenStream) { return $tokenStream->test(Token::T_OPERATOR, $this->getOperatorName()); }
public function supports(TokenStream $tokenStream) { return $tokenStream->test(Token::T_OPERATOR, 'groupby'); }
public function supports(TokenStream $tokenStream) { return $tokenStream->test(Token::T_OPERATOR, 'elemMatch'); }
/** * @inheritdoc */ public function supports(TokenStream $tokenStream) { return $tokenStream->test(Token::T_OPEN_PARENTHESIS); }
/** * @inheritdoc */ public function supports(TokenStream $tokenStream) { return $tokenStream->test(Token::T_STRING) && $tokenStream->lookAhead()->test(Token::T_OPERATOR, $this->getOperatorNames()); }