| @@ 658-669 (lines=12) @@ | ||
| 655 | * |
|
| 656 | * @psalm-return $this<TKey,T> |
|
| 657 | */ |
|
| 658 | public function uasort($function): self |
|
| 659 | { |
|
| 660 | if (!\is_callable($function)) { |
|
| 661 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 662 | } |
|
| 663 | ||
| 664 | $this->generatorToArray(); |
|
| 665 | ||
| 666 | \uasort($this->array, $function); |
|
| 667 | ||
| 668 | return $this; |
|
| 669 | } |
|
| 670 | ||
| 671 | /** |
|
| 672 | * Sort the entries by keys using a user-defined comparison function. |
|
| @@ 1456-1467 (lines=12) @@ | ||
| 1453 | * |
|
| 1454 | * @psalm-return $this<TKey,T> |
|
| 1455 | */ |
|
| 1456 | public function customSortValues($function): self |
|
| 1457 | { |
|
| 1458 | if (\is_callable($function) === false) { |
|
| 1459 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 1460 | } |
|
| 1461 | ||
| 1462 | $this->generatorToArray(); |
|
| 1463 | ||
| 1464 | \usort($this->array, $function); |
|
| 1465 | ||
| 1466 | return $this; |
|
| 1467 | } |
|
| 1468 | ||
| 1469 | /** |
|
| 1470 | * Delete the given key or keys. |
|