@@ 510-521 (lines=12) @@ | ||
507 | * |
|
508 | * @throws \InvalidArgumentException |
|
509 | */ |
|
510 | public function uasort($function) |
|
511 | { |
|
512 | if (!\is_callable($function)) { |
|
513 | throw new \InvalidArgumentException( |
|
514 | 'Passed function must be callable' |
|
515 | ); |
|
516 | } |
|
517 | ||
518 | \uasort($this->array, $function); |
|
519 | ||
520 | return $this; |
|
521 | } |
|
522 | ||
523 | /** |
|
524 | * Sort the entries by keys using a user-defined comparison function. |
|
@@ 1190-1201 (lines=12) @@ | ||
1187 | * |
|
1188 | * @throws \InvalidArgumentException |
|
1189 | */ |
|
1190 | public function customSortKeys($function) |
|
1191 | { |
|
1192 | if (!\is_callable($function)) { |
|
1193 | throw new \InvalidArgumentException( |
|
1194 | 'Passed function must be callable' |
|
1195 | ); |
|
1196 | } |
|
1197 | ||
1198 | \uksort($this->array, $function); |
|
1199 | ||
1200 | return $this; |
|
1201 | } |
|
1202 | ||
1203 | /** |
|
1204 | * Custom sort by value via "usort". |
|
@@ 1214-1225 (lines=12) @@ | ||
1211 | * |
|
1212 | * @throws \InvalidArgumentException |
|
1213 | */ |
|
1214 | public function customSortValues($function) |
|
1215 | { |
|
1216 | if (!\is_callable($function)) { |
|
1217 | throw new \InvalidArgumentException( |
|
1218 | 'Passed function must be callable' |
|
1219 | ); |
|
1220 | } |
|
1221 | ||
1222 | \usort($this->array, $function); |
|
1223 | ||
1224 | return $this; |
|
1225 | } |
|
1226 | ||
1227 | /** |
|
1228 | * Return values that are only in the current array. |