| Conditions | 5 |
| Paths | 4 |
| Total Lines | 29 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function locateCollection(string $resourceDirectory): iterable |
||
| 18 | { |
||
| 19 | $fileSystem = new Filesystem(); |
||
| 20 | |||
| 21 | if (!$fileSystem->exists($resourceDirectory) || !is_dir($resourceDirectory)) { |
||
| 22 | throw new Exception(sprintf('The resources path %s does not exists or is not a directory', $resourceDirectory)); |
||
| 23 | } |
||
| 24 | $finder = new Finder(); |
||
| 25 | $finder |
||
| 26 | ->files() |
||
| 27 | ->name('*.yaml') |
||
| 28 | ->in($resourceDirectory) |
||
| 29 | ; |
||
| 30 | $resources = []; |
||
| 31 | |||
| 32 | foreach ($finder as $fileInfo) { |
||
| 33 | $yaml = Yaml::parse(file_get_contents($fileInfo->getRealPath()), Yaml::PARSE_CUSTOM_TAGS); |
||
| 34 | |||
| 35 | foreach ($yaml as $name => $configuration) { |
||
| 36 | $resource = (new MapperBuilder()) |
||
| 37 | ->mapper() |
||
| 38 | ->map(AdminResource::class, Source::array($configuration ?? [])) |
||
| 39 | ; |
||
| 40 | $resource = $resource->withName($name); |
||
| 41 | $resources[] = $resource; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | return $resources; |
||
| 46 | } |
||
| 48 |
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