Skip to content

Commit a9a1410

Browse files
authored
Fix parent constructor call to use null instead of empty array
1 parent 840aa55 commit a9a1410

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

validation/custom_constraint.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ First you need to create a Constraint class and extend :class:`Symfony\\Componen
2929
// all configurable options must be passed to the constructor
3030
public function __construct(?string $mode = null, ?string $message = null, ?array $groups = null, $payload = null)
3131
{
32-
parent::__construct([], $groups, $payload);
33-
3432
$this->mode = $mode ?? $this->mode;
3533
$this->message = $message ?? $this->message;
34+
35+
parent::__construct(null, $groups, $payload);
3636
}
3737
}
3838
@@ -62,7 +62,7 @@ You can use ``#[HasNamedArguments]`` to make some constraint options required::
6262
?array $groups = null,
6363
mixed $payload = null,
6464
) {
65-
parent::__construct([], $groups, $payload);
65+
parent::__construct(null, $groups, $payload);
6666
}
6767
}
6868

@@ -93,7 +93,7 @@ in the ``__sleep()`` method to ensure they are serialized correctly::
9393
?array $groups = null,
9494
mixed $payload = null,
9595
) {
96-
parent::__construct([], $groups, $payload);
96+
parent::__construct(null, $groups, $payload);
9797
}
9898

9999
public function __sleep(): array

0 commit comments

Comments
 (0)