Skip to content

Commit f9f5616

Browse files
committed
Mark some TokenIterator methods as impure
1 parent 2269e47 commit f9f5616

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Parser/TokenIterator.php

+4
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public function consumeTokenType(int $tokenType): void
9090
}
9191

9292

93+
/** @phpstan-impure */
9394
public function tryConsumeTokenValue(string $tokenValue): bool
9495
{
9596
if ($this->tokens[$this->index][Lexer::VALUE_OFFSET] !== $tokenValue) {
@@ -106,6 +107,7 @@ public function tryConsumeTokenValue(string $tokenValue): bool
106107
}
107108

108109

110+
/** @phpstan-impure */
109111
public function tryConsumeTokenType(int $tokenType): bool
110112
{
111113
if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== $tokenType) {
@@ -132,6 +134,7 @@ public function getSkippedHorizontalWhiteSpaceIfAny(): string
132134
}
133135

134136

137+
/** @phpstan-impure */
135138
public function joinUntil(int ...$tokenType): string
136139
{
137140
$s = '';
@@ -153,6 +156,7 @@ public function next(): void
153156
$this->index++;
154157
}
155158

159+
/** @phpstan-impure */
156160
public function forwardToTheEnd(): void
157161
{
158162
$lastToken = count($this->tokens) - 1;

0 commit comments

Comments
 (0)