@@ 821-832 (lines=12) @@ | ||
818 | * |
|
819 | * @psalm-return static<TKey,T> |
|
820 | */ |
|
821 | public function uasort($function): self |
|
822 | { |
|
823 | if (!\is_callable($function)) { |
|
824 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
825 | } |
|
826 | ||
827 | $this->generatorToArray(); |
|
828 | ||
829 | \uasort($this->array, $function); |
|
830 | ||
831 | return $this; |
|
832 | } |
|
833 | ||
834 | /** |
|
835 | * Sort the entries with a user-defined comparison function and maintain key association. |
|
@@ 1792-1803 (lines=12) @@ | ||
1789 | * |
|
1790 | * @psalm-return static<TKey,T> |
|
1791 | */ |
|
1792 | public function customSortValues($function): self |
|
1793 | { |
|
1794 | if (\is_callable($function) === false) { |
|
1795 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
1796 | } |
|
1797 | ||
1798 | $this->generatorToArray(); |
|
1799 | ||
1800 | \usort($this->array, $function); |
|
1801 | ||
1802 | return $this; |
|
1803 | } |
|
1804 | ||
1805 | /** |
|
1806 | * Custom sort by value via "usort". |