Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2551-2560 (lines=10) @@
2548
     * @return false|mixed
2549
     *                     <p>Return false if we did not find the value.</p>
2550
     */
2551
    public function find(\Closure $closure)
2552
    {
2553
        foreach ($this->getGenerator() as $key => $value) {
2554
            if ($closure($value, $key)) {
2555
                return $value;
2556
            }
2557
        }
2558
2559
        return false;
2560
    }
2561
2562
    /**
2563
     * find by ...
@@ 6779-6788 (lines=10) @@
6776
     * @return bool
6777
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
6778
     */
6779
    public function validate(\Closure $closure): bool
6780
    {
6781
        foreach ($this->getGenerator() as $key => $value) {
6782
            if (!$closure($value, $key)) {
6783
                return false;
6784
            }
6785
        }
6786
6787
        return true;
6788
    }
6789
6790
    /**
6791
     * Get all values from a array.