Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 4135-4150 (lines=16) @@
4132
     *
4133
     * @return bool
4134
     */
4135
    public function matches(\Closure $closure): bool
4136
    {
4137
        if ($this->count() === 0) {
4138
            return false;
4139
        }
4140
4141
        foreach ($this->getGenerator() as $key => $value) {
4142
            $value = $closure($value, $key);
4143
4144
            if ($value === false) {
4145
                return false;
4146
            }
4147
        }
4148
4149
        return true;
4150
    }
4151
4152
    /**
4153
     * Check if any item in the current array matches a truth test.
@@ 4166-4181 (lines=16) @@
4163
     *
4164
     * @return bool
4165
     */
4166
    public function matchesAny(\Closure $closure): bool
4167
    {
4168
        if ($this->count() === 0) {
4169
            return false;
4170
        }
4171
4172
        foreach ($this->getGenerator() as $key => $value) {
4173
            $value = $closure($value, $key);
4174
4175
            if ($value === true) {
4176
                return true;
4177
            }
4178
        }
4179
4180
        return false;
4181
    }
4182
4183
    /**
4184
     * Get the max value from an array.