Conditions | 6 |
Paths | 5 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 6 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
18 | 17 | public static function process(array &$data) : array { |
|
19 | // Check for "single" export |
||
20 | 17 | if (isset($data['object'])) { |
|
21 | 9 | if (!$data['object'] instanceof Team) { |
|
22 | 1 | throw new InvalidArgumentException('WithScores modifier needs a Team object.'); |
|
23 | } |
||
24 | 8 | return self::processArray($data); |
|
25 | } |
||
26 | |||
27 | 8 | foreach ($data as $object) { |
|
28 | 8 | if (!isset($object->object) || !$object->object instanceof Team) { |
|
29 | 3 | throw new InvalidArgumentException('WithScores modifier needs a Team object.'); |
|
30 | } |
||
31 | 5 | self::processObject($object); |
|
32 | } |
||
33 | 5 | return $data; |
|
34 | } |
||
71 | } |