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 (#1206)
by
unknown
03:58
created

SizeException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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
/**
17
 * Exception class for Size rule.
18
 *
19
 * @author Henrique Moody <[email protected]>
20
 */
21
final class SizeException extends NestedValidationException
22
{
23
    public const BOTH = 'both';
24
    public const LOWER = 'lower';
25
    public const GREATER = 'greater';
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public static $defaultTemplates = [
31
        self::MODE_DEFAULT => [
32
            self::BOTH => '{{name}} must be between {{minSize}} and {{maxSize}}',
33
            self::LOWER => '{{name}} must be greater than {{minSize}}',
34
            self::GREATER => '{{name}} must be lower than {{maxSize}}',
35
        ],
36
        self::MODE_NEGATIVE => [
37
            self::BOTH => '{{name}} must not be between {{minSize}} and {{maxSize}}',
38
            self::LOWER => '{{name}} must not be greater than {{minSize}}',
39
            self::GREATER => '{{name}} must not be lower than {{maxSize}}',
40
        ],
41
    ];
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 1
    protected function chooseTemplate(): string
47
    {
48 1
        if (!$this->getParam('minValue')) {
49 1
            return self::GREATER;
50
        }
51
52 1
        if (!$this->getParam('maxValue')) {
53 1
            return self::LOWER;
54
        }
55
56 1
        return self::BOTH;
57
    }
58
}
59