public function canParse(Token $token) : bool
{
return $token->getType() === TokenType::STRING_TYPE;
}
public function testCanParseDynamicArrayTokens() { $token = new Token('', new TokenType(TokenType::STRING_TYPE)); $anotherToken = new Token('', new TokenType(TokenType::IDENTITY_TYPE)); $parser = new StringTokenParser(); $this->assertTrue($parser->canParse($token)); $this->assertFalse($parser->canParse($anotherToken)); }