@@ 3808-3826 (lines=19) @@ | ||
3805 | * @return false|mixed |
|
3806 | * <p>Will return false if there are no values.</p> |
|
3807 | */ |
|
3808 | public function max() |
|
3809 | { |
|
3810 | if ($this->count() === 0) { |
|
3811 | return false; |
|
3812 | } |
|
3813 | ||
3814 | $max = false; |
|
3815 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3816 | foreach ($this->getGeneratorByReference() as &$value) { |
|
3817 | if ( |
|
3818 | $max === false |
|
3819 | || |
|
3820 | $value > $max |
|
3821 | ) { |
|
3822 | $max = $value; |
|
3823 | } |
|
3824 | } |
|
3825 | ||
3826 | return $max; |
|
3827 | } |
|
3828 | ||
3829 | /** |
|
@@ 3969-3987 (lines=19) @@ | ||
3966 | * @return false|mixed |
|
3967 | * <p>Will return false if there are no values.</p> |
|
3968 | */ |
|
3969 | public function min() |
|
3970 | { |
|
3971 | if ($this->count() === 0) { |
|
3972 | return false; |
|
3973 | } |
|
3974 | ||
3975 | $min = false; |
|
3976 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3977 | foreach ($this->getGeneratorByReference() as &$value) { |
|
3978 | if ( |
|
3979 | $min === false |
|
3980 | || |
|
3981 | $value < $min |
|
3982 | ) { |
|
3983 | $min = $value; |
|
3984 | } |
|
3985 | } |
|
3986 | ||
3987 | return $min; |
|
3988 | } |
|
3989 | ||
3990 | /** |