Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1887-1896 (lines=10) @@
1884
     * @return false|mixed
1885
     *                     <p>Return false if we did not find the value.</p>
1886
     */
1887
    public function find(\Closure $closure)
1888
    {
1889
        foreach ($this->getGenerator() as $key => $value) {
1890
            if ($closure($value, $key)) {
1891
                return $value;
1892
            }
1893
        }
1894
1895
        return false;
1896
    }
1897
1898
    /**
1899
     * find by ...
@@ 5234-5243 (lines=10) @@
5231
     * @return bool
5232
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5233
     */
5234
    public function validate(\Closure $closure): bool
5235
    {
5236
        foreach ($this->getGenerator() as $key => $value) {
5237
            if (!$closure($value, $key)) {
5238
                return false;
5239
            }
5240
        }
5241
5242
        return true;
5243
    }
5244
5245
    /**
5246
     * Get all values from a array.