Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2600-2615 (lines=16) @@
2597
     *
2598
     * @return bool
2599
     */
2600
    public function matches(\Closure $closure): bool
2601
    {
2602
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2603
            return false;
2604
        }
2605
2606
        foreach ($this->getGenerator() as $key => $value) {
2607
            $value = $closure($value, $key);
2608
2609
            if ($value === false) {
2610
                return false;
2611
            }
2612
        }
2613
2614
        return true;
2615
    }
2616
2617
    /**
2618
     * Check if any item in the current array matches a truth test.
@@ 2624-2639 (lines=16) @@
2621
     *
2622
     * @return bool
2623
     */
2624
    public function matchesAny(\Closure $closure): bool
2625
    {
2626
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2627
            return false;
2628
        }
2629
2630
        foreach ($this->getGenerator() as $key => $value) {
2631
            $value = $closure($value, $key);
2632
2633
            if ($value === true) {
2634
                return true;
2635
            }
2636
        }
2637
2638
        return false;
2639
    }
2640
2641
    /**
2642
     * Get the max value from an array.