Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2338-2347 (lines=10) @@
2335
     * @return false|mixed
2336
     *                     <p>Return false if we did not find the value.</p>
2337
     */
2338
    public function find(\Closure $closure)
2339
    {
2340
        foreach ($this->getGenerator() as $key => $value) {
2341
            if ($closure($value, $key)) {
2342
                return $value;
2343
            }
2344
        }
2345
2346
        return false;
2347
    }
2348
2349
    /**
2350
     * find by ...
@@ 6084-6093 (lines=10) @@
6081
     * @return bool
6082
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
6083
     */
6084
    public function validate(\Closure $closure): bool
6085
    {
6086
        foreach ($this->getGenerator() as $key => $value) {
6087
            if (!$closure($value, $key)) {
6088
                return false;
6089
            }
6090
        }
6091
6092
        return true;
6093
    }
6094
6095
    /**
6096
     * Get all values from a array.