Total Complexity | 5 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class FileStorageServiceProvider extends ServiceProvider |
||
11 | { |
||
12 | public function register(Container $container): void |
||
13 | { |
||
14 | $factory = new Factory(); |
||
15 | $configs = $container->get(FileStorageConfigs::class)->getConfigs(); |
||
16 | foreach ($configs as $alias => $config) { |
||
17 | $this->validateAdapter($alias, $config); |
||
18 | $configParams = $config['config'] ?? []; |
||
19 | $aliases = $config['aliases'] ?? []; |
||
20 | $adapter = $factory->create($config['adapter']); |
||
21 | $container->set($alias, [ |
||
22 | '__class' => Filesystem::class, |
||
23 | '__construct()' => [ |
||
24 | $adapter, $aliases, $configParams |
||
25 | ] |
||
26 | ]); |
||
27 | } |
||
28 | } |
||
29 | |||
30 | private function validateAdapter(string $alias, array $config) |
||
38 | } |
||
39 | } |
||
41 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths