| @@ 826-837 (lines=12) @@ | ||
| 823 | * |
|
| 824 | * @psalm-return static<TKey,T> |
|
| 825 | */ |
|
| 826 | public function uasort($function): self |
|
| 827 | { |
|
| 828 | if (!\is_callable($function)) { |
|
| 829 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 830 | } |
|
| 831 | ||
| 832 | $this->generatorToArray(); |
|
| 833 | ||
| 834 | \uasort($this->array, $function); |
|
| 835 | ||
| 836 | return $this; |
|
| 837 | } |
|
| 838 | ||
| 839 | /** |
|
| 840 | * Sort the entries with a user-defined comparison function and maintain key association. |
|
| @@ 1870-1881 (lines=12) @@ | ||
| 1867 | * |
|
| 1868 | * @psalm-return static<TKey,T> |
|
| 1869 | */ |
|
| 1870 | public function customSortValues($function): self |
|
| 1871 | { |
|
| 1872 | if (\is_callable($function) === false) { |
|
| 1873 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 1874 | } |
|
| 1875 | ||
| 1876 | $this->generatorToArray(); |
|
| 1877 | ||
| 1878 | \usort($this->array, $function); |
|
| 1879 | ||
| 1880 | return $this; |
|
| 1881 | } |
|
| 1882 | ||
| 1883 | /** |
|
| 1884 | * Custom sort by value via "usort". |
|