Total Complexity | 4 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
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 |
||
72 | ]; |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function getTargets() |
||
83 |