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::assert()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
c 0
b 0
f 0
ccs 7
cts 7
cp 1
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
crap 2
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