Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4152-4167 (lines=16) @@
4149
     *
4150
     * @return bool
4151
     */
4152
    public function matches(\Closure $closure): bool
4153
    {
4154
        if ($this->count() === 0) {
4155
            return false;
4156
        }
4157
4158
        foreach ($this->getGenerator() as $key => $value) {
4159
            $value = $closure($value, $key);
4160
4161
            if ($value === false) {
4162
                return false;
4163
            }
4164
        }
4165
4166
        return true;
4167
    }
4168
4169
    /**
4170
     * Check if any item in the current array matches a truth test.
@@ 4183-4198 (lines=16) @@
4180
     *
4181
     * @return bool
4182
     */
4183
    public function matchesAny(\Closure $closure): bool
4184
    {
4185
        if ($this->count() === 0) {
4186
            return false;
4187
        }
4188
4189
        foreach ($this->getGenerator() as $key => $value) {
4190
            $value = $closure($value, $key);
4191
4192
            if ($value === true) {
4193
                return true;
4194
            }
4195
        }
4196
4197
        return false;
4198
    }
4199
4200
    /**
4201
     * Get the max value from an array.