Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2248-2257 (lines=10) @@
2245
     * @return false|mixed
2246
     *                     <p>Return false if we did not find the value.</p>
2247
     */
2248
    public function find(\Closure $closure)
2249
    {
2250
        foreach ($this->getGenerator() as $key => $value) {
2251
            if ($closure($value, $key)) {
2252
                return $value;
2253
            }
2254
        }
2255
2256
        return false;
2257
    }
2258
2259
    /**
2260
     * find by ...
@@ 5899-5908 (lines=10) @@
5896
     * @return bool
5897
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5898
     */
5899
    public function validate(\Closure $closure): bool
5900
    {
5901
        foreach ($this->getGenerator() as $key => $value) {
5902
            if (!$closure($value, $key)) {
5903
                return false;
5904
            }
5905
        }
5906
5907
        return true;
5908
    }
5909
5910
    /**
5911
     * Get all values from a array.