Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 3064-3079 (lines=16) @@
3061
     *
3062
     * @return bool
3063
     */
3064
    public function matches(\Closure $closure): bool
3065
    {
3066
        if ($this->count() === 0) {
3067
            return false;
3068
        }
3069
3070
        foreach ($this->getGenerator() as $key => $value) {
3071
            $value = $closure($value, $key);
3072
3073
            if ($value === false) {
3074
                return false;
3075
            }
3076
        }
3077
3078
        return true;
3079
    }
3080
3081
    /**
3082
     * Check if any item in the current array matches a truth test.
@@ 3088-3103 (lines=16) @@
3085
     *
3086
     * @return bool
3087
     */
3088
    public function matchesAny(\Closure $closure): bool
3089
    {
3090
        if ($this->count() === 0) {
3091
            return false;
3092
        }
3093
3094
        foreach ($this->getGenerator() as $key => $value) {
3095
            $value = $closure($value, $key);
3096
3097
            if ($value === true) {
3098
                return true;
3099
            }
3100
        }
3101
3102
        return false;
3103
    }
3104
3105
    /**
3106
     * Get the max value from an array.