@@ 2930-2948 (lines=19) @@ | ||
2927 | * |
|
2928 | * @return mixed |
|
2929 | */ |
|
2930 | public function max() |
|
2931 | { |
|
2932 | if ($this->count() === 0) { |
|
2933 | return false; |
|
2934 | } |
|
2935 | ||
2936 | $max = false; |
|
2937 | foreach ($this->getGenerator() as $value) { |
|
2938 | if ( |
|
2939 | $max === false |
|
2940 | || |
|
2941 | $value > $max |
|
2942 | ) { |
|
2943 | $max = $value; |
|
2944 | } |
|
2945 | } |
|
2946 | ||
2947 | return $max; |
|
2948 | } |
|
2949 | ||
2950 | /** |
|
2951 | * Merge the new $array into the current array. |
|
@@ 3069-3087 (lines=19) @@ | ||
3066 | * |
|
3067 | * @return mixed |
|
3068 | */ |
|
3069 | public function min() |
|
3070 | { |
|
3071 | if ($this->count() === 0) { |
|
3072 | return false; |
|
3073 | } |
|
3074 | ||
3075 | $min = false; |
|
3076 | foreach ($this->getGenerator() as $value) { |
|
3077 | if ( |
|
3078 | $min === false |
|
3079 | || |
|
3080 | $value < $min |
|
3081 | ) { |
|
3082 | $min = $value; |
|
3083 | } |
|
3084 | } |
|
3085 | ||
3086 | return $min; |
|
3087 | } |
|
3088 | ||
3089 | /** |
|
3090 | * Get the most used value from the array. |