Closed as not planned
Description
Description
Validation groups is often predefined set of strings. Seems like it make sense to use enum for this. Probably backed string enums.
Right now there is an error if you try to use enums for groups.
TypeError : Illegal offset type
vendor/symfony/validator/Mapping/GenericMetadata.php:167
Example
enum MyEnum: string
{
case CASE_ONE = 'CASE_ONE';
case CASE_TWO = 'CASE_TWO';
}
#[Assert\Callback(groups: [MyEnum::CASE_ONE])]
class Foo
{
}