| @@ 4320-4338 (lines=19) @@ | ||
| 4317 | * @return false|float|int|string |
|
| 4318 | * <p>Will return false if there are no values.</p> |
|
| 4319 | */ |
|
| 4320 | public function max() |
|
| 4321 | { |
|
| 4322 | if ($this->count() === 0) { |
|
| 4323 | return false; |
|
| 4324 | } |
|
| 4325 | ||
| 4326 | $max = false; |
|
| 4327 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4328 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4329 | if ( |
|
| 4330 | $max === false |
|
| 4331 | || |
|
| 4332 | $value > $max |
|
| 4333 | ) { |
|
| 4334 | $max = $value; |
|
| 4335 | } |
|
| 4336 | } |
|
| 4337 | ||
| 4338 | return $max; |
|
| 4339 | } |
|
| 4340 | ||
| 4341 | /** |
|
| @@ 4525-4543 (lines=19) @@ | ||
| 4522 | * @return false|mixed |
|
| 4523 | * <p>Will return false if there are no values.</p> |
|
| 4524 | */ |
|
| 4525 | public function min() |
|
| 4526 | { |
|
| 4527 | if ($this->count() === 0) { |
|
| 4528 | return false; |
|
| 4529 | } |
|
| 4530 | ||
| 4531 | $min = false; |
|
| 4532 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4533 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4534 | if ( |
|
| 4535 | $min === false |
|
| 4536 | || |
|
| 4537 | $value < $min |
|
| 4538 | ) { |
|
| 4539 | $min = $value; |
|
| 4540 | } |
|
| 4541 | } |
|
| 4542 | ||
| 4543 | return $min; |
|
| 4544 | } |
|
| 4545 | ||
| 4546 | /** |
|