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 ...
@@ 5946-5955 (lines=10) @@
5943
     * @return bool
5944
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5945
     */
5946
    public function validate(\Closure $closure): bool
5947
    {
5948
        foreach ($this->getGenerator() as $key => $value) {
5949
            if (!$closure($value, $key)) {
5950
                return false;
5951
            }
5952
        }
5953
5954
        return true;
5955
    }
5956
5957
    /**
5958
     * Get all values from a array.