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
Pull Request — 0.9 (#692)
by
unknown
02:58
created

NoneOf::validate()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 9.4285
cc 3
eloc 5
nc 3
nop 1
crap 3
1
<?php
2
namespace Respect\Validation\Rules;
3
4
class NoneOf extends AbstractComposite
5
{
6 5
    public function assert($input)
7
    {
8 5
        $exceptions = $this->validateRules($input);
9 5
        $numRules = count($this->getRules());
10 5
        $numExceptions = count($exceptions);
11 5
        if ($numRules !== $numExceptions) {
12 4
            throw $this->reportError($input)->setRelated($exceptions);
13
        }
14
15 1
        return true;
16
    }
17
18 2
    public function validate($input)
19
    {
20 2
        foreach ($this->getRules() as $rule) {
21 2
            if ($rule->validate($input)) {
22 1
                return false;
23
            }
24 2
        }
25
26 1
        return true;
27
    }
28
}
29