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