@@ 3154-3172 (lines=19) @@ | ||
3151 | * |
|
3152 | * @return mixed |
|
3153 | */ |
|
3154 | public function max() |
|
3155 | { |
|
3156 | if ($this->count() === 0) { |
|
3157 | return false; |
|
3158 | } |
|
3159 | ||
3160 | $max = false; |
|
3161 | foreach ($this->getGenerator() as $value) { |
|
3162 | if ( |
|
3163 | $max === false |
|
3164 | || |
|
3165 | $value > $max |
|
3166 | ) { |
|
3167 | $max = $value; |
|
3168 | } |
|
3169 | } |
|
3170 | ||
3171 | return $max; |
|
3172 | } |
|
3173 | ||
3174 | /** |
|
3175 | * Merge the new $array into the current array. |
|
@@ 3309-3327 (lines=19) @@ | ||
3306 | * |
|
3307 | * @return mixed |
|
3308 | */ |
|
3309 | public function min() |
|
3310 | { |
|
3311 | if ($this->count() === 0) { |
|
3312 | return false; |
|
3313 | } |
|
3314 | ||
3315 | $min = false; |
|
3316 | foreach ($this->getGenerator() as $value) { |
|
3317 | if ( |
|
3318 | $min === false |
|
3319 | || |
|
3320 | $value < $min |
|
3321 | ) { |
|
3322 | $min = $value; |
|
3323 | } |
|
3324 | } |
|
3325 | ||
3326 | return $min; |
|
3327 | } |
|
3328 | ||
3329 | /** |
|
3330 | * Get the most used value from the array. |