@@ 3822-3840 (lines=19) @@ | ||
3819 | * @return false|mixed |
|
3820 | * <p>Will return false if there are no values.</p> |
|
3821 | */ |
|
3822 | public function max() |
|
3823 | { |
|
3824 | if ($this->count() === 0) { |
|
3825 | return false; |
|
3826 | } |
|
3827 | ||
3828 | $max = false; |
|
3829 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3830 | foreach ($this->getGeneratorByReference() as &$value) { |
|
3831 | if ( |
|
3832 | $max === false |
|
3833 | || |
|
3834 | $value > $max |
|
3835 | ) { |
|
3836 | $max = $value; |
|
3837 | } |
|
3838 | } |
|
3839 | ||
3840 | return $max; |
|
3841 | } |
|
3842 | ||
3843 | /** |
|
@@ 3983-4001 (lines=19) @@ | ||
3980 | * @return false|mixed |
|
3981 | * <p>Will return false if there are no values.</p> |
|
3982 | */ |
|
3983 | public function min() |
|
3984 | { |
|
3985 | if ($this->count() === 0) { |
|
3986 | return false; |
|
3987 | } |
|
3988 | ||
3989 | $min = false; |
|
3990 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3991 | foreach ($this->getGeneratorByReference() as &$value) { |
|
3992 | if ( |
|
3993 | $min === false |
|
3994 | || |
|
3995 | $value < $min |
|
3996 | ) { |
|
3997 | $min = $value; |
|
3998 | } |
|
3999 | } |
|
4000 | ||
4001 | return $min; |
|
4002 | } |
|
4003 | ||
4004 | /** |