@@ -19,51 +19,44 @@ class DummyValidatedChoiceEntity
19
19
{
20
20
/**
21
21
* @var string
22
- *
23
- * @Assert\Choice(choices={"a", "b"})
24
22
*/
23
+ #[Assert \Choice(choices: ['a ' , 'b ' ])]
25
24
public $ dummySingleChoice ;
26
25
27
26
/**
28
27
* @var string
29
- *
30
- * @Assert\Choice(callback={DummyValidatedChoiceEntity::class, "getChoices"})
31
28
*/
29
+ #[Assert \Choice(callback: [self ::class, 'getChoices ' ])]
32
30
public $ dummySingleChoiceCallback ;
33
31
34
32
/**
35
33
* @var string[]
36
- *
37
- * @Assert\Choice(choices={"a", "b"}, multiple=true)
38
34
*/
35
+ #[Assert \Choice(choices: ['a ' , 'b ' ], multiple: true )]
39
36
public $ dummyMultiChoice ;
40
37
41
38
/**
42
39
* @var string[]
43
- *
44
- * @Assert\Choice(callback={DummyValidatedChoiceEntity::class, "getChoices"}, multiple=true)
45
40
*/
41
+ #[Assert \Choice(callback: [self ::class, 'getChoices ' ], multiple: true )]
46
42
public $ dummyMultiChoiceCallback ;
47
43
48
44
/**
49
45
* @var string[]
50
- *
51
- * @Assert\Choice(choices={"a", "b", "c", "d"}, multiple=true, min=2)
52
46
*/
47
+ #[Assert \Choice(choices: ['a ' , 'b ' , 'c ' , 'd ' ], multiple: true , min: 2 )]
53
48
public $ dummyMultiChoiceMin ;
54
49
55
50
/**
56
51
* @var string[]
57
- *
58
- * @Assert\Choice(choices={"a", "b", "c", "d"}, multiple=true, max=4)
59
52
*/
53
+ #[Assert \Choice(choices: ['a ' , 'b ' , 'c ' , 'd ' ], multiple: true , max: 4 )]
60
54
public $ dummyMultiChoiceMax ;
61
55
62
56
/**
63
57
* @var string[]
64
- *
65
- * @Assert\Choice(choices={"a", "b", "c", "d"}, multiple=true, min=2, max=4)
66
58
*/
59
+ #[Assert \Choice(choices: ['a ' , 'b ' , 'c ' , 'd ' ], multiple: true , min: 2 , max: 4 )]
67
60
public $ dummyMultiChoiceMinMax ;
68
61
69
62
public static function getChoices (): array
0 commit comments