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 ...
@@ 6055-6064 (lines=10) @@
6052
     * @return bool
6053
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
6054
     */
6055
    public function validate(\Closure $closure): bool
6056
    {
6057
        foreach ($this->getGenerator() as $key => $value) {
6058
            if (!$closure($value, $key)) {
6059
                return false;
6060
            }
6061
        }
6062
6063
        return true;
6064
    }
6065
6066
    /**
6067
     * Get all values from a array.