@@ 3828-3846 (lines=19) @@ | ||
3825 | * @return false|mixed |
|
3826 | * <p>Will return false if there are no values.</p> |
|
3827 | */ |
|
3828 | public function max() |
|
3829 | { |
|
3830 | if ($this->count() === 0) { |
|
3831 | return false; |
|
3832 | } |
|
3833 | ||
3834 | $max = false; |
|
3835 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3836 | foreach ($this->getGeneratorByReference() as &$value) { |
|
3837 | if ( |
|
3838 | $max === false |
|
3839 | || |
|
3840 | $value > $max |
|
3841 | ) { |
|
3842 | $max = $value; |
|
3843 | } |
|
3844 | } |
|
3845 | ||
3846 | return $max; |
|
3847 | } |
|
3848 | ||
3849 | /** |
|
@@ 3989-4007 (lines=19) @@ | ||
3986 | * @return false|mixed |
|
3987 | * <p>Will return false if there are no values.</p> |
|
3988 | */ |
|
3989 | public function min() |
|
3990 | { |
|
3991 | if ($this->count() === 0) { |
|
3992 | return false; |
|
3993 | } |
|
3994 | ||
3995 | $min = false; |
|
3996 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3997 | foreach ($this->getGeneratorByReference() as &$value) { |
|
3998 | if ( |
|
3999 | $min === false |
|
4000 | || |
|
4001 | $value < $min |
|
4002 | ) { |
|
4003 | $min = $value; |
|
4004 | } |
|
4005 | } |
|
4006 | ||
4007 | return $min; |
|
4008 | } |
|
4009 | ||
4010 | /** |