Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4171-4186 (lines=16) @@
4168
     *
4169
     * @return bool
4170
     */
4171
    public function matches(\Closure $closure): bool
4172
    {
4173
        if ($this->count() === 0) {
4174
            return false;
4175
        }
4176
4177
        foreach ($this->getGenerator() as $key => $value) {
4178
            $value = $closure($value, $key);
4179
4180
            if ($value === false) {
4181
                return false;
4182
            }
4183
        }
4184
4185
        return true;
4186
    }
4187
4188
    /**
4189
     * Check if any item in the current array matches a truth test.
@@ 4202-4217 (lines=16) @@
4199
     *
4200
     * @return bool
4201
     */
4202
    public function matchesAny(\Closure $closure): bool
4203
    {
4204
        if ($this->count() === 0) {
4205
            return false;
4206
        }
4207
4208
        foreach ($this->getGenerator() as $key => $value) {
4209
            $value = $closure($value, $key);
4210
4211
            if ($value === true) {
4212
                return true;
4213
            }
4214
        }
4215
4216
        return false;
4217
    }
4218
4219
    /**
4220
     * Get the max value from an array.