| @@ 4379-4397 (lines=19) @@ | ||
| 4376 | * @return false|float|int|string |
|
| 4377 | * <p>Will return false if there are no values.</p> |
|
| 4378 | */ |
|
| 4379 | public function max() |
|
| 4380 | { |
|
| 4381 | if ($this->count() === 0) { |
|
| 4382 | return false; |
|
| 4383 | } |
|
| 4384 | ||
| 4385 | $max = false; |
|
| 4386 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4387 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4388 | if ( |
|
| 4389 | $max === false |
|
| 4390 | || |
|
| 4391 | $value > $max |
|
| 4392 | ) { |
|
| 4393 | $max = $value; |
|
| 4394 | } |
|
| 4395 | } |
|
| 4396 | ||
| 4397 | return $max; |
|
| 4398 | } |
|
| 4399 | ||
| 4400 | /** |
|
| @@ 4584-4602 (lines=19) @@ | ||
| 4581 | * @return false|mixed |
|
| 4582 | * <p>Will return false if there are no values.</p> |
|
| 4583 | */ |
|
| 4584 | public function min() |
|
| 4585 | { |
|
| 4586 | if ($this->count() === 0) { |
|
| 4587 | return false; |
|
| 4588 | } |
|
| 4589 | ||
| 4590 | $min = false; |
|
| 4591 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4592 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4593 | if ( |
|
| 4594 | $min === false |
|
| 4595 | || |
|
| 4596 | $value < $min |
|
| 4597 | ) { |
|
| 4598 | $min = $value; |
|
| 4599 | } |
|
| 4600 | } |
|
| 4601 | ||
| 4602 | return $min; |
|
| 4603 | } |
|
| 4604 | ||
| 4605 | /** |
|