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