| @@ 580-593 (lines=14) @@ | ||
| 577 | * @return static |
|
| 578 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 579 | */ |
|
| 580 | public function uasort($function): self |
|
| 581 | { |
|
| 582 | if (!\is_callable($function)) { |
|
| 583 | throw new \InvalidArgumentException( |
|
| 584 | 'Passed function must be callable' |
|
| 585 | ); |
|
| 586 | } |
|
| 587 | ||
| 588 | $this->generatorToArray(); |
|
| 589 | ||
| 590 | \uasort($this->array, $function); |
|
| 591 | ||
| 592 | return $this; |
|
| 593 | } |
|
| 594 | ||
| 595 | /** |
|
| 596 | * Sort the entries by keys using a user-defined comparison function. |
|
| @@ 1237-1250 (lines=14) @@ | ||
| 1234 | * @return static |
|
| 1235 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1236 | */ |
|
| 1237 | public function customSortKeys($function): self |
|
| 1238 | { |
|
| 1239 | if (!\is_callable($function)) { |
|
| 1240 | throw new \InvalidArgumentException( |
|
| 1241 | 'Passed function must be callable' |
|
| 1242 | ); |
|
| 1243 | } |
|
| 1244 | ||
| 1245 | $this->generatorToArray(); |
|
| 1246 | ||
| 1247 | \uksort($this->array, $function); |
|
| 1248 | ||
| 1249 | return $this; |
|
| 1250 | } |
|
| 1251 | ||
| 1252 | /** |
|
| 1253 | * Custom sort by value via "usort". |
|
| @@ 1264-1277 (lines=14) @@ | ||
| 1261 | * @return static |
|
| 1262 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1263 | */ |
|
| 1264 | public function customSortValues($function): self |
|
| 1265 | { |
|
| 1266 | if (!\is_callable($function)) { |
|
| 1267 | throw new \InvalidArgumentException( |
|
| 1268 | 'Passed function must be callable' |
|
| 1269 | ); |
|
| 1270 | } |
|
| 1271 | ||
| 1272 | $this->generatorToArray(); |
|
| 1273 | ||
| 1274 | \usort($this->array, $function); |
|
| 1275 | ||
| 1276 | return $this; |
|
| 1277 | } |
|
| 1278 | ||
| 1279 | /** |
|
| 1280 | * Return values that are only in the current array. |
|