| @@ 599-612 (lines=14) @@ | ||
| 596 | * @return static |
|
| 597 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 598 | */ |
|
| 599 | public function uasort($function): self |
|
| 600 | { |
|
| 601 | if (!\is_callable($function)) { |
|
| 602 | throw new \InvalidArgumentException( |
|
| 603 | 'Passed function must be callable' |
|
| 604 | ); |
|
| 605 | } |
|
| 606 | ||
| 607 | $this->generatorToArray(); |
|
| 608 | ||
| 609 | \uasort($this->array, $function); |
|
| 610 | ||
| 611 | return $this; |
|
| 612 | } |
|
| 613 | ||
| 614 | /** |
|
| 615 | * Sort the entries by keys using a user-defined comparison function. |
|
| @@ 1281-1294 (lines=14) @@ | ||
| 1278 | * @return static |
|
| 1279 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1280 | */ |
|
| 1281 | public function customSortKeys($function): self |
|
| 1282 | { |
|
| 1283 | if (\is_callable($function) === false) { |
|
| 1284 | throw new \InvalidArgumentException( |
|
| 1285 | 'Passed function must be callable' |
|
| 1286 | ); |
|
| 1287 | } |
|
| 1288 | ||
| 1289 | $this->generatorToArray(); |
|
| 1290 | ||
| 1291 | \uksort($this->array, $function); |
|
| 1292 | ||
| 1293 | return $this; |
|
| 1294 | } |
|
| 1295 | ||
| 1296 | /** |
|
| 1297 | * Custom sort by value via "usort". |
|
| @@ 1308-1321 (lines=14) @@ | ||
| 1305 | * @return static |
|
| 1306 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1307 | */ |
|
| 1308 | public function customSortValues($function): self |
|
| 1309 | { |
|
| 1310 | if (\is_callable($function) === false) { |
|
| 1311 | throw new \InvalidArgumentException( |
|
| 1312 | 'Passed function must be callable' |
|
| 1313 | ); |
|
| 1314 | } |
|
| 1315 | ||
| 1316 | $this->generatorToArray(); |
|
| 1317 | ||
| 1318 | \usort($this->array, $function); |
|
| 1319 | ||
| 1320 | return $this; |
|
| 1321 | } |
|
| 1322 | ||
| 1323 | /** |
|
| 1324 | * Delete the given key or keys. |
|