Skip to content

Commit

Permalink
OptimizedDirectorySourceLocator - fix bug with upper-case Function ke…
Browse files Browse the repository at this point in the history
…yword
  • Loading branch information
ondrejmirtes committed Feb 25, 2022
1 parent 7110a08 commit dbbb721
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Expand Up @@ -225,10 +225,11 @@ private function findSymbols(string $file): array
}
$namespacedName = strtolower(ltrim($namespace . $name, '\\'));

if ($matches['type'][$i] === 'function') {
$lowerType = strtolower($matches['type'][$i]);
if ($lowerType === 'function') {
$functions[] = $namespacedName;
} else {
if (strtolower($matches['type'][$i]) === 'enum') {
if ($lowerType === 'enum') {
$colonPos = strrpos($namespacedName, ':');
if (false !== $colonPos) {
$namespacedName = substr($namespacedName, 0, $colonPos);
Expand Down
Expand Up @@ -113,6 +113,11 @@ public function dataFunctionExists(): array
'OptimizedDirectory\\get_smarty2',
'b.php',
],
[
'OptimizedDirectory\\upperCaseFunction',
'OptimizedDirectory\\upperCaseFunction',
'b.php',
],
];
}

Expand Down
Expand Up @@ -35,3 +35,8 @@ function & get_smarty2()

return $smarty;
}

Function upperCaseFunction()
{

}

0 comments on commit dbbb721

Please sign in to comment.