| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function locate(): array |
||
| 34 | { |
||
| 35 | $parsed = $this->parser->parse(file_get_contents($this->path)); |
||
| 36 | $resources = $parsed['resources'] ?? []; |
||
| 37 | |||
| 38 | foreach ($resources as $shortName => $resource) { |
||
| 39 | if (is_array($resource)) { |
||
| 40 | if (!isset($resource['class'])) { |
||
| 41 | throw new InvalidArgumentException(sprintf( |
||
| 42 | 'Missing class declaration for resource "%s".', |
||
| 43 | $shortName |
||
| 44 | )); |
||
| 45 | } |
||
| 46 | |||
| 47 | $resource = $resource['class']; |
||
| 48 | } |
||
| 49 | |||
| 50 | $resources[$shortName] = $resource; |
||
| 51 | } |
||
| 52 | |||
| 53 | return $resources; |
||
| 54 | } |
||
| 55 | } |
||
| 56 |