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 (#817)
by Henrique
06:24
created

NameException::chooseTemplate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
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
namespace Respect\Validation\Exceptions;
13
14
class NameException extends ValidationException
15
{
16
    const WITH_LOCALE = 2;
17
18
    /**
19
     * @var array
20
     */
21
    public static $defaultTemplates = [
22
        self::MODE_DEFAULT => [
23
            self::STANDARD => '{{name}} must be a valid name',
24
            self::WITH_LOCALE => '{{name}} must be a valid {{locale}} name',
25
        ],
26
        self::MODE_NEGATIVE => [
27
            self::STANDARD => '{{name}} must not be a valid name',
28
            self::WITH_LOCALE => '{{name}} must not be a valid {{locale}} name',
29
        ],
30
    ];
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function chooseTemplate()
36
    {
37
        if ($this->getParam('locale')) {
38
            return static::WITH_LOCALE;
39
        }
40
41
        return parent::chooseTemplate();
42
    }
43
}
44