Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

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