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 — master (#678)
by Henrique
04:46
created

Not   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 28
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validate() 0 7 1
A __construct() 0 4 1
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
namespace Respect\Validation\Rules;
13
14
use Respect\Validation\Result;
15
use Respect\Validation\Rule;
16
17
/**
18
 * Negates the given rule.
19
 *
20
 * @author Alexandre Gomes Gaigalas <[email protected]>
21 18
 * @author Henrique Moody <[email protected]>
22
 *
23 18
 * @since 0.3.9
24 18
 */
25
final class Not implements Rule
26 5
{
27
    /**
28 5
     * @var Rule
29
     */
30 5
    private $rule;
31
32
    /**
33 12
     * Initializes the rule.
34
     *
35 12
     * @param Rule $rule
36
     */
37
    public function __construct(Rule $rule)
38 12
    {
39
        $this->rule = $rule;
40 12
    }
41 8
42
    /**
43
     * {@inheritdoc}
44 4
     */
45 4
    public function validate($input): Result
46 2
    {
47
        $ruleResult = $this->rule->validate($input);
48
        $ruleResult = $ruleResult->invert();
49
50 4
        return new Result($ruleResult->isValid(), $input, $this, [], $ruleResult);
51 4
    }
52
}
53