Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 3623-3641 (lines=19) @@
3620
     * @return false|mixed
3621
     *                     <p>Will return false if there are no values.</p>
3622
     */
3623
    public function max()
3624
    {
3625
        if ($this->count() === 0) {
3626
            return false;
3627
        }
3628
3629
        $max = false;
3630
        foreach ($this->getGeneratorByReference() as &$value) {
3631
            if (
3632
                $max === false
3633
                ||
3634
                $value > $max
3635
            ) {
3636
                $max = $value;
3637
            }
3638
        }
3639
3640
        return $max;
3641
    }
3642
3643
    /**
3644
     * Merge the new $array into the current array.
@@ 3783-3801 (lines=19) @@
3780
     * @return false|mixed
3781
     *                     <p>Will return false if there are no values.</p>
3782
     */
3783
    public function min()
3784
    {
3785
        if ($this->count() === 0) {
3786
            return false;
3787
        }
3788
3789
        $min = false;
3790
        foreach ($this->getGeneratorByReference() as &$value) {
3791
            if (
3792
                $min === false
3793
                ||
3794
                $value < $min
3795
            ) {
3796
                $min = $value;
3797
            }
3798
        }
3799
3800
        return $min;
3801
    }
3802
3803
    /**
3804
     * Get the most used value from the array.