Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1745-1754 (lines=10) @@
1742
     * @return false|mixed
1743
     *                     <p>Return false if we did not find the value.</p>
1744
     */
1745
    public function find(\Closure $closure)
1746
    {
1747
        foreach ($this->getGenerator() as $key => $value) {
1748
            if ($closure($value, $key)) {
1749
                return $value;
1750
            }
1751
        }
1752
1753
        return false;
1754
    }
1755
1756
    /**
1757
     * find by ...
@@ 4834-4843 (lines=10) @@
4831
     * @return bool
4832
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
4833
     */
4834
    public function validate(\Closure $closure): bool
4835
    {
4836
        foreach ($this->getGenerator() as $key => $value) {
4837
            if (!$closure($value, $key)) {
4838
                return false;
4839
            }
4840
        }
4841
4842
        return true;
4843
    }
4844
4845
    /**
4846
     * Get all values from a array.