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 (#1209)
by Henrique
03:21
created

SortedException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 11
dl 0
loc 25
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
use Respect\Validation\Rules\Sorted;
17
18
/**
19
 * @author Henrique Moody <[email protected]>
20
 * @author Mikhail Vyrtsev <[email protected]>
21
 */
22
final class SortedException extends ValidationException
23
{
24
    public const ASCENDING = 'ascending';
25
    public const DESCENDING = 'descending';
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public static $defaultTemplates = [
31
        self::MODE_DEFAULT => [
32
            self::ASCENDING => '{{name}} must be sorted in ascending order',
33
            self::DESCENDING => '{{name}} must be sorted in descending order',
34
        ],
35
        self::MODE_NEGATIVE => [
36
            self::ASCENDING => '{{name}} must not be sorted in ascending order',
37
            self::DESCENDING => '{{name}} must not be sorted in descending order',
38
        ],
39
    ];
40
41
    /**
42
     * {@inheritdoc}
43
     */
44 1
    protected function chooseTemplate(): string
45
    {
46 1
        return $this->getParam('direction') === Sorted::ASCENDING ? self::ASCENDING : self::DESCENDING;
47
    }
48
}
49