| @@ 603-616 (lines=14) @@ | ||
| 600 | * @return static |
|
| 601 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 602 | */ |
|
| 603 | public function uasort($function): self |
|
| 604 | { |
|
| 605 | if (!\is_callable($function)) { |
|
| 606 | throw new \InvalidArgumentException( |
|
| 607 | 'Passed function must be callable' |
|
| 608 | ); |
|
| 609 | } |
|
| 610 | ||
| 611 | $this->generatorToArray(); |
|
| 612 | ||
| 613 | \uasort($this->array, $function); |
|
| 614 | ||
| 615 | return $this; |
|
| 616 | } |
|
| 617 | ||
| 618 | /** |
|
| 619 | * Sort the entries by keys using a user-defined comparison function. |
|
| @@ 1289-1302 (lines=14) @@ | ||
| 1286 | * @return static |
|
| 1287 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1288 | */ |
|
| 1289 | public function customSortKeys($function): self |
|
| 1290 | { |
|
| 1291 | if (\is_callable($function) === false) { |
|
| 1292 | throw new \InvalidArgumentException( |
|
| 1293 | 'Passed function must be callable' |
|
| 1294 | ); |
|
| 1295 | } |
|
| 1296 | ||
| 1297 | $this->generatorToArray(); |
|
| 1298 | ||
| 1299 | \uksort($this->array, $function); |
|
| 1300 | ||
| 1301 | return $this; |
|
| 1302 | } |
|
| 1303 | ||
| 1304 | /** |
|
| 1305 | * Custom sort by value via "usort". |
|
| @@ 1316-1329 (lines=14) @@ | ||
| 1313 | * @return static |
|
| 1314 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1315 | */ |
|
| 1316 | public function customSortValues($function): self |
|
| 1317 | { |
|
| 1318 | if (\is_callable($function) === false) { |
|
| 1319 | throw new \InvalidArgumentException( |
|
| 1320 | 'Passed function must be callable' |
|
| 1321 | ); |
|
| 1322 | } |
|
| 1323 | ||
| 1324 | $this->generatorToArray(); |
|
| 1325 | ||
| 1326 | \usort($this->array, $function); |
|
| 1327 | ||
| 1328 | return $this; |
|
| 1329 | } |
|
| 1330 | ||
| 1331 | /** |
|
| 1332 | * Delete the given key or keys. |
|