Skip to content

Commit ced520a

Browse files
staabmondrejmirtes
authored andcommitted
Micro optimize parseParamTagValue()
Prevent unnecessary function calls on a hot path
1 parent cc94635 commit ced520a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Parser/PhpDocParser.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ public function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\Ph
333333
private function parseParamTagValue(TokenIterator $tokens): Ast\PhpDoc\PhpDocTagValueNode
334334
{
335335
if (
336-
$tokens->isCurrentTokenType(Lexer::TOKEN_REFERENCE)
337-
|| $tokens->isCurrentTokenType(Lexer::TOKEN_VARIADIC)
338-
|| $tokens->isCurrentTokenType(Lexer::TOKEN_VARIABLE)
336+
$tokens->isCurrentTokenType(Lexer::TOKEN_REFERENCE, Lexer::TOKEN_VARIADIC, Lexer::TOKEN_VARIABLE)
339337
) {
340338
$type = null;
341339
} else {

0 commit comments

Comments
 (0)