Code Duplication    Length = 14-14 lines in 2 locations

src/Arrayy.php 2 locations

@@ 658-671 (lines=14) @@
655
     *
656
     * @psalm-return static<TKey,T>
657
     */
658
    public function uasort($function): self
659
    {
660
        if (!\is_callable($function)) {
661
            throw new \InvalidArgumentException('Passed function must be callable');
662
        }
663
664
        $this->generatorToArray();
665
666
        \uasort($this->array, $function);
667
668
        return $this;
669
    }
670
671
    /**
672
     * Sort the entries by keys using a user-defined comparison function.
673
     *
674
     * @param callable $function
@@ 1440-1453 (lines=14) @@
1437
     *
1438
     * @psalm-return static<TKey,T>
1439
     */
1440
    public function customSortValues($function): self
1441
    {
1442
        if (\is_callable($function) === false) {
1443
            throw new \InvalidArgumentException('Passed function must be callable');
1444
        }
1445
1446
        $this->generatorToArray();
1447
1448
        \usort($this->array, $function);
1449
1450
        return $this;
1451
    }
1452
1453
    /**
1454
     * Delete the given key or keys.
1455
     *
1456
     * @param int|int[]|string|string[] $keyOrKeys