| Total Complexity | 7 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | abstract class AbstractSorter implements CollectionSorterInterface |
||
| 9 | { |
||
| 10 | 72 | public function sort(array $array, string $order): array |
|
| 15 | } |
||
| 16 | |||
| 17 | 68 | protected function getSortedArray(array $array, string $order): array |
|
| 28 | } |
||
| 29 | |||
| 30 | 72 | protected function validateOrder($order): void |
|
| 33 | } |
||
| 34 | |||
| 35 | 68 | protected function getSortingFunction(string $order): callable |
|
| 36 | { |
||
| 37 | 68 | return fn ($a, $b) => $this->doSortingOperation($a, $b, $order); |
|
| 38 | } |
||
| 39 | |||
| 40 | 68 | protected function doSortingOperation(object $a, object $b, string $order): int |
|
| 43 | } |
||
| 44 | |||
| 45 | abstract protected function compare(object $a, object $b): int; |
||
| 46 | } |
||
| 47 |