| @@ 3590-3608 (lines=19) @@ | ||
| 3587 | * @return false|mixed | |
| 3588 | * <p>Will return false if there are no values.</p> | |
| 3589 | */ | |
| 3590 | public function max() | |
| 3591 |     { | |
| 3592 |         if ($this->count() === 0) { | |
| 3593 | return false; | |
| 3594 | } | |
| 3595 | ||
| 3596 | $max = false; | |
| 3597 |         foreach ($this->getGenerator() as $value) { | |
| 3598 | if ( | |
| 3599 | $max === false | |
| 3600 | || | |
| 3601 | $value > $max | |
| 3602 |             ) { | |
| 3603 | $max = $value; | |
| 3604 | } | |
| 3605 | } | |
| 3606 | ||
| 3607 | return $max; | |
| 3608 | } | |
| 3609 | ||
| 3610 | /** | |
| 3611 | * Merge the new $array into the current array. | |
| @@ 3750-3768 (lines=19) @@ | ||
| 3747 | * @return false|mixed | |
| 3748 | * <p>Will return false if there are no values.</p> | |
| 3749 | */ | |
| 3750 | public function min() | |
| 3751 |     { | |
| 3752 |         if ($this->count() === 0) { | |
| 3753 | return false; | |
| 3754 | } | |
| 3755 | ||
| 3756 | $min = false; | |
| 3757 |         foreach ($this->getGenerator() as $value) { | |
| 3758 | if ( | |
| 3759 | $min === false | |
| 3760 | || | |
| 3761 | $value < $min | |
| 3762 |             ) { | |
| 3763 | $min = $value; | |
| 3764 | } | |
| 3765 | } | |
| 3766 | ||
| 3767 | return $min; | |
| 3768 | } | |
| 3769 | ||
| 3770 | /** | |
| 3771 | * Get the most used value from the array. | |