Skip to content

Commit ec4064b

Browse files
committed
refactor: Removed Deprecation from Validator constraints.
1 parent 81f071f commit ec4064b

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/Import/Domain/Validation/Constraints/ArrivalNotBeforeCreation.php

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,31 @@
77
#[\Attribute(\Attribute::TARGET_CLASS)]
88
final class ArrivalNotBeforeCreation extends Constraint
99
{
10-
public string $createdAtField = 'createdAt';
10+
public string $createdAtField;
1111

12-
public string $arrivalAtField = 'arrivalAt';
12+
public string $arrivalAtField;
1313

14-
public string $format = 'd.m.Y H:i';
14+
public string $format;
1515

16-
public string $message = 'Arrival time must be on/after created time.';
16+
public string $message;
1717

1818
/**
19-
* @param array<string, mixed>|null $options
20-
* @param array<int, string>|null $groups
19+
* @param array<int, string>|null $groups
2120
*/
2221
public function __construct(
23-
?array $options = null,
22+
string $createdAtField = 'createdAt',
23+
string $arrivalAtField = 'arrivalAt',
24+
string $format = 'd.m.Y H:i',
25+
string $message = 'Arrival time must be on/after created time.',
2426
?array $groups = null,
2527
mixed $payload = null,
26-
?string $createdAtField = null,
27-
?string $arrivalAtField = null,
28-
?string $format = null,
29-
?string $message = null,
3028
) {
31-
parent::__construct($options ?? [], $groups, $payload);
32-
$this->createdAtField = $createdAtField ?? $this->createdAtField;
33-
$this->arrivalAtField = $arrivalAtField ?? $this->arrivalAtField;
34-
$this->format = $format ?? $this->format;
35-
$this->message = $message ?? $this->message;
29+
$this->createdAtField = $createdAtField;
30+
$this->arrivalAtField = $arrivalAtField;
31+
$this->format = $format;
32+
$this->message = $message;
33+
34+
parent::__construct(groups: $groups, payload: $payload);
3635
}
3736

3837
#[\Override]

0 commit comments

Comments
 (0)