Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2533-2548 (lines=16) @@
2530
     *
2531
     * @return bool
2532
     */
2533
    public function matches(\Closure $closure): bool
2534
    {
2535
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2536
            return false;
2537
        }
2538
2539
        foreach ($this->getGenerator() as $key => $value) {
2540
            $value = $closure($value, $key);
2541
2542
            if ($value === false) {
2543
                return false;
2544
            }
2545
        }
2546
2547
        return true;
2548
    }
2549
2550
    /**
2551
     * Check if any item in the current array matches a truth test.
@@ 2557-2572 (lines=16) @@
2554
     *
2555
     * @return bool
2556
     */
2557
    public function matchesAny(\Closure $closure): bool
2558
    {
2559
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2560
            return false;
2561
        }
2562
2563
        foreach ($this->getGenerator() as $key => $value) {
2564
            $value = $closure($value, $key);
2565
2566
            if ($value === true) {
2567
                return true;
2568
            }
2569
        }
2570
2571
        return false;
2572
    }
2573
2574
    /**
2575
     * Get the max value from an array.