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
02:58
created

AgeException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A chooseTemplate() 0 12 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
namespace Respect\Validation\Exceptions;
13
14
class AgeException extends NestedValidationException
15
{
16
    const BOTH = 0;
17
    const LOWER = 1;
18
    const GREATER = 2;
19
20
    public static $defaultTemplates = [
21
        self::MODE_DEFAULT => [
22
            self::BOTH => '{{name}} must be between {{minAge}} and {{maxAge}} years ago',
23
            self::LOWER => '{{name}} must be lower than {{minAge}} years ago',
24
            self::GREATER => '{{name}} must be greater than {{maxAge}} years ago',
25
        ],
26
        self::MODE_NEGATIVE => [
27
            self::BOTH => '{{name}} must not be between {{minAge}} and {{maxAge}} years ago',
28
            self::LOWER => '{{name}} must not be lower than {{minAge}} years ago',
29
            self::GREATER => '{{name}} must not be greater than {{maxAge}} years ago',
30
        ],
31
    ];
32
33
    public function chooseTemplate()
34
    {
35
        if (!$this->getParam('minAge')) {
36
            return static::GREATER;
37
        }
38
39
        if (!$this->getParam('maxAge')) {
40
            return static::LOWER;
41
        }
42
43
        return static::BOTH;
44
    }
45
}
46