| Conditions | 3 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 61 | 6 | protected function formatSorts($sorts): Collection |
|
| 62 | { |
||
| 63 | 6 | return collect($sorts)->map( |
|
| 64 | 6 | function ($sort, $key): Sort { |
|
| 65 | 6 | if ($sort instanceof Sort) { |
|
| 66 | 3 | return $sort; |
|
| 67 | } |
||
| 68 | |||
| 69 | 4 | if (\is_string($key)) { |
|
| 70 | 1 | return Sort::field($key, $sort); |
|
| 71 | } |
||
| 72 | |||
| 73 | 3 | return Sort::field($sort); |
|
| 74 | } |
||
| 78 |