-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
ValidatorbughasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.
Description
Hi,
Forgive me if I'm wrong.
- Docs : The documentation about the Choice#callback constraint says that the available types are
string|array|Closure
. - Code : The Choice class constructor only accepts
callable|string
now since Symfony version6.x
.
Basically the doc says we can do this :
#[Assert\Choice(callback: [Genre::class, 'getGenres'])]
protected string $genre;
which throws the following error
TypeError: Symfony\Component\Validator\Constraints\Choice::__construct():
Argument #3 ($callback) must be of type callable|string|null, array given
Metadata
Metadata
Assignees
Labels
ValidatorbughasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.