Skip to content

Commit

Permalink
Fix extension conflict with const definition (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal authored Dec 30, 2024
1 parent 160c1c6 commit f374f53
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/UsedSymbolExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ private function canBeSymbolName(
|| $tokenAfterName[0] === T_INSTEADOF
|| $tokenAfterName[0] === T_AS
|| $tokenAfterName === ':'
|| $tokenAfterName === '='
) {
return false;
}
Expand Down
1 change: 1 addition & 0 deletions tests/UsedSymbolExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function provideVariants(): iterable
[],
[
strtolower('PDO') => SymbolKind::CLASSLIKE,
strtolower('SESSION_ID') => SymbolKind::CONSTANT,
],
];

Expand Down
2 changes: 2 additions & 0 deletions tests/data/not-autoloaded/used-symbols/t-string-issues.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

class Test
{
public const string SESSION_ID = '...';

use SomeTrait {
array_filter insteadof array_values;
array_map as array_walk;
Expand Down

0 comments on commit f374f53

Please sign in to comment.