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 ...
@@ 6878-6887 (lines=10) @@
6875
     * @return bool
6876
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
6877
     */
6878
    public function validate(\Closure $closure): bool
6879
    {
6880
        foreach ($this->getGenerator() as $key => $value) {
6881
            if (!$closure($value, $key)) {
6882
                return false;
6883
            }
6884
        }
6885
6886
        return true;
6887
    }
6888
6889
    /**
6890
     * Get all values from a array.