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 ...
@@ 5863-5872 (lines=10) @@
5860
     * @return bool
5861
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5862
     */
5863
    public function validate(\Closure $closure): bool
5864
    {
5865
        foreach ($this->getGenerator() as $key => $value) {
5866
            if (!$closure($value, $key)) {
5867
                return false;
5868
            }
5869
        }
5870
5871
        return true;
5872
    }
5873
5874
    /**
5875
     * Get all values from a array.