Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2163-2172 (lines=10) @@
2160
     * @return false|mixed
2161
     *                     <p>Return false if we did not find the value.</p>
2162
     */
2163
    public function find(\Closure $closure)
2164
    {
2165
        foreach ($this->getGenerator() as $key => $value) {
2166
            if ($closure($value, $key)) {
2167
                return $value;
2168
            }
2169
        }
2170
2171
        return false;
2172
    }
2173
2174
    /**
2175
     * find by ...
@@ 5730-5739 (lines=10) @@
5727
     * @return bool
5728
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5729
     */
5730
    public function validate(\Closure $closure): bool
5731
    {
5732
        foreach ($this->getGenerator() as $key => $value) {
5733
            if (!$closure($value, $key)) {
5734
                return false;
5735
            }
5736
        }
5737
5738
        return true;
5739
    }
5740
5741
    /**
5742
     * Get all values from a array.