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 — 0.9 ( 7d978d...1ce8ac )
by Henrique
07:01 queued 01:39
created

ExceptionIterator::hasChildren()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
crap 2
1
<?php
2
namespace Respect\Validation;
3
4
use RecursiveArrayIterator;
5
use Respect\Validation\Exceptions\AbstractNestedException;
6
7
class ExceptionIterator extends RecursiveArrayIterator
8
{
9
    protected $fullRelated;
10
11 6
    public function __construct($target, $fullRelated = false)
12
    {
13 6
        $this->fullRelated = $fullRelated;
14 6
        parent::__construct(is_array($target) ? $target : array($target));
15 6
    }
16
17 6
    public function hasChildren()
18
    {
19 6
        if (!$this->current() instanceof AbstractNestedException) {
20 5
            return false;
21
        } else {
22 6
            return (boolean) $this->current()->getRelated($this->fullRelated);
23
        }
24
    }
25
26 6
    public function getChildren()
27
    {
28 6
        return new static($this->current()->getRelated($this->fullRelated), $this->fullRelated);
29
    }
30
}
31