| @@ 3706-3724 (lines=19) @@ | ||
| 3703 | * @return false|mixed |
|
| 3704 | * <p>Will return false if there are no values.</p> |
|
| 3705 | */ |
|
| 3706 | public function max() |
|
| 3707 | { |
|
| 3708 | if ($this->count() === 0) { |
|
| 3709 | return false; |
|
| 3710 | } |
|
| 3711 | ||
| 3712 | $max = false; |
|
| 3713 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 3714 | if ( |
|
| 3715 | $max === false |
|
| 3716 | || |
|
| 3717 | $value > $max |
|
| 3718 | ) { |
|
| 3719 | $max = $value; |
|
| 3720 | } |
|
| 3721 | } |
|
| 3722 | ||
| 3723 | return $max; |
|
| 3724 | } |
|
| 3725 | ||
| 3726 | /** |
|
| 3727 | * Merge the new $array into the current array. |
|
| @@ 3866-3884 (lines=19) @@ | ||
| 3863 | * @return false|mixed |
|
| 3864 | * <p>Will return false if there are no values.</p> |
|
| 3865 | */ |
|
| 3866 | public function min() |
|
| 3867 | { |
|
| 3868 | if ($this->count() === 0) { |
|
| 3869 | return false; |
|
| 3870 | } |
|
| 3871 | ||
| 3872 | $min = false; |
|
| 3873 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 3874 | if ( |
|
| 3875 | $min === false |
|
| 3876 | || |
|
| 3877 | $value < $min |
|
| 3878 | ) { |
|
| 3879 | $min = $value; |
|
| 3880 | } |
|
| 3881 | } |
|
| 3882 | ||
| 3883 | return $min; |
|
| 3884 | } |
|
| 3885 | ||
| 3886 | /** |
|
| 3887 | * Get the most used value from the array. |
|