Total Complexity | 10 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | trait WithSorts |
||
10 | { |
||
11 | /** |
||
12 | * 排序逻辑. |
||
13 | * |
||
14 | * @param array $sorts |
||
15 | * |
||
16 | * @return mixed |
||
17 | */ |
||
18 | 3 | public function enableSorts($sorts) |
|
37 | } |
||
38 | |||
39 | 3 | protected function isRequestedSort(Sort $sort) |
|
40 | { |
||
41 | 3 | return $this->request->input('asc') === $sort->getProperty() || $this->request->input('desc') === $sort->getProperty(); |
|
42 | } |
||
43 | |||
44 | 3 | protected function getSortValue(Sort $sort) |
|
51 | } |
||
52 | |||
53 | 3 | public function formatSorts($sorts) |
|
70 |