public parse ( |
||
$token |
public function parse(Token $token)
{
if (null === $this->parser) {
throw ExpressionLanguageExceptionFactory::createForExpectedMethodCallOnlyIfHasAParser(__METHOD__);
}
}
/** * Parses "10x @user*", "<randomNumber(0, 10)x @user<{param}>*", etc. * * {@inheritdoc} * * @throws ParseException */ public function parse(Token $token) : DynamicArrayValue { parent::parse($token); if (1 !== preg_match(self::REGEX, $token->getValue(), $matches)) { throw ExpressionLanguageExceptionFactory::createForUnparsableToken($token); } return new DynamicArrayValue((int) $this->parser->parse($matches['quantifier']), $this->parser->parse($matches['elements'])); }