| @@ 4074-4092 (lines=19) @@ | ||
| 4071 | * @return false|mixed |
|
| 4072 | * <p>Will return false if there are no values.</p> |
|
| 4073 | */ |
|
| 4074 | public function max() |
|
| 4075 | { |
|
| 4076 | if ($this->count() === 0) { |
|
| 4077 | return false; |
|
| 4078 | } |
|
| 4079 | ||
| 4080 | $max = false; |
|
| 4081 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4082 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4083 | if ( |
|
| 4084 | $max === false |
|
| 4085 | || |
|
| 4086 | $value > $max |
|
| 4087 | ) { |
|
| 4088 | $max = $value; |
|
| 4089 | } |
|
| 4090 | } |
|
| 4091 | ||
| 4092 | return $max; |
|
| 4093 | } |
|
| 4094 | ||
| 4095 | /** |
|
| @@ 4263-4281 (lines=19) @@ | ||
| 4260 | * @return false|mixed |
|
| 4261 | * <p>Will return false if there are no values.</p> |
|
| 4262 | */ |
|
| 4263 | public function min() |
|
| 4264 | { |
|
| 4265 | if ($this->count() === 0) { |
|
| 4266 | return false; |
|
| 4267 | } |
|
| 4268 | ||
| 4269 | $min = false; |
|
| 4270 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4271 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4272 | if ( |
|
| 4273 | $min === false |
|
| 4274 | || |
|
| 4275 | $value < $min |
|
| 4276 | ) { |
|
| 4277 | $min = $value; |
|
| 4278 | } |
|
| 4279 | } |
|
| 4280 | ||
| 4281 | return $min; |
|
| 4282 | } |
|
| 4283 | ||
| 4284 | /** |
|