Skip to content

Commit

Permalink
OptimizedDirectorySourceLocator - fix bug with uppercase Enum keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 25, 2022
1 parent 0e5d586 commit 7110a08
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private function findSymbols(string $file): array
if ($matches['type'][$i] === 'function') {
$functions[] = $namespacedName;
} else {
if ($matches['type'][$i] === 'enum') {
if (strtolower($matches['type'][$i]) === 'enum') {
$colonPos = strrpos($namespacedName, ':');
if (false !== $colonPos) {
$namespacedName = substr($namespacedName, 0, $colonPos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public function dataClass(): iterable
'OptimizedDirectory\\BackedByStringWithoutSpace',
'enum.php',
];

yield [
'OptimizedDirectory\\UppercaseEnum',
'OptimizedDirectory\\UppercaseEnum',
'enum.php',
];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ enum BackedByStringWithoutSpace:string
{
// cases
}

Enum UppercaseEnum:string
{

}

0 comments on commit 7110a08

Please sign in to comment.