| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace HSkrasek\OpenAPI\Command\Stages; |
||
| 23 | public function __invoke($payload) |
||
| 24 | { |
||
| 25 | $schemaFiles = array_filter($this->filesystem->listFiles($payload[0]), function (array $file) { |
||
| 26 | return \in_array($file['extension'], ['json', 'yml', 'yaml'], true); |
||
| 27 | }); |
||
| 28 | |||
| 29 | if (empty($schemaFiles)) { |
||
| 30 | throw new NoSchemaFilesFoundException("No schema files found in $payload"); |
||
| 31 | } |
||
| 32 | |||
| 33 | $payload[0] = $schemaFiles; |
||
| 34 | |||
| 35 | return $payload; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |