Code Duplication    Length = 16-16 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2459-2474 (lines=16) @@
2456
     *
2457
     * @return bool
2458
     */
2459
    public function matches(\Closure $closure): bool
2460
    {
2461
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2462
            return false;
2463
        }
2464
2465
        foreach ($this->getGenerator() as $key => $value) {
2466
            $value = $closure($value, $key);
2467
2468
            if ($value === false) {
2469
                return false;
2470
            }
2471
        }
2472
2473
        return true;
2474
    }
2475
2476
    /**
2477
     * Check if any item in the current array matches a truth test.
@@ 2483-2498 (lines=16) @@
2480
     *
2481
     * @return bool
2482
     */
2483
    public function matchesAny(\Closure $closure): bool
2484
    {
2485
        if (\count($this->getArray(), \COUNT_NORMAL) === 0) {
2486
            return false;
2487
        }
2488
2489
        foreach ($this->getGenerator() as $key => $value) {
2490
            $value = $closure($value, $key);
2491
2492
            if ($value === true) {
2493
                return true;
2494
            }
2495
        }
2496
2497
        return false;
2498
    }
2499
2500
    /**
2501
     * Get the max value from an array.