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