8000 Feedback of Oskar · symfony/symfony@f519cc7 · GitHub
[go: up one dir, main page]

Skip to content

Commit f519cc7

Browse files
committed
Feedback of Oskar
1 parent e7c3437 commit f519cc7

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/Symfony/Component/Validator/Constraints/Date.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@ class Date extends Constraint
3838
* @param array<string,mixed>|null $options
3939
* @param string[]|null $groups
4040
*/
41-
public function __construct(
42-
?array $options = null,
43-
?string $message = null,
44-
?array $groups = null,
45-
mixed $payload = null,
46-
?string $format = null,
47-
) {
41+
public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null, ?string $format = null)
42+
{
4843
parent::__construct($options, $groups, $payload);
4944

5045
$this->message = $message ?? $this->message;

src/Symfony/Component/Validator/Constraints/DateValidator.php

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
class DateValidator extends ConstraintValidator
2323
{
24+
public const PATTERN = '/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/D';
25+
2426
public function validate(mixed $value, Constraint $constraint): void
2527
{
2628
if (!$constraint instanceof Date) {

0 commit comments

Comments
 (0)
0