Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1786-1795 (lines=10) @@
1783
     * @return false|mixed
1784
     *                     <p>Return false if we did not find the value.</p>
1785
     */
1786
    public function find(\Closure $closure)
1787
    {
1788
        foreach ($this->getGenerator() as $key => $value) {
1789
            if ($closure($value, $key)) {
1790
                return $value;
1791
            }
1792
        }
1793
1794
        return false;
1795
    }
1796
1797
    /**
1798
     * find by ...
@@ 4921-4930 (lines=10) @@
4918
     * @return bool
4919
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
4920
     */
4921
    public function validate(\Closure $closure): bool
4922
    {
4923
        foreach ($this->getGenerator() as $key => $value) {
4924
            if (!$closure($value, $key)) {
4925
                return false;
4926
            }
4927
        }
4928
4929
        return true;
4930
    }
4931
4932
    /**
4933
     * Get all values from a array.