| @@ 761-772 (lines=12) @@ | ||
| 758 | * |
|
| 759 | * @psalm-return static<TKey,T> |
|
| 760 | */ |
|
| 761 | public function uasort($function): self |
|
| 762 | { |
|
| 763 | if (!\is_callable($function)) { |
|
| 764 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 765 | } |
|
| 766 | ||
| 767 | $this->generatorToArray(); |
|
| 768 | ||
| 769 | \uasort($this->array, $function); |
|
| 770 | ||
| 771 | return $this; |
|
| 772 | } |
|
| 773 | ||
| 774 | /** |
|
| 775 | * Sort the entries with a user-defined comparison function and maintain key association. |
|
| @@ 1653-1664 (lines=12) @@ | ||
| 1650 | * |
|
| 1651 | * @psalm-return static<TKey,T> |
|
| 1652 | */ |
|
| 1653 | public function customSortValues($function): self |
|
| 1654 | { |
|
| 1655 | if (\is_callable($function) === false) { |
|
| 1656 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
| 1657 | } |
|
| 1658 | ||
| 1659 | $this->generatorToArray(); |
|
| 1660 | ||
| 1661 | \usort($this->array, $function); |
|
| 1662 | ||
| 1663 | return $this; |
|
| 1664 | } |
|
| 1665 | ||
| 1666 | /** |
|
| 1667 | * Custom sort by value via "usort". |
|