@@ 3881-3899 (lines=19) @@ | ||
3878 | * @return false|mixed |
|
3879 | * <p>Will return false if there are no values.</p> |
|
3880 | */ |
|
3881 | public function max() |
|
3882 | { |
|
3883 | if ($this->count() === 0) { |
|
3884 | return false; |
|
3885 | } |
|
3886 | ||
3887 | $max = false; |
|
3888 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3889 | foreach ($this->getGeneratorByReference() as &$value) { |
|
3890 | if ( |
|
3891 | $max === false |
|
3892 | || |
|
3893 | $value > $max |
|
3894 | ) { |
|
3895 | $max = $value; |
|
3896 | } |
|
3897 | } |
|
3898 | ||
3899 | return $max; |
|
3900 | } |
|
3901 | ||
3902 | /** |
|
@@ 4042-4060 (lines=19) @@ | ||
4039 | * @return false|mixed |
|
4040 | * <p>Will return false if there are no values.</p> |
|
4041 | */ |
|
4042 | public function min() |
|
4043 | { |
|
4044 | if ($this->count() === 0) { |
|
4045 | return false; |
|
4046 | } |
|
4047 | ||
4048 | $min = false; |
|
4049 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
4050 | foreach ($this->getGeneratorByReference() as &$value) { |
|
4051 | if ( |
|
4052 | $min === false |
|
4053 | || |
|
4054 | $value < $min |
|
4055 | ) { |
|
4056 | $min = $value; |
|
4057 | } |
|
4058 | } |
|
4059 | ||
4060 | return $min; |
|
4061 | } |
|
4062 | ||
4063 | /** |