| @@ 4359-4377 (lines=19) @@ | ||
| 4356 | * @return false|float|int|string |
|
| 4357 | * <p>Will return false if there are no values.</p> |
|
| 4358 | */ |
|
| 4359 | public function max() |
|
| 4360 | { |
|
| 4361 | if ($this->count() === 0) { |
|
| 4362 | return false; |
|
| 4363 | } |
|
| 4364 | ||
| 4365 | $max = false; |
|
| 4366 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4367 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4368 | if ( |
|
| 4369 | $max === false |
|
| 4370 | || |
|
| 4371 | $value > $max |
|
| 4372 | ) { |
|
| 4373 | $max = $value; |
|
| 4374 | } |
|
| 4375 | } |
|
| 4376 | ||
| 4377 | return $max; |
|
| 4378 | } |
|
| 4379 | ||
| 4380 | /** |
|
| @@ 4564-4582 (lines=19) @@ | ||
| 4561 | * @return false|mixed |
|
| 4562 | * <p>Will return false if there are no values.</p> |
|
| 4563 | */ |
|
| 4564 | public function min() |
|
| 4565 | { |
|
| 4566 | if ($this->count() === 0) { |
|
| 4567 | return false; |
|
| 4568 | } |
|
| 4569 | ||
| 4570 | $min = false; |
|
| 4571 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4572 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4573 | if ( |
|
| 4574 | $min === false |
|
| 4575 | || |
|
| 4576 | $value < $min |
|
| 4577 | ) { |
|
| 4578 | $min = $value; |
|
| 4579 | } |
|
| 4580 | } |
|
| 4581 | ||
| 4582 | return $min; |
|
| 4583 | } |
|
| 4584 | ||
| 4585 | /** |
|