$attr,
$labelTranslationParameters,
$preferredChoices,
$preferredViews,
$preferredViewsOrder,
$otherViews );
} uksort($preferredViews,
static fn ($a,
$b) =>
isset($preferredViewsOrder[$a],
$preferredViewsOrder[$b]) ?
$preferredViewsOrder[$a] <=>
$preferredViewsOrder[$b] : 0
);
return new ChoiceListView($otherViews,
$preferredViews);
} private static function addChoiceView($choice, string
$value,
$label, array
$keys, &
$index,
$attr,
$labelTranslationParameters, ?callable
$isPreferred, array &
$preferredViews, array &
$preferredViewsOrder, array &
$otherViews): void
{ // $value may be an integer or a string, since it's stored in the array
// keys. We want to guarantee it's a string though.
$key =
$keys[$value];
$nextIndex = \
is_int($index) ?
$index++ :
$index($choice,
$key,
$value);
// BC normalize label to accept a false value
if (null ===
$label) {