public function choice(FormView $choice)
    {
        $that = $this;
        if ($choice->vars['compound']) {
            usort($choice->children, function (FormView $a, FormView $b) use ($that) {
                return $that->compare($a->vars['label'] ?: $a->vars['value'], $b->vars['label'] ?: $b->vars['value']);
            });
        } else {
            usort($choice->vars['choices'], function (ChoiceView $a, ChoiceView $b) use ($that) {
                return $that->compare($a->label ?: $a->value, $b->label ?: $b->value);
            });
        }
    }
public function choice(FormView $choice)
    {
        $that = $this;
        if ($choice->vars['compound']) {
            usort($choice->children, function (FormView $a, FormView $b) use ($that) {
                return $that->compare($a->vars['label'] ?: $a->vars['value'], $b->vars['label'] ?: $b->vars['value']);
            });
        } else {
            usort($choice->vars['choices'], function (ChoiceView $a, ChoiceView $b) use ($that) {
                return $that->compare($a->label ?: $a->value, $b->label ?: $b->value);
            });
        }
    }
public function choice ( FormView $ choice ) { $ that = $ this ; if ( $ choice -> vars [ 'compound' ] ) { usort ( $ choice -> children , function ( FormView $ a , FormView $ b ) use ( $ that ) { return $ that -> compare ( $ a -> vars [ 'label' ] ? : $ a -> vars [ 'value' ] , $ b -> vars [ 'label' ] ? : $ b -> vars [ 'value' ] ) ; } ) ; } else { usort ( $ choice -> vars [ 'choices' ] , function ( ChoiceView $ a , ChoiceView $ b ) use ( $ that ) { return $ that -> compare ( $ a -> label ? : $ a -> value , $ b -> label ? : $ b -> value ) ; } ) ; } }
Sort choice.

@param FormView $choice
Sort choice .