Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
85.71% covered (warning)
85.71%
6 / 7
66.67% covered (warning)
66.67%
2 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
NormalizerList
85.71% covered (warning)
85.71%
6 / 7
66.67% covered (warning)
66.67%
2 / 3
7.14
0.00% covered (danger)
0.00%
0 / 1
 offsetGet
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 iterateOverNormalizers
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
3
 iterateOverDenormalizers
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
3
1<?php
2namespace Apie\Serializer\Lists;
3
4use Apie\Core\Lists\ItemList;
5use Apie\Serializer\Interfaces\DenormalizerInterface;
6use Apie\Serializer\Interfaces\NormalizerInterface;
7
8class 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}