Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2542-2551 (lines=10) @@
2539
     * @return false|mixed
2540
     *                     <p>Return false if we did not find the value.</p>
2541
     */
2542
    public function find(\Closure $closure)
2543
    {
2544
        foreach ($this->getGenerator() as $key => $value) {
2545
            if ($closure($value, $key)) {
2546
                return $value;
2547
            }
2548
        }
2549
2550
        return false;
2551
    }
2552
2553
    /**
2554
     * find by ...
@@ 6752-6761 (lines=10) @@
6749
     * @return bool
6750
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
6751
     */
6752
    public function validate(\Closure $closure): bool
6753
    {
6754
        foreach ($this->getGenerator() as $key => $value) {
6755
            if (!$closure($value, $key)) {
6756
                return false;
6757
            }
6758
        }
6759
6760
        return true;
6761
    }
6762
6763
    /**
6764
     * Get all values from a array.