Conditions | 3 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 6 | public function enableSorts(array $sorts) |
|
18 | { |
||
19 | 6 | $this->formatSorts($sorts) |
|
20 | 6 | ->each( |
|
21 | 6 | function (Sort $sort): void { |
|
22 | 6 | $thisIsRequestedSort = $this->isRequestedSort($sort); |
|
23 | 6 | if ($thisIsRequestedSort) { |
|
24 | 6 | $sort->sort($this->getBuilder(), $this->getSortValue($sort)); |
|
|
|||
25 | |||
26 | 6 | return; |
|
27 | } |
||
28 | |||
29 | 1 | if ($sort->hasDefaultDirection()) { |
|
30 | 1 | $sort->sort($this->getBuilder(), $sort->getDefaultDirection()); |
|
31 | } |
||
32 | } |
||
33 | ); |
||
34 | |||
35 | 6 | return $this; |
|
36 | } |
||
78 |