Closed
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