Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4121-4136 (lines=16) @@
4118
     *
4119
     * @return bool
4120
     */
4121
    public function matches(\Closure $closure): bool
4122
    {
4123
        if ($this->count() === 0) {
4124
            return false;
4125
        }
4126
4127
        foreach ($this->getGenerator() as $key => $value) {
4128
            $value = $closure($value, $key);
4129
4130
            if ($value === false) {
4131
                return false;
4132
            }
4133
        }
4134
4135
        return true;
4136
    }
4137
4138
    /**
4139
     * Check if any item in the current array matches a truth test.
@@ 4152-4167 (lines=16) @@
4149
     *
4150
     * @return bool
4151
     */
4152
    public function matchesAny(\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 === true) {
4162
                return true;
4163
            }
4164
        }
4165
4166
        return false;
4167
    }
4168
4169
    /**
4170
     * Get the max value from an array.