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 (#941)
by Henrique
03:04 queued 45s
created

DateTimeException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 37
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A chooseTemplate() 0 3 2
A configure() 0 8 1
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 function strtotime;
17
18
/**
19
 * @author Alexandre Gomes Gaigalas <[email protected]>
20
 * @author Henrique Moody <[email protected]>
21
 */
22
final class DateTimeException extends ValidationException
23
{
24
    public const FORMAT = 1;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public static $defaultTemplates = [
30
        self::MODE_DEFAULT => [
31
            self::STANDARD => '{{name}} must be a valid date/time',
32
            self::FORMAT => '{{name}} must be a valid date/time in the format {{sample}}',
33
        ],
34
        self::MODE_NEGATIVE => [
35
            self::STANDARD => '{{name}} must not be a valid date/time',
36
            self::FORMAT => '{{name}} must not be a valid date/time in the format {{sample}}',
37
        ],
38
    ];
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function configure($name, array $params = [])
44
    {
45
        $params['sample'] = date(
46
            (string) $params['format'],
47
            strtotime('2005-12-30 01:02:03')
48
        );
49
50
        return parent::configure($name, $params);
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function chooseTemplate()
57
    {
58
        return $this->getParam('format') ? static::FORMAT : static::STANDARD;
59
    }
60
}
61