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
Push — master ( 5444ab...1f6c82 )
by Henrique
03:35
created

SortedException::chooseTemplate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 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