| @@ 795-806 (lines=12) @@ | ||
| 792 | * |
|
| 793 | * @psalm-return static<TKey,T> |
|
| 794 | */ |
|
| 795 | public function uasort($function): self |
|
| 796 | { |
|
| 797 | if (!\is_callable($function)) { |
|
| 798 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 799 | } |
|
| 800 | ||
| 801 | $this->generatorToArray(); |
|
| 802 | ||
| 803 | \uasort($this->array, $function); |
|
| 804 | ||
| 805 | return $this; |
|
| 806 | } |
|
| 807 | ||
| 808 | /** |
|
| 809 | * Sort the entries with a user-defined comparison function and maintain key association. |
|
| @@ 1699-1710 (lines=12) @@ | ||
| 1696 | * |
|
| 1697 | * @psalm-return static<TKey,T> |
|
| 1698 | */ |
|
| 1699 | public function customSortValues($function): self |
|
| 1700 | { |
|
| 1701 | if (\is_callable($function) === false) { |
|
| 1702 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 1703 | } |
|
| 1704 | ||
| 1705 | $this->generatorToArray(); |
|
| 1706 | ||
| 1707 | \usort($this->array, $function); |
|
| 1708 | ||
| 1709 | return $this; |
|
| 1710 | } |
|
| 1711 | ||
| 1712 | /** |
|
| 1713 | * Custom sort by value via "usort". |
|