@@ -35,117 +35,107 @@ final class ChoiceList
3535/**
3636 * Creates a cacheable loader from any callable providing iterable choices.
3737 *
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
4140 */
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
4342 {
4443return self ::loader ($ formType ,new CallbackChoiceLoader ($ choices ),$ vary );
4544 }
4645
4746/**
4847 * Decorates a loader to make it cacheable.
4948 *
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
5351 */
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
5553 {
5654return new ChoiceLoader ($ formType ,$ loader ,$ vary );
5755 }
5856
5957/**
6058 * Decorates a "choice_value" callback to make it cacheable.
6159 *
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
6562 */
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
6764 {
6865return new ChoiceValue ($ formType ,$ value ,$ vary );
6966 }
7067
7168/**
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
7571 */
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
7773 {
7874return new ChoiceFilter ($ formType ,$ filter ,$ vary );
7975 }
8076
8177/**
8278 * Decorates a "choice_label" option to make it cacheable.
8379 *
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
8782 */
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
8984 {
9085return new ChoiceLabel ($ formType ,$ label ,$ vary );
9186 }
9287
9388/**
9489 * Decorates a "choice_name" callback to make it cacheable.
9590 *
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
9993 */
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
10195 {
10296return new ChoiceFieldName ($ formType ,$ fieldName ,$ vary );
10397 }
10498
10599/**
106100 * Decorates a "choice_attr" option to make it cacheable.
107101 *
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
111104 */
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
113106 {
114107return new ChoiceAttr ($ formType ,$ attr ,$ vary );
115108 }
116109
117110/**
118111 * Decorates a "choice_translation_parameters" option to make it cacheable.
119112 *
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
123115 */
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
125117 {
126118return new ChoiceTranslationParameters ($ formType ,$ translationParameters ,$ vary );
127119 }
128120
129121/**
130122 * Decorates a "group_by" callback to make it cacheable.
131123 *
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
135126 */
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
137128 {
138129return new GroupBy ($ formType ,$ groupBy ,$ vary );
139130 }
140131
141132/**
142133 * Decorates a "preferred_choices" option to make it cacheable.
143134 *
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
147137 */
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
149139 {
150140return new PreferredChoice ($ formType ,$ preferred ,$ vary );
151141 }