Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
85.71% |
6 / 7 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
NormalizerList | |
85.71% |
6 / 7 |
|
66.67% |
2 / 3 |
7.14 | |
0.00% |
0 / 1 |
offsetGet | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
iterateOverNormalizers | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
3 | |||
iterateOverDenormalizers | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
3 |
1 | <?php |
2 | namespace Apie\Serializer\Lists; |
3 | |
4 | use Apie\Core\Lists\ItemList; |
5 | use Apie\Serializer\Interfaces\DenormalizerInterface; |
6 | use Apie\Serializer\Interfaces\NormalizerInterface; |
7 | |
8 | class NormalizerList extends ItemList |
9 | { |
10 | protected bool $mutable = false; |
11 | |
12 | public function offsetGet(mixed $offset): NormalizerInterface|DenormalizerInterface |
13 | { |
14 | return parent::offsetGet($offset); |
15 | } |
16 | |
17 | /** |
18 | * @return iterable<NormalizerInterface> |
19 | */ |
20 | public function iterateOverNormalizers(): iterable |
21 | { |
22 | foreach ($this as $item) { |
23 | if ($item instanceof NormalizerInterface) { |
24 | yield $item; |
25 | } |
26 | } |
27 | } |
28 | |
29 | /** |
30 | * @return iterable<DenormalizerInterface> |
31 | */ |
32 | public function iterateOverDenormalizers(): iterable |
33 | { |
34 | foreach ($this as $item) { |
35 | if ($item instanceof DenormalizerInterface) { |
36 | yield $item; |
37 | } |
38 | } |
39 | } |
40 | } |