@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | /** |
| 74 | 74 | * Get user option, or default option if it does not exist. |
| 75 | 75 | * @param string $option |
| 76 | - * @return mixed Returns option value as STRING, or FALSE if option does not exist. |
|
| 76 | + * @return string Returns option value as STRING, or FALSE if option does not exist. |
|
| 77 | 77 | */ |
| 78 | 78 | public function get(string $option) { |
| 79 | 79 | return $this->get_by_userid($option, (int) $this->User->id); |
@@ -135,6 +135,9 @@ discard block |
||
| 135 | 135 | return $success; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | + /** |
|
| 139 | + * @return string |
|
| 140 | + */ |
|
| 138 | 141 | private function get_db(string $option, int $userID) { |
| 139 | 142 | //This function assumes we've already done some basic validation. |
| 140 | 143 | $query = $this->db->select('value_str, value_int') |
@@ -137,7 +137,9 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | $success = $this->set_db($idData, $valueData); |
| 140 | - if($success) $this->session->unset_tempdata("option_{$option}"); |
|
| 140 | + if($success) { |
|
| 141 | + $this->session->unset_tempdata("option_{$option}"); |
|
| 142 | + } |
|
| 141 | 143 | } else { |
| 142 | 144 | $success = FALSE; |
| 143 | 145 | } |
@@ -164,7 +166,9 @@ discard block |
||
| 164 | 166 | } |
| 165 | 167 | |
| 166 | 168 | //Overall fallback method. |
| 167 | - if(!isset($value)) $value = $this->options[$option]['default']; |
|
| 169 | + if(!isset($value)) { |
|
| 170 | + $value = $this->options[$option]['default']; |
|
| 171 | + } |
|
| 168 | 172 | } else { |
| 169 | 173 | $value = FALSE; |
| 170 | 174 | } |
@@ -215,7 +219,10 @@ discard block |
||
| 215 | 219 | //This should never happen. |
| 216 | 220 | break; |
| 217 | 221 | } |
| 218 | - if(!isset($value)) $value = FALSE; //FIXME: This won't play nice with BOOL type false? |
|
| 222 | + if(!isset($value)) { |
|
| 223 | + $value = FALSE; |
|
| 224 | + } |
|
| 225 | + //FIXME: This won't play nice with BOOL type false? |
|
| 219 | 226 | |
| 220 | 227 | return $value; |
| 221 | 228 | } |