@@ 627-640 (lines=14) @@ | ||
624 | * @return static |
|
625 | * <p>(Mutable) Return this Arrayy object.</p> |
|
626 | */ |
|
627 | public function uasort($function): self |
|
628 | { |
|
629 | if (!\is_callable($function)) { |
|
630 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
631 | } |
|
632 | ||
633 | $this->generatorToArray(); |
|
634 | ||
635 | \uasort($this->array, $function); |
|
636 | ||
637 | return $this; |
|
638 | } |
|
639 | ||
640 | /** |
|
641 | * Sort the entries by keys using a user-defined comparison function. |
|
642 | * |
|
643 | * @param callable $function |
|
@@ 1326-1339 (lines=14) @@ | ||
1323 | * @return static |
|
1324 | * <p>(Mutable) Return this Arrayy object.</p> |
|
1325 | */ |
|
1326 | public function customSortKeys($function): self |
|
1327 | { |
|
1328 | if (\is_callable($function) === false) { |
|
1329 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
1330 | } |
|
1331 | ||
1332 | $this->generatorToArray(); |
|
1333 | ||
1334 | \uksort($this->array, $function); |
|
1335 | ||
1336 | return $this; |
|
1337 | } |
|
1338 | ||
1339 | /** |
|
1340 | * Custom sort by value via "usort". |
|
1341 | * |
|
1342 | * @see http://php.net/manual/en/function.usort.php |
|
@@ 1351-1364 (lines=14) @@ | ||
1348 | * @return static |
|
1349 | * <p>(Mutable) Return this Arrayy object.</p> |
|
1350 | */ |
|
1351 | public function customSortValues($function): self |
|
1352 | { |
|
1353 | if (\is_callable($function) === false) { |
|
1354 | throw new \InvalidArgumentException('Passed function must be callable'); |
|
1355 | } |
|
1356 | ||
1357 | $this->generatorToArray(); |
|
1358 | ||
1359 | \usort($this->array, $function); |
|
1360 | ||
1361 | return $this; |
|
1362 | } |
|
1363 | ||
1364 | /** |
|
1365 | * Delete the given key or keys. |
|
1366 | * |
|
1367 | * @param int|int[]|string|string[] $keyOrKeys |