Closed
Description
Description
Hi,
would be nice if it would be possible to use native enum objects in expression language context similar to constants.
See expression option of "When" Constraint in the following example.
cc @mvhirsch
Example
#[When(
expression: 'this.type.equalsOneOf([
enum(App\Type::CAR),
enum(App\Type::BICYCLE),
])',
constraints: [
new NotBlank(),
new GreaterThan(value: 0),
]
)]
public ?int $wheelAmount;