Skip to content

Commit

Permalink
[BUGFIX] Skip nonexistent namespace paths (#1009)
Browse files Browse the repository at this point in the history
If a PHP namespace is defined in composer.json, but the
referenced directory doesn't exist, ViewHelperFinder
produced a PHP error. With this change, nonexistent
directories are skipped.
  • Loading branch information
s2b authored Oct 9, 2024
1 parent d2504c4 commit 3510df3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Schema/ViewHelperFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public function getLastErrors(): array
*/
private function findViewHelperFilesInPath(string $namespace, string $path): array
{
if (!is_dir($path)) {
return [];
}
$viewHelpers = [];
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS | FilesystemIterator::CURRENT_AS_PATHNAME),
Expand Down

0 comments on commit 3510df3

Please sign in to comment.