Replies: 1 comment 5 replies
-
use Symfony\Component\Validator\Constraints\Type;
class User {
#[All(new Type(RoleEnum::class))]
private array $roles = [];
} should do the trick. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this error message

Environnement
Symfony 6.1.4
php 8.1.10
Thanks in advance for helping me
Beta Was this translation helpful? Give feedback.
All reactions