From a9a1410ac9525490616939fffc6e62b27dfab0f9 Mon Sep 17 00:00:00 2001 From: ReeceG Date: Wed, 3 Dec 2025 12:55:31 -0500 Subject: [PATCH] Fix parent constructor call to use null instead of empty array --- validation/custom_constraint.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst index ffe2a3560f5..e6f0352e847 100644 --- a/validation/custom_constraint.rst +++ b/validation/custom_constraint.rst @@ -29,10 +29,10 @@ First you need to create a Constraint class and extend :class:`Symfony\\Componen // all configurable options must be passed to the constructor public function __construct(?string $mode = null, ?string $message = null, ?array $groups = null, $payload = null) { - parent::__construct([], $groups, $payload); - $this->mode = $mode ?? $this->mode; $this->message = $message ?? $this->message; + + parent::__construct(null, $groups, $payload); } } @@ -62,7 +62,7 @@ You can use ``#[HasNamedArguments]`` to make some constraint options required:: ?array $groups = null, mixed $payload = null, ) { - parent::__construct([], $groups, $payload); + parent::__construct(null, $groups, $payload); } } @@ -93,7 +93,7 @@ in the ``__sleep()`` method to ensure they are serialized correctly:: ?array $groups = null, mixed $payload = null, ) { - parent::__construct([], $groups, $payload); + parent::__construct(null, $groups, $payload); } public function __sleep(): array