| Conditions | 6 |
| Paths | 8 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | public function sortBy(string $field): void |
||
| 38 | { |
||
| 39 | $this->sortDirection = $this->sortField === $field |
||
| 40 | ? $this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc' |
||
| 41 | : 'asc'; |
||
| 42 | |||
| 43 | if (empty($this->allowedFields) || |
||
| 44 | in_array($field, $this->allowedFields) || |
||
| 45 | $this->sortField === $field |
||
| 46 | ) { |
||
| 47 | $this->sortField = $field; |
||
| 48 | } |
||
| 63 |