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