Code Duplication    Length = 10-10 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2117-2126 (lines=10) @@
2114
     * @return false|mixed
2115
     *                     <p>Return false if we did not find the value.</p>
2116
     */
2117
    public function find(\Closure $closure)
2118
    {
2119
        foreach ($this->getGenerator() as $key => $value) {
2120
            if ($closure($value, $key)) {
2121
                return $value;
2122
            }
2123
        }
2124
2125
        return false;
2126
    }
2127
2128
    /**
2129
     * find by ...
@@ 5681-5690 (lines=10) @@
5678
     * @return bool
5679
     *              <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
5680
     */
5681
    public function validate(\Closure $closure): bool
5682
    {
5683
        foreach ($this->getGenerator() as $key => $value) {
5684
            if (!$closure($value, $key)) {
5685
                return false;
5686
            }
5687
        }
5688
5689
        return true;
5690
    }
5691
5692
    /**
5693
     * Get all values from a array.