| @@ 546-557 (lines=12) @@ | ||
| 543 | * @return static |
|
| 544 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 545 | */ |
|
| 546 | public function uasort($function) |
|
| 547 | { |
|
| 548 | if (!\is_callable($function)) { |
|
| 549 | throw new \InvalidArgumentException( |
|
| 550 | 'Passed function must be callable' |
|
| 551 | ); |
|
| 552 | } |
|
| 553 | ||
| 554 | \uasort($this->array, $function); |
|
| 555 | ||
| 556 | return $this; |
|
| 557 | } |
|
| 558 | ||
| 559 | /** |
|
| 560 | * Sort the entries by keys using a user-defined comparison function. |
|
| @@ 1288-1299 (lines=12) @@ | ||
| 1285 | * @return static |
|
| 1286 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1287 | */ |
|
| 1288 | public function customSortKeys($function) |
|
| 1289 | { |
|
| 1290 | if (!\is_callable($function)) { |
|
| 1291 | throw new \InvalidArgumentException( |
|
| 1292 | 'Passed function must be callable' |
|
| 1293 | ); |
|
| 1294 | } |
|
| 1295 | ||
| 1296 | \uksort($this->array, $function); |
|
| 1297 | ||
| 1298 | return $this; |
|
| 1299 | } |
|
| 1300 | ||
| 1301 | /** |
|
| 1302 | * Custom sort by value via "usort". |
|
| @@ 1313-1324 (lines=12) @@ | ||
| 1310 | * @return static |
|
| 1311 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1312 | */ |
|
| 1313 | public function customSortValues($function) |
|
| 1314 | { |
|
| 1315 | if (!\is_callable($function)) { |
|
| 1316 | throw new \InvalidArgumentException( |
|
| 1317 | 'Passed function must be callable' |
|
| 1318 | ); |
|
| 1319 | } |
|
| 1320 | ||
| 1321 | \usort($this->array, $function); |
|
| 1322 | ||
| 1323 | return $this; |
|
| 1324 | } |
|
| 1325 | ||
| 1326 | /** |
|
| 1327 | * Return values that are only in the current array. |
|