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