| @@ 3446-3464 (lines=19) @@ | ||
| 3443 | * @return false|mixed |
|
| 3444 | * <p>Will return false if there are no values.</p> |
|
| 3445 | */ |
|
| 3446 | public function max() |
|
| 3447 | { |
|
| 3448 | if ($this->count() === 0) { |
|
| 3449 | return false; |
|
| 3450 | } |
|
| 3451 | ||
| 3452 | $max = false; |
|
| 3453 | foreach ($this->getGenerator() as $value) { |
|
| 3454 | if ( |
|
| 3455 | $max === false |
|
| 3456 | || |
|
| 3457 | $value > $max |
|
| 3458 | ) { |
|
| 3459 | $max = $value; |
|
| 3460 | } |
|
| 3461 | } |
|
| 3462 | ||
| 3463 | return $max; |
|
| 3464 | } |
|
| 3465 | ||
| 3466 | /** |
|
| 3467 | * Merge the new $array into the current array. |
|
| @@ 3602-3620 (lines=19) @@ | ||
| 3599 | * @return false|mixed |
|
| 3600 | * <p>Will return false if there are no values.</p> |
|
| 3601 | */ |
|
| 3602 | public function min() |
|
| 3603 | { |
|
| 3604 | if ($this->count() === 0) { |
|
| 3605 | return false; |
|
| 3606 | } |
|
| 3607 | ||
| 3608 | $min = false; |
|
| 3609 | foreach ($this->getGenerator() as $value) { |
|
| 3610 | if ( |
|
| 3611 | $min === false |
|
| 3612 | || |
|
| 3613 | $value < $min |
|
| 3614 | ) { |
|
| 3615 | $min = $value; |
|
| 3616 | } |
|
| 3617 | } |
|
| 3618 | ||
| 3619 | return $min; |
|
| 3620 | } |
|
| 3621 | ||
| 3622 | /** |
|
| 3623 | * Get the most used value from the array. |
|