Skip to content

Commit f374f53

Browse files
authored
Fix extension conflict with const definition (#213)
1 parent 160c1c6 commit f374f53

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/UsedSymbolExtractor.php

+1
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ private function canBeSymbolName(
426426
|| $tokenAfterName[0] === T_INSTEADOF
427427
|| $tokenAfterName[0] === T_AS
428428
|| $tokenAfterName === ':'
429+
|| $tokenAfterName === '='
429430
) {
430431
return false;
431432
}

tests/UsedSymbolExtractorTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public function provideVariants(): iterable
5959
[],
6060
[
6161
strtolower('PDO') => SymbolKind::CLASSLIKE,
62+
strtolower('SESSION_ID') => SymbolKind::CONSTANT,
6263
],
6364
];
6465

tests/data/not-autoloaded/used-symbols/t-string-issues.php

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
class Test
1212
{
13+
public const string SESSION_ID = '...';
14+
1315
use SomeTrait {
1416
array_filter insteadof array_values;
1517
array_map as array_walk;

0 commit comments

Comments
 (0)