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:27
created

Between::__construct()   B

Complexity

Conditions 6
Paths 5

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 42

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 10
cp 0
rs 8.8571
c 0
b 0
f 0
cc 6
eloc 9
nc 5
nop 3
crap 42
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\Exceptions\ComponentException;
15
16
class Between
17
{
18
    public $minValue;
19
    public $maxValue;
20
21
    public function __construct($min = null, $max = null, $inclusive = true)
22
    {
23
        $this->minValue = $min;
24
        $this->maxValue = $max;
25
        if (!is_null($min) && !is_null($max) && $min > $max) {
26
            throw new ComponentException(sprintf('%s cannot be less than  %s for validation', $min, $max));
27
        }
28
29
        if (!is_null($min)) {
30
            $this->addRule(new Min($min, $inclusive));
0 ignored issues
show
Bug introduced by
The method addRule() does not seem to exist on object<Respect\Validation\Rules\Between>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
31
        }
32
33
        if (!is_null($max)) {
34
            $this->addRule(new Max($max, $inclusive));
0 ignored issues
show
Bug introduced by
The method addRule() does not seem to exist on object<Respect\Validation\Rules\Between>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
35
        }
36
    }
37
}
38