function TokenIterator::hasTokenImmediatelyAfter
* Check whether the position is directly followed by a certain token type. * * During this check TOKEN_HORIZONTAL_WS and TOKEN_PHPDOC_EOL are skipped
1 call to TokenIterator::hasTokenImmediatelyAfter()
- TokenIterator::hasParentheses in vendor/
phpstan/ phpdoc-parser/ src/ Parser/ TokenIterator.php - * Whether the given position is immediately surrounded by parenthesis.
File
-
vendor/
phpstan/ phpdoc-parser/ src/ Parser/ TokenIterator.php, line 348
Class
Namespace
PHPStan\PhpDocParser\ParserCode
public function hasTokenImmediatelyAfter(int $pos, int $expectedTokenType) : bool {
$tokens = $this->tokens;
$pos++;
for ($c = count($tokens); $pos < $c; $pos++) {
$token = $tokens[$pos];
$type = $token[Lexer::TYPE_OFFSET];
if ($type === $expectedTokenType) {
return true;
}
if (!in_array($type, [
Lexer::TOKEN_HORIZONTAL_WS,
Lexer::TOKEN_PHPDOC_EOL,
], true)) {
break;
}
}
return false;
}