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