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