Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
26 | 10 | public function multipleToAPIResponseData(?array $resources): APIResponseData |
|
27 | { |
||
28 | 10 | if(is_null($resources)) { |
|
29 | 2 | return $this->toAPIResponseData(null); |
|
30 | } |
||
31 | |||
32 | 8 | return new APIResponseData(array_map(function(Resource $resource) { |
|
33 | 7 | return $this->toAPIResponseData($resource)->getData(); |
|
34 | 8 | }, $resources)); |
|
35 | } |
||
36 | } |
||
37 |