| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | 6 | public function build(): array { |
|
| 10 | 6 | $output = []; |
|
| 11 | |||
| 12 | 6 | $data = $this->getData(); |
|
| 13 | /** @var \Traversable $modelCollection */ |
||
| 14 | 6 | $modelCollection = \array_shift($data); |
|
| 15 | |||
| 16 | 6 | foreach ($modelCollection as $model) { |
|
| 17 | 6 | $item = $this->mapData($model, ...$data); |
|
| 18 | |||
| 19 | 6 | if (!\is_array($item)) { |
|
| 20 | 1 | continue; |
|
| 21 | } |
||
| 22 | |||
| 23 | 6 | $output[] = $item; |
|
| 24 | } |
||
| 25 | |||
| 26 | 6 | return $output; |
|
| 27 | } |
||
| 37 | } |