| @@ 3665-3683 (lines=19) @@ | ||
| 3662 | * @return false|mixed |
|
| 3663 | * <p>Will return false if there are no values.</p> |
|
| 3664 | */ |
|
| 3665 | public function max() |
|
| 3666 | { |
|
| 3667 | if ($this->count() === 0) { |
|
| 3668 | return false; |
|
| 3669 | } |
|
| 3670 | ||
| 3671 | $max = false; |
|
| 3672 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 3673 | if ( |
|
| 3674 | $max === false |
|
| 3675 | || |
|
| 3676 | $value > $max |
|
| 3677 | ) { |
|
| 3678 | $max = $value; |
|
| 3679 | } |
|
| 3680 | } |
|
| 3681 | ||
| 3682 | return $max; |
|
| 3683 | } |
|
| 3684 | ||
| 3685 | /** |
|
| 3686 | * Merge the new $array into the current array. |
|
| @@ 3825-3843 (lines=19) @@ | ||
| 3822 | * @return false|mixed |
|
| 3823 | * <p>Will return false if there are no values.</p> |
|
| 3824 | */ |
|
| 3825 | public function min() |
|
| 3826 | { |
|
| 3827 | if ($this->count() === 0) { |
|
| 3828 | return false; |
|
| 3829 | } |
|
| 3830 | ||
| 3831 | $min = false; |
|
| 3832 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 3833 | if ( |
|
| 3834 | $min === false |
|
| 3835 | || |
|
| 3836 | $value < $min |
|
| 3837 | ) { |
|
| 3838 | $min = $value; |
|
| 3839 | } |
|
| 3840 | } |
|
| 3841 | ||
| 3842 | return $min; |
|
| 3843 | } |
|
| 3844 | ||
| 3845 | /** |
|
| 3846 | * Get the most used value from the array. |
|