function TokenStream::skipRight
Parameters
int|string|(int|string)[] $skipTokenType :
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Internal/ TokenStream.php, line 120
Class
- TokenStream
- Provides operations on token streams, for use by pretty printer.
Namespace
PhpParser\InternalCode
public function skipRight(int $pos, $skipTokenType) : int {
$tokens = $this->tokens;
$pos = $this->skipRightWhitespace($pos);
if ($skipTokenType === \T_WHITESPACE) {
return $pos;
}
if (!$tokens[$pos]->is($skipTokenType)) {
// Shouldn't happen. The skip token MUST be there
throw new \Exception('Encountered unexpected token');
}
$pos++;
return $this->skipRightWhitespace($pos);
}