Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — master ( b26ed6...0cdd8c )
by Henrique
02:33
created

RecursiveExceptionIterator::valid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of Respect/Validation.
5
 *
6
 * (c) Alexandre Gomes Gaigalas <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the "LICENSE.md"
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Respect\Validation\Exceptions;
15
16
use Countable;
17
use RecursiveIterator;
18
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()
53
    {
54
        return $this->exceptions->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()
68
    {
69 129
        return $this->exceptions->valid();
70
    }
71
}
72