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