Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2562-2571 (lines=10) @@
2559
     * @return false|mixed
2560
     *                     <p>Return false if we did not find the value.</p>
2561
     */
2562
    public function find(\Closure $closure)
2563
    {
2564
        foreach ($this->getGenerator() as $key => $value) {
2565
            if ($closure($value, $key)) {
2566
                return $value;
2567
            }
2568
        }
2569
2570
        return false;
2571
    }
2572
2573
    /**
2574
     * find by ...
@@ 6798-6807 (lines=10) @@
6795
     * @return bool
6796
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
6797
     */
6798
    public function validate(\Closure $closure): bool
6799
    {
6800
        foreach ($this->getGenerator() as $key => $value) {
6801
            if (!$closure($value, $key)) {
6802
                return false;
6803
            }
6804
        }
6805
6806
        return true;
6807
    }
6808
6809
    /**
6810
     * Get all values from a array.