Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 3108-3123 (lines=16) @@
3105
     *
3106
     * @return bool
3107
     */
3108
    public function matches(\Closure $closure): bool
3109
    {
3110
        if ($this->count() === 0) {
3111
            return false;
3112
        }
3113
3114
        foreach ($this->getGenerator() as $key => $value) {
3115
            $value = $closure($value, $key);
3116
3117
            if ($value === false) {
3118
                return false;
3119
            }
3120
        }
3121
3122
        return true;
3123
    }
3124
3125
    /**
3126
     * Check if any item in the current array matches a truth test.
@@ 3132-3147 (lines=16) @@
3129
     *
3130
     * @return bool
3131
     */
3132
    public function matchesAny(\Closure $closure): bool
3133
    {
3134
        if ($this->count() === 0) {
3135
            return false;
3136
        }
3137
3138
        foreach ($this->getGenerator() as $key => $value) {
3139
            $value = $closure($value, $key);
3140
3141
            if ($value === true) {
3142
                return true;
3143
            }
3144
        }
3145
3146
        return false;
3147
    }
3148
3149
    /**
3150
     * Get the max value from an array.