| @@ 813-824 (lines=12) @@ | ||
| 810 | * |
|
| 811 | * @psalm-return static<TKey,T> |
|
| 812 | */ |
|
| 813 | public function uasort($function): self |
|
| 814 | { |
|
| 815 | if (!\is_callable($function)) { |
|
| 816 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 817 | } |
|
| 818 | ||
| 819 | $this->generatorToArray(); |
|
| 820 | ||
| 821 | \uasort($this->array, $function); |
|
| 822 | ||
| 823 | return $this; |
|
| 824 | } |
|
| 825 | ||
| 826 | /** |
|
| 827 | * Sort the entries with a user-defined comparison function and maintain key association. |
|
| @@ 1784-1795 (lines=12) @@ | ||
| 1781 | * |
|
| 1782 | * @psalm-return static<TKey,T> |
|
| 1783 | */ |
|
| 1784 | public function customSortValues($function): self |
|
| 1785 | { |
|
| 1786 | if (\is_callable($function) === false) { |
|
| 1787 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 1788 | } |
|
| 1789 | ||
| 1790 | $this->generatorToArray(); |
|
| 1791 | ||
| 1792 | \usort($this->array, $function); |
|
| 1793 | ||
| 1794 | return $this; |
|
| 1795 | } |
|
| 1796 | ||
| 1797 | /** |
|
| 1798 | * Custom sort by value via "usort". |
|