Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions validation/custom_constraint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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
Expand Down