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

DateTimeException::chooseTemplate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 0
crap 6
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 DateTimeException extends ValidationException
15
{
16
    const FORMAT = 1;
17
18
    public static $defaultTemplates = [
19
        self::MODE_DEFAULT => [
20
            self::STANDARD => '{{name}} must be a valid date/time',
21
            self::FORMAT => '{{name}} must be a valid date/time. Sample format: {{format}}',
22
        ],
23
        self::MODE_NEGATIVE => [
24
            self::STANDARD => '{{name}} must not be a valid date/time',
25
            self::FORMAT => '{{name}} must not be a valid date/time in the format {{format}}',
26
        ],
27
    ];
28
29
    public function configure($name, array $params = [])
30
    {
31
        $params['format'] = date(
32
            $params['format'],
33
            strtotime('2005-12-30 01:02:03')
34
        );
35
36
        return parent::configure($name, $params);
37
    }
38
39
    public function chooseTemplate()
40
    {
41
        return $this->getParam('format') ? static::FORMAT : static::STANDARD;
42
    }
43
}
44