Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2715-2730 (lines=16) @@
2712
     *
2713
     * @return bool
2714
     */
2715
    public function matches(\Closure $closure): bool
2716
    {
2717
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2718
            return false;
2719
        }
2720
2721
        foreach ($this->getGenerator() as $key => $value) {
2722
            $value = $closure($value, $key);
2723
2724
            if ($value === false) {
2725
                return false;
2726
            }
2727
        }
2728
2729
        return true;
2730
    }
2731
2732
    /**
2733
     * Check if any item in the current array matches a truth test.
@@ 2739-2754 (lines=16) @@
2736
     *
2737
     * @return bool
2738
     */
2739
    public function matchesAny(\Closure $closure): bool
2740
    {
2741
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2742
            return false;
2743
        }
2744
2745
        foreach ($this->getGenerator() as $key => $value) {
2746
            $value = $closure($value, $key);
2747
2748
            if ($value === true) {
2749
                return true;
2750
            }
2751
        }
2752
2753
        return false;
2754
    }
2755
2756
    /**
2757
     * Get the max value from an array.