| @@ 3495-3513 (lines=19) @@ | ||
| 3492 | * @return false|mixed |
|
| 3493 | * <p>Will return false if there are no values.</p> |
|
| 3494 | */ |
|
| 3495 | public function max() |
|
| 3496 | { |
|
| 3497 | if ($this->count() === 0) { |
|
| 3498 | return false; |
|
| 3499 | } |
|
| 3500 | ||
| 3501 | $max = false; |
|
| 3502 | foreach ($this->getGenerator() as $value) { |
|
| 3503 | if ( |
|
| 3504 | $max === false |
|
| 3505 | || |
|
| 3506 | $value > $max |
|
| 3507 | ) { |
|
| 3508 | $max = $value; |
|
| 3509 | } |
|
| 3510 | } |
|
| 3511 | ||
| 3512 | return $max; |
|
| 3513 | } |
|
| 3514 | ||
| 3515 | /** |
|
| 3516 | * Merge the new $array into the current array. |
|
| @@ 3651-3669 (lines=19) @@ | ||
| 3648 | * @return false|mixed |
|
| 3649 | * <p>Will return false if there are no values.</p> |
|
| 3650 | */ |
|
| 3651 | public function min() |
|
| 3652 | { |
|
| 3653 | if ($this->count() === 0) { |
|
| 3654 | return false; |
|
| 3655 | } |
|
| 3656 | ||
| 3657 | $min = false; |
|
| 3658 | foreach ($this->getGenerator() as $value) { |
|
| 3659 | if ( |
|
| 3660 | $min === false |
|
| 3661 | || |
|
| 3662 | $value < $min |
|
| 3663 | ) { |
|
| 3664 | $min = $value; |
|
| 3665 | } |
|
| 3666 | } |
|
| 3667 | ||
| 3668 | return $min; |
|
| 3669 | } |
|
| 3670 | ||
| 3671 | /** |
|
| 3672 | * Get the most used value from the array. |
|