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 (#923)
by lee
03:57
created

BetweenException::chooseTemplate()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.6666
c 0
b 0
f 0
cc 3
eloc 5
nc 3
nop 0
crap 3
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
declare(strict_types=1);
13
14
namespace Respect\Validation\Exceptions;
15
16
class BetweenException extends NestedValidationException
17
{
18
    const BOTH = 0;
19
    const LOWER = 1;
20
    const GREATER = 2;
21
22
    public static $defaultTemplates = [
23
        self::MODE_DEFAULT => [
24
            self::BOTH => '{{name}} must be between {{minValue}} and {{maxValue}}',
25
            self::LOWER => '{{name}}  must be greater than {{minValue}}',
26
            self::GREATER => '{{name}} must be lower than {{maxValue}}',
27
        ],
28
        self::MODE_NEGATIVE => [
29
            self::BOTH => '{{name}} must not be between {{minValue}} and {{maxValue}}',
30
            self::LOWER => '{{name}}  must not be greater than {{minValue}}',
31
            self::GREATER => '{{name}} must not be lower than {{maxValue}}',
32
        ],
33
    ];
34
35 12
    public function chooseTemplate()
36
    {
37 12
        if (!$this->getParam('minValue')) {
38 4
            return static::GREATER;
39 8
        } elseif (!$this->getParam('maxValue')) {
40 1
            return static::LOWER;
41
        }
42
43 7
        return static::BOTH;
44
    }
45
}
46