Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1861-1870 (lines=10) @@
1858
     * @return false|mixed
1859
     *                     <p>Return false if we did not find the value.</p>
1860
     */
1861
    public function find(\Closure $closure)
1862
    {
1863
        foreach ($this->getGenerator() as $key => $value) {
1864
            if ($closure($value, $key)) {
1865
                return $value;
1866
            }
1867
        }
1868
1869
        return false;
1870
    }
1871
1872
    /**
1873
     * find by ...
@@ 5151-5160 (lines=10) @@
5148
     * @return bool
5149
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5150
     */
5151
    public function validate(\Closure $closure): bool
5152
    {
5153
        foreach ($this->getGenerator() as $key => $value) {
5154
            if (!$closure($value, $key)) {
5155
                return false;
5156
            }
5157
        }
5158
5159
        return true;
5160
    }
5161
5162
    /**
5163
     * Get all values from a array.