Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 1 addition & 3 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /