@@ 4229-4247 (lines=19) @@ | ||
4226 | * @return false|mixed |
|
4227 | * <p>Will return false if there are no values.</p> |
|
4228 | */ |
|
4229 | public function max() |
|
4230 | { |
|
4231 | if ($this->count() === 0) { |
|
4232 | return false; |
|
4233 | } |
|
4234 | ||
4235 | $max = false; |
|
4236 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
4237 | foreach ($this->getGeneratorByReference() as &$value) { |
|
4238 | if ( |
|
4239 | $max === false |
|
4240 | || |
|
4241 | $value > $max |
|
4242 | ) { |
|
4243 | $max = $value; |
|
4244 | } |
|
4245 | } |
|
4246 | ||
4247 | return $max; |
|
4248 | } |
|
4249 | ||
4250 | /** |
|
@@ 4434-4452 (lines=19) @@ | ||
4431 | * @return false|mixed |
|
4432 | * <p>Will return false if there are no values.</p> |
|
4433 | */ |
|
4434 | public function min() |
|
4435 | { |
|
4436 | if ($this->count() === 0) { |
|
4437 | return false; |
|
4438 | } |
|
4439 | ||
4440 | $min = false; |
|
4441 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
4442 | foreach ($this->getGeneratorByReference() as &$value) { |
|
4443 | if ( |
|
4444 | $min === false |
|
4445 | || |
|
4446 | $value < $min |
|
4447 | ) { |
|
4448 | $min = $value; |
|
4449 | } |
|
4450 | } |
|
4451 | ||
4452 | return $min; |
|
4453 | } |
|
4454 | ||
4455 | /** |