| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function sort(array $fields) |
||
| 42 | { |
||
| 43 | $fieldKeyToOrder = []; |
||
| 44 | foreach ($fields as $key => $field) { |
||
| 45 | $fieldType = (string) $field->FldType; // @codingStandardsIgnoreLine |
||
| 46 | $fieldKeyToOrder[$key] = $this->getOrderByFieldType($fieldType); |
||
| 47 | } |
||
| 48 | |||
| 49 | // sort |
||
| 50 | asort($fieldKeyToOrder); |
||
| 51 | |||
| 52 | // apply the sort to the fields |
||
| 53 | return array_replace($fieldKeyToOrder, $fields); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |