GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d82441...f18e32 )
by Christian
03:52
created

BatchTimeAfter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 59
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRequiredOptions() 0 5 1
A __construct() 0 8 2
A getTargets() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\Form\Validator\Constraints;
13
14
use Symfony\Component\Validator\Constraint;
15
use Symfony\Component\Validator\Exception\InvalidOptionsException;
16
17
/**
18
 * @Annotation
19
 *
20
 * @Target({"CLASS", "ANNOTATION"})
21
 */
22
final class BatchTimeAfter extends Constraint
23
{
24
    /**
25
     * @var string
26
     */
27
    public $firstField;
28
29
    /**
30
     * @var string
31
     */
32
    public $secondField;
33
34
    /**
35
     * @var string
36
     */
37
    public $message = 'error.second_batch_time_before_first';
38
39
    /**
40
     * @var string
41
     */
42
    public $emptyMessage = 'error.batch_time_part_empty';
43
44
    /**
45
     * @var bool
46
     */
47
    public $required = true;
48
49
    /**
50
     * @param array $options
51
     */
52
    public function __construct($options = null)
53
    {
54
        parent::__construct($options);
55
56
        if ($this->firstField === $this->secondField) {
57
            throw new InvalidOptionsException('The options "firstField" and "secondField" can not be the same for constraint '.__CLASS__, [
58
                'firstField',
59
                'secondField',
60
            ]);
61
        }
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function getRequiredOptions(): array
68
    {
69
        return [
70
            'firstField',
71
            'secondField',
72
        ];
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function getTargets()
79
    {
80
        return self::CLASS_CONSTRAINT;
81
    }
82
}
83