@@ 2991-3009 (lines=19) @@ | ||
2988 | * |
|
2989 | * @return mixed |
|
2990 | */ |
|
2991 | public function max() |
|
2992 | { |
|
2993 | if ($this->count() === 0) { |
|
2994 | return false; |
|
2995 | } |
|
2996 | ||
2997 | $max = false; |
|
2998 | foreach ($this->getGenerator() as $value) { |
|
2999 | if ( |
|
3000 | $max === false |
|
3001 | || |
|
3002 | $value > $max |
|
3003 | ) { |
|
3004 | $max = $value; |
|
3005 | } |
|
3006 | } |
|
3007 | ||
3008 | return $max; |
|
3009 | } |
|
3010 | ||
3011 | /** |
|
3012 | * Merge the new $array into the current array. |
|
@@ 3138-3156 (lines=19) @@ | ||
3135 | * |
|
3136 | * @return mixed |
|
3137 | */ |
|
3138 | public function min() |
|
3139 | { |
|
3140 | if ($this->count() === 0) { |
|
3141 | return false; |
|
3142 | } |
|
3143 | ||
3144 | $min = false; |
|
3145 | foreach ($this->getGenerator() as $value) { |
|
3146 | if ( |
|
3147 | $min === false |
|
3148 | || |
|
3149 | $value < $min |
|
3150 | ) { |
|
3151 | $min = $value; |
|
3152 | } |
|
3153 | } |
|
3154 | ||
3155 | return $min; |
|
3156 | } |
|
3157 | ||
3158 | /** |
|
3159 | * Get the most used value from the array. |