We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Total Complexity | 10 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Coverage | 78.26% |
Changes | 0 |
1 | <?php |
||
19 | class RecursiveExceptionIterator implements RecursiveIterator, Countable |
||
20 | { |
||
21 | private $exceptions; |
||
22 | |||
23 | 129 | public function __construct(NestedValidationException $parent) |
|
24 | { |
||
25 | 129 | $this->exceptions = $parent->getRelated(); |
|
26 | 129 | } |
|
27 | |||
28 | public function count() |
||
29 | { |
||
30 | return $this->exceptions->count(); |
||
31 | } |
||
32 | |||
33 | 128 | public function hasChildren() |
|
34 | { |
||
35 | 128 | if (!$this->valid()) { |
|
36 | return false; |
||
37 | } |
||
38 | |||
39 | 128 | return $this->current() instanceof NestedValidationException; |
|
40 | } |
||
41 | |||
42 | 14 | public function getChildren() |
|
43 | { |
||
44 | 14 | return new static($this->current()); |
|
45 | } |
||
46 | |||
47 | 128 | public function current() |
|
48 | { |
||
49 | 128 | return $this->exceptions->current(); |
|
50 | } |
||
51 | |||
52 | public function key() |
||
55 | } |
||
56 | |||
57 | 128 | public function next(): void |
|
58 | { |
||
59 | 128 | $this->exceptions->next(); |
|
60 | 128 | } |
|
61 | |||
62 | 129 | public function rewind(): void |
|
63 | { |
||
64 | 129 | $this->exceptions->rewind(); |
|
65 | 129 | } |
|
66 | |||
67 | 129 | public function valid() |
|
70 | } |
||
71 | } |
||
72 |