Mark some TokenIterator methods as impure

This commit is contained in:
Ondrej Mirtes 2021-03-26 19:35:55 +01:00
parent 2269e47626
commit f9f5616cb2
No known key found for this signature in database
GPG Key ID: 8E730BA25823D8B5

View File

@ -90,6 +90,7 @@ class TokenIterator
}
/** @phpstan-impure */
public function tryConsumeTokenValue(string $tokenValue): bool
{
if ($this->tokens[$this->index][Lexer::VALUE_OFFSET] !== $tokenValue) {
@ -106,6 +107,7 @@ class TokenIterator
}
/** @phpstan-impure */
public function tryConsumeTokenType(int $tokenType): bool
{
if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== $tokenType) {
@ -132,6 +134,7 @@ class TokenIterator
}
/** @phpstan-impure */
public function joinUntil(int ...$tokenType): string
{
$s = '';
@ -153,6 +156,7 @@ class TokenIterator
$this->index++;
}
/** @phpstan-impure */
public function forwardToTheEnd(): void
{
$lastToken = count($this->tokens) - 1;