| Conditions | 5 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 7 | public function sortClass(string $colonneordinamento, array $modellocampo): string |
|
| 27 | { |
||
| 28 | 7 | if (true === $modellocampo['association'] || true === $modellocampo['campoextra']) { |
|
| 29 | 4 | $sorttype = ''; |
|
| 30 | } else { |
||
| 31 | 7 | $cursort = json_decode($colonneordinamento, true); |
|
| 32 | 7 | if (array_key_exists($modellocampo['nomecampo'], $cursort)) { |
|
| 33 | 6 | if ('ASC' == $cursort[$modellocampo['nomecampo']]) { |
|
| 34 | 1 | $sorttype = 'sorting_asc'; |
|
| 35 | } else { |
||
| 36 | 6 | $sorttype = 'sorting_desc'; |
|
| 37 | } |
||
| 38 | } else { |
||
| 39 | 7 | $sorttype = 'sorting'; |
|
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | 7 | return $sorttype; |
|
| 44 | } |
||
| 46 |