Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2246-2255 (lines=10) @@
2243
     * @return false|mixed
2244
     *                     <p>Return false if we did not find the value.</p>
2245
     */
2246
    public function find(\Closure $closure)
2247
    {
2248
        foreach ($this->getGenerator() as $key => $value) {
2249
            if ($closure($value, $key)) {
2250
                return $value;
2251
            }
2252
        }
2253
2254
        return false;
2255
    }
2256
2257
    /**
2258
     * find by ...
@@ 5832-5841 (lines=10) @@
5829
     * @return bool
5830
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5831
     */
5832
    public function validate(\Closure $closure): bool
5833
    {
5834
        foreach ($this->getGenerator() as $key => $value) {
5835
            if (!$closure($value, $key)) {
5836
                return false;
5837
            }
5838
        }
5839
5840
        return true;
5841
    }
5842
5843
    /**
5844
     * Get all values from a array.