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 (#1101)
by
unknown
02:37
created

IpException::chooseTemplate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2.0625
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 IpException extends ValidationException
17
{
18
    private const NETWORK_RANGE = 'network_range';
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public static $defaultTemplates = [
24
        self::MODE_DEFAULT => [
25
            self::STANDARD => '{{name}} must be an IP address',
26
            self::NETWORK_RANGE => '{{name}} must be an IP address in the {{range}} range',
27
        ],
28
        self::MODE_NEGATIVE => [
29
            self::STANDARD => '{{name}} must not be an IP address',
30
            self::NETWORK_RANGE => '{{name}} must not be an IP address in the {{range}} range',
31
        ],
32
    ];
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 1
    protected function chooseTemplate(): string
38
    {
39 1
        if (!$this->getParam('networkRange')) {
40
            return static::STANDARD;
41
        }
42
43 1
        return static::NETWORK_RANGE;
44
    }
45
}
46