Skip to content

Commit

Permalink
fix: make sure return value is a list
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Dec 28, 2023
1 parent e765fae commit 6165794
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/Autoloader/FileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public function getClassname(string $file): string
* 'app/Modules/foo/Config/Routes.php',
* 'app/Modules/bar/Config/Routes.php',
* ]
*
* @return list<string>
*/
public function search(string $path, string $ext = 'php', bool $prioritizeApp = true): array
{
Expand Down Expand Up @@ -203,7 +205,7 @@ public function search(string $path, string $ext = 'php', bool $prioritizeApp =
}

// Remove any duplicates
return array_unique($foundPaths);
return array_values(array_unique($foundPaths));
}

/**
Expand Down

0 comments on commit 6165794

Please sign in to comment.