Skip to content

Commit f016606

Browse files
committed
File::getDeclarationName(): replace condition with comment
1 parent b0971c8 commit f016606

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Files/File.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,9 +1305,11 @@ public function getDeclarationName($stackPtr)
13051305
}
13061306

13071307
$stopPoint = $this->numTokens;
1308-
if ($tokenCode === T_FUNCTION && isset($this->tokens[$stackPtr]['parenthesis_opener']) === true) {
1308+
if (isset($this->tokens[$stackPtr]['parenthesis_opener']) === true) {
1309+
// For functions, stop searching at the parenthesis opener.
13091310
$stopPoint = $this->tokens[$stackPtr]['parenthesis_opener'];
13101311
} else if (isset($this->tokens[$stackPtr]['scope_opener']) === true) {
1312+
// For OO tokens, stop searching at the open curly.
13111313
$stopPoint = $this->tokens[$stackPtr]['scope_opener'];
13121314
}
13131315

0 commit comments

Comments
 (0)