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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 28
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A chooseTemplate() 0 9 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