| @@ 4327-4345 (lines=19) @@ | ||
| 4324 | * @return false|float|int|string |
|
| 4325 | * <p>Will return false if there are no values.</p> |
|
| 4326 | */ |
|
| 4327 | public function max() |
|
| 4328 | { |
|
| 4329 | if ($this->count() === 0) { |
|
| 4330 | return false; |
|
| 4331 | } |
|
| 4332 | ||
| 4333 | $max = false; |
|
| 4334 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4335 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4336 | if ( |
|
| 4337 | $max === false |
|
| 4338 | || |
|
| 4339 | $value > $max |
|
| 4340 | ) { |
|
| 4341 | $max = $value; |
|
| 4342 | } |
|
| 4343 | } |
|
| 4344 | ||
| 4345 | return $max; |
|
| 4346 | } |
|
| 4347 | ||
| 4348 | /** |
|
| @@ 4532-4550 (lines=19) @@ | ||
| 4529 | * @return false|mixed |
|
| 4530 | * <p>Will return false if there are no values.</p> |
|
| 4531 | */ |
|
| 4532 | public function min() |
|
| 4533 | { |
|
| 4534 | if ($this->count() === 0) { |
|
| 4535 | return false; |
|
| 4536 | } |
|
| 4537 | ||
| 4538 | $min = false; |
|
| 4539 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4540 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4541 | if ( |
|
| 4542 | $min === false |
|
| 4543 | || |
|
| 4544 | $value < $min |
|
| 4545 | ) { |
|
| 4546 | $min = $value; |
|
| 4547 | } |
|
| 4548 | } |
|
| 4549 | ||
| 4550 | return $min; |
|
| 4551 | } |
|
| 4552 | ||
| 4553 | /** |
|