Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2609-2618 (lines=10) @@
2606
     * @return false|mixed
2607
     *                     <p>Return false if we did not find the value.</p>
2608
     */
2609
    public function find(\Closure $closure)
2610
    {
2611
        foreach ($this->getGenerator() as $key => $value) {
2612
            if ($closure($value, $key)) {
2613
                return $value;
2614
            }
2615
        }
2616
2617
        return false;
2618
    }
2619
2620
    /**
2621
     * find by ...
@@ 6880-6889 (lines=10) @@
6877
     * @return bool
6878
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
6879
     */
6880
    public function validate(\Closure $closure): bool
6881
    {
6882
        foreach ($this->getGenerator() as $key => $value) {
6883
            if (!$closure($value, $key)) {
6884
                return false;
6885
            }
6886
        }
6887
6888
        return true;
6889
    }
6890
6891
    /**
6892
     * Get all values from a array.