Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2586-2601 (lines=16) @@
2583
     *
2584
     * @return bool
2585
     */
2586
    public function matches(\Closure $closure): bool
2587
    {
2588
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2589
            return false;
2590
        }
2591
2592
        foreach ($this->getGenerator() as $key => $value) {
2593
            $value = $closure($value, $key);
2594
2595
            if ($value === false) {
2596
                return false;
2597
            }
2598
        }
2599
2600
        return true;
2601
    }
2602
2603
    /**
2604
     * Check if any item in the current array matches a truth test.
@@ 2610-2625 (lines=16) @@
2607
     *
2608
     * @return bool
2609
     */
2610
    public function matchesAny(\Closure $closure): bool
2611
    {
2612
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2613
            return false;
2614
        }
2615
2616
        foreach ($this->getGenerator() as $key => $value) {
2617
            $value = $closure($value, $key);
2618
2619
            if ($value === true) {
2620
                return true;
2621
            }
2622
        }
2623
2624
        return false;
2625
    }
2626
2627
    /**
2628
     * Get the max value from an array.