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