Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function locateCollection(string $resourceDirectory): array |
||
18 | { |
||
19 | $resources = []; |
||
20 | |||
21 | /** @var MetadataLocatorInterface $locator */ |
||
22 | foreach ($this->locators as $locator) { |
||
23 | foreach ($locator->locateCollection($resourceDirectory) as $resource) { |
||
24 | if (!$resource instanceof AdminResource) { |
||
25 | throw new Exception(sprintf('The locator "%s" returns an instance of "%s", expected an instance of "%s"', \get_class($locator), \get_class($resource), AdminResource::class)); |
||
26 | } |
||
27 | $resources[] = $resource; |
||
28 | } |
||
29 | } |
||
30 | |||
31 | return $resources; |
||
32 | } |
||
34 |