Skip to content

Commit eabca28

Browse files
authored
[TASK] Throw Exception if config files from installed packages cannot be loaded
1 parent 5527f57 commit eabca28

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/fractor/src/DependencyInjection/ContainerContainerBuilder.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace a9f\Fractor\DependencyInjection;
66

7+
use a9f\Fractor\Exception\ShouldNotHappenException;
78
use a9f\FractorExtensionInstaller\Generated\InstalledPackages;
89
use Symfony\Component\Config\FileLocator;
910
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
@@ -60,7 +61,13 @@ private function collectConfigFilesFromExtensions(): array
6061
}
6162

6263
foreach (InstalledPackages::PACKAGES as $package) {
63-
$collectedConfigFiles[] = $package['path'] . '/config/application.php';
64+
$configPath = $package['path'] . '/config/application.php';
65+
66+
if (! is_readable($configPath)) {
67+
throw new ShouldNotHappenException(sprintf('Config file "%s" is not readable or does not exist.', $configPath));
68+
}
69+
70+
$collectedConfigFiles[] = $configPath;
6471
}
6572

6673
return $collectedConfigFiles;

0 commit comments

Comments
 (0)