for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Remorhaz\Lexer\Runtime\Token;
use Remorhaz\Lexer\Runtime\IO\LexemeInterface;
/**
* @psalm-immutable
*/
final class MatchSuccess implements MatchResultInterface
{
* @var TokenInterface
private $token;
public function __construct(TokenInterface $token)
$this->token = $token;
}
* @return bool
* @psalm-pure
public function shouldRepeat(): bool
return false;
public function hasToken(): bool
return true;
* @return TokenInterface
public function getToken(): TokenInterface
return $this->token;
public function hasLexeme(): bool
* @return LexemeInterface
public function getLexeme(): LexemeInterface
return $this->token->getLexeme();