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 (#963)
by Emmerson
02:39
created

KeyNestedException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 19
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A chooseTemplate() 0 3 2
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
 * Exceptions to be thrown by the Attribute Rule.
18
 *
19
 * @author Henrique Moody <[email protected]>
20
 */
21
final class KeyNestedException extends NestedValidationException implements NonOmissibleException
22
{
23
    private const NOT_PRESENT = 'not_present';
24
    private const INVALID = 'invalid';
25
26
    public static $defaultTemplates = [
27
        self::MODE_DEFAULT => [
28
            self::NOT_PRESENT => 'No items were found for key chain {{name}}',
29
            self::INVALID => 'Key chain {{name}} is not valid',
30
        ],
31
        self::MODE_NEGATIVE => [
32
            self::NOT_PRESENT => 'Items for key chain {{name}} must not be present',
33
            self::INVALID => 'Key chain {{name}} must not be valid',
34
        ],
35
    ];
36
37 4
    protected function chooseTemplate(): string
38
    {
39 4
        return $this->getParam('hasReference') ? static::INVALID : static::NOT_PRESENT;
40
    }
41
}
42