| @@ 4183-4201 (lines=19) @@ | ||
| 4180 | * @return false|mixed |
|
| 4181 | * <p>Will return false if there are no values.</p> |
|
| 4182 | */ |
|
| 4183 | public function max() |
|
| 4184 | { |
|
| 4185 | if ($this->count() === 0) { |
|
| 4186 | return false; |
|
| 4187 | } |
|
| 4188 | ||
| 4189 | $max = false; |
|
| 4190 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4191 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4192 | if ( |
|
| 4193 | $max === false |
|
| 4194 | || |
|
| 4195 | $value > $max |
|
| 4196 | ) { |
|
| 4197 | $max = $value; |
|
| 4198 | } |
|
| 4199 | } |
|
| 4200 | ||
| 4201 | return $max; |
|
| 4202 | } |
|
| 4203 | ||
| 4204 | /** |
|
| @@ 4388-4406 (lines=19) @@ | ||
| 4385 | * @return false|mixed |
|
| 4386 | * <p>Will return false if there are no values.</p> |
|
| 4387 | */ |
|
| 4388 | public function min() |
|
| 4389 | { |
|
| 4390 | if ($this->count() === 0) { |
|
| 4391 | return false; |
|
| 4392 | } |
|
| 4393 | ||
| 4394 | $min = false; |
|
| 4395 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 4396 | foreach ($this->getGeneratorByReference() as &$value) { |
|
| 4397 | if ( |
|
| 4398 | $min === false |
|
| 4399 | || |
|
| 4400 | $value < $min |
|
| 4401 | ) { |
|
| 4402 | $min = $value; |
|
| 4403 | } |
|
| 4404 | } |
|
| 4405 | ||
| 4406 | return $min; |
|
| 4407 | } |
|
| 4408 | ||
| 4409 | /** |
|