Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2256-2265 (lines=10) @@
2253
     * @return false|mixed
2254
     *                     <p>Return false if we did not find the value.</p>
2255
     */
2256
    public function find(\Closure $closure)
2257
    {
2258
        foreach ($this->getGenerator() as $key => $value) {
2259
            if ($closure($value, $key)) {
2260
                return $value;
2261
            }
2262
        }
2263
2264
        return false;
2265
    }
2266
2267
    /**
2268
     * find by ...
@@ 5909-5918 (lines=10) @@
5906
     * @return bool
5907
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5908
     */
5909
    public function validate(\Closure $closure): bool
5910
    {
5911
        foreach ($this->getGenerator() as $key => $value) {
5912
            if (!$closure($value, $key)) {
5913
                return false;
5914
            }
5915
        }
5916
5917
        return true;
5918
    }
5919
5920
    /**
5921
     * Get all values from a array.