Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

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