| @@ 619-632 (lines=14) @@ | ||
| 616 | * @return static |
|
| 617 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 618 | */ |
|
| 619 | public function uasort($function): self |
|
| 620 | { |
|
| 621 | if (!\is_callable($function)) { |
|
| 622 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 623 | } |
|
| 624 | ||
| 625 | $this->generatorToArray(); |
|
| 626 | ||
| 627 | \uasort($this->array, $function); |
|
| 628 | ||
| 629 | return $this; |
|
| 630 | } |
|
| 631 | ||
| 632 | /** |
|
| 633 | * Sort the entries by keys using a user-defined comparison function. |
|
| 634 | * |
|
| 635 | * @param callable $function |
|
| @@ 1318-1331 (lines=14) @@ | ||
| 1315 | * @return static |
|
| 1316 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1317 | */ |
|
| 1318 | public function customSortKeys($function): self |
|
| 1319 | { |
|
| 1320 | if (\is_callable($function) === false) { |
|
| 1321 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 1322 | } |
|
| 1323 | ||
| 1324 | $this->generatorToArray(); |
|
| 1325 | ||
| 1326 | \uksort($this->array, $function); |
|
| 1327 | ||
| 1328 | return $this; |
|
| 1329 | } |
|
| 1330 | ||
| 1331 | /** |
|
| 1332 | * Custom sort by value via "usort". |
|
| 1333 | * |
|
| 1334 | * @see http://php.net/manual/en/function.usort.php |
|
| @@ 1343-1356 (lines=14) @@ | ||
| 1340 | * @return static |
|
| 1341 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1342 | */ |
|
| 1343 | public function customSortValues($function): self |
|
| 1344 | { |
|
| 1345 | if (\is_callable($function) === false) { |
|
| 1346 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 1347 | } |
|
| 1348 | ||
| 1349 | $this->generatorToArray(); |
|
| 1350 | ||
| 1351 | \usort($this->array, $function); |
|
| 1352 | ||
| 1353 | return $this; |
|
| 1354 | } |
|
| 1355 | ||
| 1356 | /** |
|
| 1357 | * Delete the given key or keys. |
|
| 1358 | * |
|
| 1359 | * @param int|int[]|string|string[] $keyOrKeys |
|