@@ -118,7 +118,7 @@ private static function addChoiceView($choice, $value, $label, $keys, &$index, $
118118 // $value may be an integer or a string, since it's stored in the array
119119 // keys. We want to guarantee it's a string though.
120120 $ key = $ keys [$ value ];
121- $ nextIndex = \is_int ($ index ) ? $ index ++ : \call_user_func ( $ index, $ choice , $ key , $ value );
121+ $ nextIndex = \is_int ($ index ) ? $ index ++ : $ index( $ choice , $ key , $ value );
122122
123123 // BC normalize label to accept a false value
124124 if (null === $ label ) {
@@ -127,7 +127,7 @@ private static function addChoiceView($choice, $value, $label, $keys, &$index, $
127127 } elseif (false !== $ label ) {
128128 // If "choice_label" is set to false and "expanded" is true, the value false
129129 // should be passed on to the "label" option of the checkboxes/radio buttons
130- $ dynamicLabel = \call_user_func ( $ label, $ choice , $ key , $ value );
130+ $ dynamicLabel = $ label( $ choice , $ key , $ value );
131131 $ label = false === $ dynamicLabel ? false : (string ) $ dynamicLabel ;
132132 }
133133
@@ -137,11 +137,11 @@ private static function addChoiceView($choice, $value, $label, $keys, &$index, $
137137 $ label ,
138138 // The attributes may be a callable or a mapping from choice indices
139139 // to nested arrays
140- \is_callable ($ attr ) ? \call_user_func ( $ attr, $ choice , $ key , $ value ) : (isset ($ attr [$ key ]) ? $ attr [$ key ] : array ())
140+ \is_callable ($ attr ) ? $ attr( $ choice , $ key , $ value ) : (isset ($ attr [$ key ]) ? $ attr [$ key ] : array ())
141141 );
142142
143143 // $isPreferred may be null if no choices are preferred
144- if ($ isPreferred && \call_user_func ( $ isPreferred, $ choice , $ key , $ value )) {
144+ if ($ isPreferred && $ isPreferred( $ choice , $ key , $ value )) {
145145 $ preferredViews [$ nextIndex ] = $ view ;
146146 } else {
147147 $ otherViews [$ nextIndex ] = $ view ;
@@ -200,7 +200,7 @@ private static function addChoiceViewsGroupedBy($groupBy, $label, $choices, $key
200200
201201 private static function addChoiceViewGroupedBy ($ groupBy , $ choice , $ value , $ label , $ keys , &$ index , $ attr , $ isPreferred , &$ preferredViews , &$ otherViews )
202202 {
203- $ groupLabel = \call_user_func ( $ groupBy, $ choice , $ keys [$ value ], $ value );
203+ $ groupLabel = $ groupBy( $ choice , $ keys [$ value ], $ value );
204204
205205 if (null === $ groupLabel ) {
206206 // If the callable returns null, don't group the choice
0 commit comments