Total Complexity | 4 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | class ViolationIterator extends IteratorIterator implements |
||
13 | ViolationIteratorInterface |
||
14 | { |
||
15 | /** @var int */ |
||
16 | private $numViolations; |
||
17 | |||
18 | /** |
||
19 | * Constructor. |
||
20 | * |
||
21 | * @param ViolationInterface ...$violations |
||
22 | */ |
||
23 | 3 | public function __construct(ViolationInterface ...$violations) |
|
28 | ); |
||
29 | 3 | } |
|
30 | |||
31 | /** |
||
32 | * Get the current violation. |
||
33 | * |
||
34 | * @return ViolationInterface |
||
35 | */ |
||
36 | 2 | public function current(): ViolationInterface |
|
37 | { |
||
38 | 2 | return parent::current(); |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * Get the number of violations. |
||
43 | * |
||
44 | * @return int |
||
45 | */ |
||
46 | 3 | public function count(): int |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * Specify data that should be serialized to JSON. |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | 3 | public function jsonSerialize(): array |
|
61 |