Nelmio\Alice\Throwable\Exception\FixtureBuilder\ExpressionLanguage\ExpressionLanguageExceptionFactory::createForNoParserFoundForToken PHP Method

createForNoParserFoundForToken() public static method

public static createForNoParserFoundForToken ( Token $token ) : ParserNotFoundException
$token Nelmio\Alice\FixtureBuilder\ExpressionLanguage\Token
return ParserNotFoundException
    public static function createForNoParserFoundForToken(Token $token) : ParserNotFoundException
    {
        return new ParserNotFoundException(sprintf('No suitable token parser found to handle the token "%s" (type: %s).', $token->getValue(), $token->getType()));
    }

Usage Example

 public function testTestCreateForNoParserFoundForToken()
 {
     $token = new Token('foo', new TokenType(TokenType::DYNAMIC_ARRAY_TYPE));
     $exception = ExpressionLanguageExceptionFactory::createForNoParserFoundForToken($token);
     $this->assertEquals('No suitable token parser found to handle the token "foo" (type: DYNAMIC_ARRAY_TYPE).', $exception->getMessage());
     $this->assertEquals(0, $exception->getCode());
     $this->assertNull($exception->getPrevious());
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\FixtureBuilder\ExpressionLanguage\ExpressionLanguageExceptionFactory::createForNoParserFoundForToken