@@ -72,7 +72,7 @@ |
||
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * @param string $verificationCode |
| 75 | - * @return mixed |
|
| 75 | + * @return string |
|
| 76 | 76 | */ |
| 77 | 77 | public function verification_check(string $verificationCode) { |
| 78 | 78 | //user is trying to validate their email for signup, check if verification code is still valid/exists |
@@ -88,6 +88,9 @@ |
||
| 88 | 88 | return $arr; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | + /** |
|
| 92 | + * @return string |
|
| 93 | + */ |
|
| 91 | 94 | public function getSiteDataFromURL(string $site_url) { |
| 92 | 95 | $query = $this->db->select('id, site_class') |
| 93 | 96 | ->from('tracker_sites') |
@@ -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') |
@@ -144,6 +144,10 @@ |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | //utility functions |
| 147 | + |
|
| 148 | + /** |
|
| 149 | + * @param string $field |
|
| 150 | + */ |
|
| 147 | 151 | function get_error_message(/*str*/$field, /*obj*/ $customObj = FALSE) { |
| 148 | 152 | $obj = $customObj ?: $this->form_validation; |
| 149 | 153 | $error_messages = ReflectionHelper::getPrivateProperty( |
@@ -69,28 +69,28 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | switch (ENVIRONMENT) |
| 71 | 71 | { |
| 72 | - case 'testing': |
|
| 73 | - case 'development': |
|
| 74 | - error_reporting(-1); |
|
| 75 | - ini_set('display_errors', 1); |
|
| 76 | - break; |
|
| 77 | - |
|
| 78 | - case 'production': |
|
| 79 | - ini_set('display_errors', 0); |
|
| 80 | - if (version_compare(PHP_VERSION, '5.3', '>=')) |
|
| 81 | - { |
|
| 82 | - error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); |
|
| 83 | - } |
|
| 84 | - else |
|
| 85 | - { |
|
| 86 | - error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); |
|
| 87 | - } |
|
| 88 | - break; |
|
| 89 | - |
|
| 90 | - default: |
|
| 91 | - header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
|
| 92 | - echo 'The application environment is not set correctly.'; |
|
| 93 | - exit(1); // EXIT_ERROR |
|
| 72 | + case 'testing': |
|
| 73 | + case 'development': |
|
| 74 | + error_reporting(-1); |
|
| 75 | + ini_set('display_errors', 1); |
|
| 76 | + break; |
|
| 77 | + |
|
| 78 | + case 'production': |
|
| 79 | + ini_set('display_errors', 0); |
|
| 80 | + if (version_compare(PHP_VERSION, '5.3', '>=')) |
|
| 81 | + { |
|
| 82 | + error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); |
|
| 83 | + } |
|
| 84 | + else |
|
| 85 | + { |
|
| 86 | + error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); |
|
| 87 | + } |
|
| 88 | + break; |
|
| 89 | + |
|
| 90 | + default: |
|
| 91 | + header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
|
| 92 | + echo 'The application environment is not set correctly.'; |
|
| 93 | + exit(1); // EXIT_ERROR |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /* |