Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2391-2400 (lines=10) @@
2388
     * @return false|mixed
2389
     *                     <p>Return false if we did not find the value.</p>
2390
     */
2391
    public function find(\Closure $closure)
2392
    {
2393
        foreach ($this->getGenerator() as $key => $value) {
2394
            if ($closure($value, $key)) {
2395
                return $value;
2396
            }
2397
        }
2398
2399
        return false;
2400
    }
2401
2402
    /**
2403
     * find by ...
@@ 6182-6191 (lines=10) @@
6179
     * @return bool
6180
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
6181
     */
6182
    public function validate(\Closure $closure): bool
6183
    {
6184
        foreach ($this->getGenerator() as $key => $value) {
6185
            if (!$closure($value, $key)) {
6186
                return false;
6187
            }
6188
        }
6189
6190
        return true;
6191
    }
6192
6193
    /**
6194
     * Get all values from a array.