Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2233-2242 (lines=10) @@
2230
     * @return false|mixed
2231
     *                     <p>Return false if we did not find the value.</p>
2232
     */
2233
    public function find(\Closure $closure)
2234
    {
2235
        foreach ($this->getGenerator() as $key => $value) {
2236
            if ($closure($value, $key)) {
2237
                return $value;
2238
            }
2239
        }
2240
2241
        return false;
2242
    }
2243
2244
    /**
2245
     * find by ...
@@ 5819-5828 (lines=10) @@
5816
     * @return bool
5817
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5818
     */
5819
    public function validate(\Closure $closure): bool
5820
    {
5821
        foreach ($this->getGenerator() as $key => $value) {
5822
            if (!$closure($value, $key)) {
5823
                return false;
5824
            }
5825
        }
5826
5827
        return true;
5828
    }
5829
5830
    /**
5831
     * Get all values from a array.