| @@ 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 | /** |
|
| @@ 4279-4297 (lines=19) @@ | ||
| 4276 | * @return false|mixed |
|
| 4277 | * <p>Will return false if there are no values.</p> |
|
| 4278 | */ |
|
| 4279 | public function min() |
|
| 4280 | { |
|
| 4281 | if ($this->count() === 0) { |
|
| 4282 | return false; |
|
| 4283 | } |
|
| 4284 | ||
| 4285 | $min = false; |
|
| 4286 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4287 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4288 | if ( |
|
| 4289 | $min === false |
|
| 4290 | || |
|
| 4291 | $value < $min |
|
| 4292 | ) { |
|
| 4293 | $min = $value; |
|
| 4294 | } |
|
| 4295 | } |
|
| 4296 | ||
| 4297 | return $min; |
|
| 4298 | } |
|
| 4299 | ||
| 4300 | /** |
|