@@ 435-446 (lines=12) @@ | ||
432 | * |
|
433 | * @throws \InvalidArgumentException |
|
434 | */ |
|
435 | public function uasort($function) |
|
436 | { |
|
437 | if (!is_callable($function)) { |
|
438 | throw new \InvalidArgumentException( |
|
439 | 'Passed function must be callable' |
|
440 | ); |
|
441 | } |
|
442 | ||
443 | uasort($this->array, $function); |
|
444 | ||
445 | return $this; |
|
446 | } |
|
447 | ||
448 | /** |
|
449 | * Sort the entries by keys using a user-defined comparison function. |
|
@@ 833-844 (lines=12) @@ | ||
830 | * |
|
831 | * @throws \InvalidArgumentException |
|
832 | */ |
|
833 | public function customSortKeys($function) |
|
834 | { |
|
835 | if (!is_callable($function)) { |
|
836 | throw new \InvalidArgumentException( |
|
837 | 'Passed function must be callable' |
|
838 | ); |
|
839 | } |
|
840 | ||
841 | uksort($this->array, $function); |
|
842 | ||
843 | return $this; |
|
844 | } |
|
845 | ||
846 | /** |
|
847 | * Custom sort by value via "usort". |
|
@@ 857-868 (lines=12) @@ | ||
854 | * |
|
855 | * @throws \InvalidArgumentException |
|
856 | */ |
|
857 | public function customSortValues($function) |
|
858 | { |
|
859 | if (!is_callable($function)) { |
|
860 | throw new \InvalidArgumentException( |
|
861 | 'Passed function must be callable' |
|
862 | ); |
|
863 | } |
|
864 | ||
865 | usort($this->array, $function); |
|
866 | ||
867 | return $this; |
|
868 | } |
|
869 | ||
870 | /** |
|
871 | * Return values that are only in the current array. |