Conditions | 6 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 42 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
48 | public function choice(FormView $choice) |
||
49 | { |
||
50 | $that = $this; |
||
51 | if ($choice->vars['compound']) { |
||
52 | usort($choice->children, function (FormView $a, FormView $b) use ($that) { |
||
53 | return $that->compare($a->vars['label']?:$a->vars['value'], $b->vars['label']?:$b->vars['value']); |
||
54 | }); |
||
55 | } else { |
||
56 | usort($choice->vars['choices'], function (ChoiceView $a, ChoiceView $b) use ($that) { |
||
57 | return $that->compare($a->label?:$a->value, $b->label?:$b->value); |
||
58 | }); |
||
59 | } |
||
60 | } |
||
61 | |||
77 |