Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function read(string $type, ?string $id = null): array |
||
28 | 8 | { |
|
29 | if ($type === self::TYPE_SUMMARY) { |
||
30 | 8 | return [ |
|
31 | 8 | $this->idGenerator->getId() => [ |
|
32 | 'id' => $this->idGenerator->getId(), |
||
33 | 'collectors' => array_keys($this->collectors), |
||
34 | 8 | ], |
|
35 | ]; |
||
36 | } |
||
37 | 24 | ||
38 | if ($type === self::TYPE_OBJECTS) { |
||
39 | 24 | return [ |
|
40 | $this->idGenerator->getId() => array_merge(...array_values($this->getData())), |
||
41 | 24 | ]; |
|
42 | 8 | } |
|
43 | |||
44 | return [$this->idGenerator->getId() => $this->getData()]; |
||
45 | 24 | } |
|
70 |