Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2373-2388 (lines=16) @@
2370
     *
2371
     * @return bool
2372
     */
2373
    public function matches(\Closure $closure): bool
2374
    {
2375
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2376
            return false;
2377
        }
2378
2379
        foreach ($this->getGenerator() as $key => $value) {
2380
            $value = $closure($value, $key);
2381
2382
            if ($value === false) {
2383
                return false;
2384
            }
2385
        }
2386
2387
        return true;
2388
    }
2389
2390
    /**
2391
     * Check if any item in the current array matches a truth test.
@@ 2397-2412 (lines=16) @@
2394
     *
2395
     * @return bool
2396
     */
2397
    public function matchesAny(\Closure $closure): bool
2398
    {
2399
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2400
            return false;
2401
        }
2402
2403
        foreach ($this->getGenerator() as $key => $value) {
2404
            $value = $closure($value, $key);
2405
2406
            if ($value === true) {
2407
                return true;
2408
            }
2409
        }
2410
2411
        return false;
2412
    }
2413
2414
    /**
2415
     * Get the max value from an array.