| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.4326 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | 2 | public function fetch(array $annotationPaths): OpenApi |
|
| 49 | { |
||
| 50 | 2 | if ($annotationPaths === []) { |
|
| 51 | 1 | throw new InvalidArgumentException('Annotation paths cannot be empty array.'); |
|
| 52 | } |
||
| 53 | |||
| 54 | 1 | $directories = array_map(fn (string $path): string => $this->aliases->get($path), $annotationPaths); |
|
| 55 | 1 | $openApi = Generator::scan(Util::finder($directories)); |
|
| 56 | |||
| 57 | 1 | if ($openApi === null) { |
|
| 58 | throw new RuntimeException(sprintf( |
||
| 59 | 'No OpenApi target set. Run the "%s" processor before "%s::fetch()".', |
||
| 60 | MergeIntoOpenApi::class, |
||
| 61 | self::class, |
||
| 62 | )); |
||
| 63 | } |
||
| 64 | |||
| 65 | 1 | return $openApi; |
|
| 66 | } |
||
| 68 |