Skip to content

Commit

Permalink
Fixed discovering backed enum without space around :
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 6, 2022
1 parent 5087733 commit 5162bcf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Expand Up @@ -229,7 +229,10 @@ private function findSymbols(string $file): array
$functions[] = $namespacedName;
} else {
if ($matches['type'][$i] === 'enum') {
$namespacedName = rtrim($namespacedName, ':');
$colonPos = strrpos($namespacedName, ':');
if (false !== $colonPos) {
$namespacedName = substr($namespacedName, 0, $colonPos);
}
}
$classes[] = $namespacedName;
}
Expand Down
Expand Up @@ -47,6 +47,12 @@ public function dataClass(): iterable
'OptimizedDirectory\\TestEnum',
'enum.php',
];

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

/**
Expand Down
Expand Up @@ -8,3 +8,8 @@ enum TestEnum: int
case ONE = 1;

}

enum BackedByStringWithoutSpace:string
{
// cases
}

0 comments on commit 5162bcf

Please sign in to comment.