@@ 4210-4228 (lines=19) @@ | ||
4207 | * @return false|mixed |
|
4208 | * <p>Will return false if there are no values.</p> |
|
4209 | */ |
|
4210 | public function max() |
|
4211 | { |
|
4212 | if ($this->count() === 0) { |
|
4213 | return false; |
|
4214 | } |
|
4215 | ||
4216 | $max = false; |
|
4217 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
4218 | foreach ($this->getGeneratorByReference() as &$value) { |
|
4219 | if ( |
|
4220 | $max === false |
|
4221 | || |
|
4222 | $value > $max |
|
4223 | ) { |
|
4224 | $max = $value; |
|
4225 | } |
|
4226 | } |
|
4227 | ||
4228 | return $max; |
|
4229 | } |
|
4230 | ||
4231 | /** |
|
@@ 4415-4433 (lines=19) @@ | ||
4412 | * @return false|mixed |
|
4413 | * <p>Will return false if there are no values.</p> |
|
4414 | */ |
|
4415 | public function min() |
|
4416 | { |
|
4417 | if ($this->count() === 0) { |
|
4418 | return false; |
|
4419 | } |
|
4420 | ||
4421 | $min = false; |
|
4422 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
4423 | foreach ($this->getGeneratorByReference() as &$value) { |
|
4424 | if ( |
|
4425 | $min === false |
|
4426 | || |
|
4427 | $value < $min |
|
4428 | ) { |
|
4429 | $min = $value; |
|
4430 | } |
|
4431 | } |
|
4432 | ||
4433 | return $min; |
|
4434 | } |
|
4435 | ||
4436 | /** |