@@ -35,117 +35,107 @@ final class ChoiceList
35
35
/**
36
36
* Creates a cacheable loader from any callable providing iterable choices.
37
37
*
38
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
39
- * @param callable $choices A callable that must return iterable choices or grouped choices
40
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the loader
38
+ * @param callable $choices A callable that must return iterable choices or grouped choices
39
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the loader
41
40
*/
42
- public static function lazy ($ formType , callable $ choices , $ vary = null ): ChoiceLoader
41
+ public static function lazy (FormTypeInterface | FormTypeExtensionInterface $ formType , callable $ choices , mixed $ vary = null ): ChoiceLoader
43
42
{
44
43
return self ::loader ($ formType , new CallbackChoiceLoader ($ choices ), $ vary );
45
44
}
46
45
47
46
/**
48
47
* Decorates a loader to make it cacheable.
49
48
*
50
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
51
- * @param ChoiceLoaderInterface $loader A loader responsible for creating loading choices or grouped choices
52
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the loader
49
+ * @param ChoiceLoaderInterface $loader A loader responsible for creating loading choices or grouped choices
50
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the loader
53
51
*/
54
- public static function loader ($ formType , ChoiceLoaderInterface $ loader , $ vary = null ): ChoiceLoader
52
+ public static function loader (FormTypeInterface | FormTypeExtensionInterface $ formType , ChoiceLoaderInterface $ loader , mixed $ vary = null ): ChoiceLoader
55
53
{
56
54
return new ChoiceLoader ($ formType , $ loader , $ vary );
57
55
}
58
56
59
57
/**
60
58
* Decorates a "choice_value" callback to make it cacheable.
61
59
*
62
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
63
- * @param callable $value Any pseudo callable to create a unique string value from a choice
64
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the callback
60
+ * @param callable|array $value Any pseudo callable to create a unique string value from a choice
61
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the callback
65
62
*/
66
- public static function value ($ formType , $ value , $ vary = null ): ChoiceValue
63
+ public static function value (FormTypeInterface | FormTypeExtensionInterface $ formType , callable | array $ value , mixed $ vary = null ): ChoiceValue
67
64
{
68
65
return new ChoiceValue ($ formType , $ value , $ vary );
69
66
}
70
67
71
68
/**
72
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
73
- * @param callable $filter Any pseudo callable to filter a choice list
74
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the callback
69
+ * @param callable|array $filter Any pseudo callable to filter a choice list
70
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the callback
75
71
*/
76
- public static function filter ($ formType , $ filter , $ vary = null ): ChoiceFilter
72
+ public static function filter (FormTypeInterface | FormTypeExtensionInterface $ formType , callable | array $ filter , mixed $ vary = null ): ChoiceFilter
77
73
{
78
74
return new ChoiceFilter ($ formType , $ filter , $ vary );
79
75
}
80
76
81
77
/**
82
78
* Decorates a "choice_label" option to make it cacheable.
83
79
*
84
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
85
- * @param callable|false $label Any pseudo callable to create a label from a choice or false to discard it
86
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the option
80
+ * @param callable|false $label Any pseudo callable to create a label from a choice or false to discard it
81
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the option
87
82
*/
88
- public static function label ($ formType , $ label , $ vary = null ): ChoiceLabel
83
+ public static function label (FormTypeInterface | FormTypeExtensionInterface $ formType , callable | false $ label , mixed $ vary = null ): ChoiceLabel
89
84
{
90
85
return new ChoiceLabel ($ formType , $ label , $ vary );
91
86
}
92
87
93
88
/**
94
89
* Decorates a "choice_name" callback to make it cacheable.
95
90
*
96
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
97
- * @param callable $fieldName Any pseudo callable to create a field name from a choice
98
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the callback
91
+ * @param callable|array $fieldName Any pseudo callable to create a field name from a choice
92
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the callback
99
93
*/
100
- public static function fieldName ($ formType , $ fieldName , $ vary = null ): ChoiceFieldName
94
+ public static function fieldName (FormTypeInterface | FormTypeExtensionInterface $ formType , callable | array $ fieldName , mixed $ vary = null ): ChoiceFieldName
101
95
{
102
96
return new ChoiceFieldName ($ formType , $ fieldName , $ vary );
103
97
}
104
98
105
99
/**
106
100
* Decorates a "choice_attr" option to make it cacheable.
107
101
*
108
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
109
- * @param callable|array $attr Any pseudo callable or array to create html attributes from a choice
110
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the option
102
+ * @param callable|array $attr Any pseudo callable or array to create html attributes from a choice
103
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the option
111
104
*/
112
- public static function attr ($ formType , $ attr , $ vary = null ): ChoiceAttr
105
+ public static function attr (FormTypeInterface | FormTypeExtensionInterface $ formType , callable | array $ attr , mixed $ vary = null ): ChoiceAttr
113
106
{
114
107
return new ChoiceAttr ($ formType , $ attr , $ vary );
115
108
}
116
109
117
110
/**
118
111
* Decorates a "choice_translation_parameters" option to make it cacheable.
119
112
*
120
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
121
- * @param callable|array $translationParameters Any pseudo callable or array to create translation parameters from a choice
122
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the option
113
+ * @param callable|array $translationParameters Any pseudo callable or array to create translation parameters from a choice
114
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the option
123
115
*/
124
- public static function translationParameters ($ formType , $ translationParameters , $ vary = null ): ChoiceTranslationParameters
116
+ public static function translationParameters (FormTypeInterface | FormTypeExtensionInterface $ formType , callable | array $ translationParameters , mixed $ vary = null ): ChoiceTranslationParameters
125
117
{
126
118
return new ChoiceTranslationParameters ($ formType , $ translationParameters , $ vary );
127
119
}
128
120
129
121
/**
130
122
* Decorates a "group_by" callback to make it cacheable.
131
123
*
132
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
133
- * @param callable $groupBy Any pseudo callable to return a group name from a choice
134
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the callback
124
+ * @param callable|array $groupBy Any pseudo callable to return a group name from a choice
125
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the callback
135
126
*/
136
- public static function groupBy ($ formType , $ groupBy , $ vary = null ): GroupBy
127
+ public static function groupBy (FormTypeInterface | FormTypeExtensionInterface $ formType , callable | array $ groupBy , mixed $ vary = null ): GroupBy
137
128
{
138
129
return new GroupBy ($ formType , $ groupBy , $ vary );
139
130
}
140
131
141
132
/**
142
133
* Decorates a "preferred_choices" option to make it cacheable.
143
134
*
144
- * @param FormTypeInterface|FormTypeExtensionInterface $formType A form type or type extension configuring a cacheable choice list
145
- * @param callable|array $preferred Any pseudo callable or array to return a group name from a choice
146
- * @param mixed|null $vary Dynamic data used to compute a unique hash when caching the option
135
+ * @param callable|array $preferred Any pseudo callable or array to return a group name from a choice
136
+ * @param mixed $vary Dynamic data used to compute a unique hash when caching the option
147
137
*/
148
- public static function preferred ($ formType , $ preferred , $ vary = null ): PreferredChoice
138
+ public static function preferred (FormTypeInterface | FormTypeExtensionInterface $ formType , callable | array $ preferred , mixed $ vary = null ): PreferredChoice
149
139
{
150
140
return new PreferredChoice ($ formType , $ preferred , $ vary );
151
141
}
0 commit comments