1 | <?php |
||
12 | trait SortableTrait |
||
13 | { |
||
14 | /** |
||
15 | * {@inheritdoc} |
||
16 | * |
||
17 | * @link http://php.net/manual/en/function.usort.php |
||
18 | */ |
||
19 | 4 | public function customSort(callable $func) |
|
25 | |||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | * |
||
29 | * @link http://php.net/manual/en/function.uksort.php |
||
30 | */ |
||
31 | 4 | public function customSortKeys(callable $func) |
|
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | * |
||
41 | * @link http://php.net/manual/en/function.arsort.php |
||
42 | * @link http://php.net/manual/en/function.sort.php |
||
43 | * @link http://php.net/manual/en/function.asort.php |
||
44 | * @link http://php.net/manual/en/function.rsort.php |
||
45 | */ |
||
46 | 16 | public function sort($order = SORT_ASC, $strategy = SORT_REGULAR, $preserveKeys = false) |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | * |
||
56 | * @link http://php.net/manual/en/function.ksort.php |
||
57 | * @link http://php.net/manual/en/function.krsort.php |
||
58 | */ |
||
59 | 8 | public function sortKeys($order = SORT_ASC, $strategy = SORT_REGULAR) |
|
65 | |||
66 | /** |
||
67 | * @param array &$elements |
||
68 | * @param int $order |
||
69 | * @param int $strategy |
||
70 | * @param bool $preserveKeys |
||
71 | */ |
||
72 | 16 | protected function sorting(array &$elements, $order = SORT_ASC, $strategy = SORT_REGULAR, $preserveKeys = false) |
|
92 | |||
93 | /** |
||
94 | * @param array &$elements |
||
95 | * @param int $order |
||
96 | * @param int $strategy |
||
97 | */ |
||
98 | 8 | protected function sortingKeys(array &$elements, $order = SORT_ASC, $strategy = SORT_REGULAR) |
|
110 | } |
||
111 |