@@ 441-452 (lines=12) @@ | ||
438 | * |
|
439 | * @throws \InvalidArgumentException |
|
440 | */ |
|
441 | public function uasort($function) |
|
442 | { |
|
443 | if (!is_callable($function)) { |
|
444 | throw new \InvalidArgumentException( |
|
445 | 'Passed function must be callable' |
|
446 | ); |
|
447 | } |
|
448 | ||
449 | uasort($this->array, $function); |
|
450 | ||
451 | return $this; |
|
452 | } |
|
453 | ||
454 | /** |
|
455 | * Sort the entries by keys using a user-defined comparison function. |
|
@@ 941-952 (lines=12) @@ | ||
938 | * |
|
939 | * @throws \InvalidArgumentException |
|
940 | */ |
|
941 | public function customSortKeys($function) |
|
942 | { |
|
943 | if (!is_callable($function)) { |
|
944 | throw new \InvalidArgumentException( |
|
945 | 'Passed function must be callable' |
|
946 | ); |
|
947 | } |
|
948 | ||
949 | uksort($this->array, $function); |
|
950 | ||
951 | return $this; |
|
952 | } |
|
953 | ||
954 | /** |
|
955 | * Custom sort by value via "usort". |
|
@@ 965-976 (lines=12) @@ | ||
962 | * |
|
963 | * @throws \InvalidArgumentException |
|
964 | */ |
|
965 | public function customSortValues($function) |
|
966 | { |
|
967 | if (!is_callable($function)) { |
|
968 | throw new \InvalidArgumentException( |
|
969 | 'Passed function must be callable' |
|
970 | ); |
|
971 | } |
|
972 | ||
973 | usort($this->array, $function); |
|
974 | ||
975 | return $this; |
|
976 | } |
|
977 | ||
978 | /** |
|
979 | * Return values that are only in the current array. |