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

Passed
Pull Request — master (#916)
by Henrique
04:04
created

MaximumAgeException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A chooseTemplate() 0 11 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
final class MaximumAgeException 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 {{minAge}} and {{maxAge}} years ago',
25
            self::LOWER => '{{name}} must be lower than {{minAge}} years ago',
26
            self::GREATER => '{{name}} must be greater than {{maxAge}} years ago',
27
        ],
28
        self::MODE_NEGATIVE => [
29
            self::BOTH => '{{name}} must not be between {{minAge}} and {{maxAge}} years ago',
30
            self::LOWER => '{{name}} must not be lower than {{minAge}} years ago',
31
            self::GREATER => '{{name}} must not be greater than {{maxAge}} years ago',
32
        ],
33
    ];
34
35
    public function chooseTemplate()
36
    {
37
        if (!$this->getParam('minAge')) {
38
            return static::GREATER;
39
        }
40
41
        if (!$this->getParam('maxAge')) {
42
            return static::LOWER;
43
        }
44
45
        return static::BOTH;
46
    }
47
}
48