@@ -21,11 +21,19 @@ discard block |
||
21 | 21 | return empty($result) ? null : $result; |
22 | 22 | } |
23 | 23 | |
24 | + /** |
|
25 | + * @param integer $galaxy |
|
26 | + * @param integer $system |
|
27 | + * @param integer $planet |
|
28 | + */ |
|
24 | 29 | public static function db_planet_by_gspt_safe($galaxy, $system, $planet, $planet_type, $for_update = false, $fields = '*') { |
25 | 30 | return classSupernova::db_get_record_list(LOC_PLANET, |
26 | 31 | "{{planets}}.`galaxy` = {$galaxy} AND {{planets}}.`system` = {$system} AND {{planets}}.`planet` = {$planet} AND {{planets}}.`planet_type` = {$planet_type}", true); |
27 | 32 | } |
28 | 33 | |
34 | + /** |
|
35 | + * @param integer $planet_type |
|
36 | + */ |
|
29 | 37 | public static function db_planet_by_gspt($galaxy, $system, $planet, $planet_type, $for_update = false, $fields = '*') { |
30 | 38 | $galaxy = intval($galaxy); |
31 | 39 | $system = intval($system); |
@@ -120,6 +128,9 @@ discard block |
||
120 | 128 | "`id_owner` = '{$user_row['id']}' {$conditions} ORDER BY {$order_by}"); |
121 | 129 | } |
122 | 130 | |
131 | + /** |
|
132 | + * @param integer $planet_id |
|
133 | + */ |
|
123 | 134 | public static function db_planet_list_by_user_or_planet($user_id, $planet_id) { |
124 | 135 | if(!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) { |
125 | 136 | return false; |
@@ -138,6 +149,9 @@ discard block |
||
138 | 149 | return classSupernova::db_upd_record_by_id(LOC_PLANET, $planet_id, $set); |
139 | 150 | } |
140 | 151 | |
152 | + /** |
|
153 | + * @param integer $ui_planet_type |
|
154 | + */ |
|
141 | 155 | public static function db_planet_set_by_gspt($ui_galaxy, $ui_system, $ui_planet, $ui_planet_type = PT_ALL, $set) { |
142 | 156 | if(!($set = trim($set))) { |
143 | 157 | return false; |
@@ -118,6 +118,9 @@ |
||
118 | 118 | return classSupernova::$gc->cacheOperator->db_ins_record(LOC_UNIT, $set); |
119 | 119 | } |
120 | 120 | |
121 | + /** |
|
122 | + * @param integer $unit_location_type |
|
123 | + */ |
|
121 | 124 | public static function db_unit_list_delete($user_id = 0, $unit_location_type, $unit_location_id = 0, $unit_snid = 0) { |
122 | 125 | $where = array('unit_location_type' => $unit_location_type); |
123 | 126 | ($unit_location_id = idval($unit_location_id)) ? $where['unit_location_id'] = $unit_location_id : false; |
@@ -40,6 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | + * @param string $fields |
|
43 | 44 | * @return DbResultIterator |
44 | 45 | */ |
45 | 46 | protected static function playerSelectIterator($fields, $orderBy = '', $forUpdate = false, $groupHaving = '', $where = '', $limit = '') { |
@@ -134,6 +135,9 @@ discard block |
||
134 | 135 | return $result; |
135 | 136 | } |
136 | 137 | |
138 | + /** |
|
139 | + * @param integer $config_user_birthday_range |
|
140 | + */ |
|
137 | 141 | public static function db_user_list_to_celebrate($config_user_birthday_range) { |
138 | 142 | $query = "SELECT |
139 | 143 | `id`, `username`, `user_birthday`, `user_birthday_celebrated`, |
@@ -213,6 +217,9 @@ discard block |
||
213 | 217 | return $user_list; |
214 | 218 | } |
215 | 219 | |
220 | + /** |
|
221 | + * @param string $username_unsafe |
|
222 | + */ |
|
216 | 223 | public static function db_user_by_username($username_unsafe, $for_update = false, $fields = '*', $player = null, $like = false) { |
217 | 224 | // TODO Проверить, кстати - а везде ли нужно выбирать юзеров или где-то все-таки ищутся Альянсы ? |
218 | 225 | if (!($username_unsafe = trim($username_unsafe))) { |
@@ -266,7 +273,6 @@ discard block |
||
266 | 273 | |
267 | 274 | /** |
268 | 275 | * @param $user_id |
269 | - * @param array $set |
|
270 | 276 | * @param array $adjust |
271 | 277 | * |
272 | 278 | * @return array|bool|mysqli_result|null |
@@ -283,8 +289,8 @@ discard block |
||
283 | 289 | * <p>array - запись пользователя с установленным полем ['id']</p> |
284 | 290 | * @param bool $for_update @deprecated |
285 | 291 | * @param string $fields @deprecated список полей или '*'/'' для всех полей |
286 | - * @param null $player |
|
287 | - * @param bool|null $player Признак выбора записи пользователь типа "игрок" |
|
292 | + * @param boolean $player |
|
293 | + * @param boolean $player Признак выбора записи пользователь типа "игрок" |
|
288 | 294 | * <p>null - Можно выбрать запись любого типа</p> |
289 | 295 | * <p>true - Выбирается только запись типа "игрок"</p> |
290 | 296 | * <p>false - Выбирается только запись типа "альянс"</p> |
@@ -187,6 +187,9 @@ |
||
187 | 187 | return $error_backtrace; |
188 | 188 | } |
189 | 189 | |
190 | + /** |
|
191 | + * @param string $die_message |
|
192 | + */ |
|
190 | 193 | public function error_fatal($die_message, $details = 'There is a fatal error on page') { |
191 | 194 | // TODO - Записывать детали ошибки в лог-файл |
192 | 195 | die($die_message); |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | * Рассчёт бонуса ММ |
703 | 703 | * |
704 | 704 | * @param $dark_matter |
705 | - * @param bool|true $direct |
|
705 | + * @param boolean $direct |
|
706 | 706 | * @param bool|false $return_bonus |
707 | 707 | * |
708 | 708 | * @return float|int |
@@ -738,6 +738,12 @@ discard block |
||
738 | 738 | |
739 | 739 | // Дополнительная ре-трансляция адреса, если в каком-то случае платежная система ожидает нелогичный ответ |
740 | 740 | // Пример: иксолла при неправильно заданном пользователе в ордере ожидает НЕПРАВИЛЬНЫЙ_ОРДЕР, а не НЕПРАВИЛЬНЫЙ_ПОЛЬЗОВАТЕЛЬ |
741 | + |
|
742 | + /** |
|
743 | + * @param integer $error_code |
|
744 | + * |
|
745 | + * @return integer|null |
|
746 | + */ |
|
741 | 747 | function retranslate_error($error_code, $options = array()) { |
742 | 748 | return isset($options['retranslate_error'][$error_code]) ? $options['retranslate_error'][$error_code] : $error_code; |
743 | 749 | } |
@@ -121,6 +121,9 @@ discard block |
||
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
124 | + /** |
|
125 | + * @param string $filter |
|
126 | + */ |
|
124 | 127 | public static function queryCacheSetByFilter($location_type, $filter, $record_id) { |
125 | 128 | SnCache::$queries[$location_type][$filter][$record_id] = &SnCache::getDataRefByLocationAndId($location_type, $record_id); |
126 | 129 | } |
@@ -160,14 +163,23 @@ discard block |
||
160 | 163 | return true; // Не всегда - от результата |
161 | 164 | } |
162 | 165 | |
166 | + /** |
|
167 | + * @param integer $locationType |
|
168 | + */ |
|
163 | 169 | public static function getData($locationType = LOC_NONE) { |
164 | 170 | return $locationType == LOC_NONE ? static::$data : static::$data[$locationType]; |
165 | 171 | } |
166 | 172 | |
173 | + /** |
|
174 | + * @param integer $locationType |
|
175 | + */ |
|
167 | 176 | public static function cacheUnsetElement($locationType, $recordId) { |
168 | 177 | static::$data[$locationType][$recordId] = null; |
169 | 178 | } |
170 | 179 | |
180 | + /** |
|
181 | + * @param integer $locationType |
|
182 | + */ |
|
171 | 183 | public static function isArrayLocation($locationType) { |
172 | 184 | return is_array(static::$data[$locationType]); |
173 | 185 | } |
@@ -190,6 +202,9 @@ discard block |
||
190 | 202 | } |
191 | 203 | } |
192 | 204 | |
205 | + /** |
|
206 | + * @param integer $unit_snid |
|
207 | + */ |
|
193 | 208 | public static function getUnitLocator($location_type, $location_id, $unit_snid) { |
194 | 209 | return $unit_snid ? static::$locator[LOC_UNIT][$location_type][$location_id][$unit_snid] : static::$locator[LOC_UNIT][$location_type][$location_id]; |
195 | 210 | } |
@@ -222,14 +237,23 @@ discard block |
||
222 | 237 | return static::$locks; |
223 | 238 | } |
224 | 239 | |
240 | + /** |
|
241 | + * @param string $filter |
|
242 | + */ |
|
225 | 243 | public static function getQueriesByLocationAndFilter($locationType, $filter) { |
226 | 244 | return !empty(static::$queries[$locationType][$filter]) && is_array(static::$queries[$locationType][$filter]) ? static::$queries[$locationType][$filter] : array(); |
227 | 245 | } |
228 | 246 | |
247 | + /** |
|
248 | + * @param string $filter |
|
249 | + */ |
|
229 | 250 | public static function isQueryCacheByLocationAndFilterEmpty($locationType, $filter) { |
230 | 251 | return !isset(SnCache::$queries[$locationType][$filter]) || SnCache::$queries[$locationType][$filter] === null; |
231 | 252 | } |
232 | 253 | |
254 | + /** |
|
255 | + * @param string $filter |
|
256 | + */ |
|
233 | 257 | public static function queryCacheResetByLocationAndFilter($locationType, $filter) { |
234 | 258 | SnCache::$queries[$locationType][$filter] = array(); |
235 | 259 | } |
@@ -314,6 +314,9 @@ discard block |
||
314 | 314 | return $result; |
315 | 315 | } |
316 | 316 | |
317 | + /** |
|
318 | + * @param integer $location_type |
|
319 | + */ |
|
317 | 320 | public static function db_ins_field_set($location_type, $field_set, $serialize = false) { |
318 | 321 | // TODO multiinsert |
319 | 322 | !sn_db_field_set_is_safe($field_set) ? $field_set = sn_db_field_set_make_safe($field_set, $serialize) : false; |
@@ -350,7 +353,7 @@ discard block |
||
350 | 353 | /** |
351 | 354 | * Блокирует указанные таблицу/список таблиц |
352 | 355 | * |
353 | - * @param string|array $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов |
|
356 | + * @param string $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов |
|
354 | 357 | * <p>string - название таблицы для блокировки</p> |
355 | 358 | * <p>array - массив, где ключ - имя таблицы, а значение - условия блокировки элементов</p> |
356 | 359 | */ |
@@ -103,6 +103,7 @@ |
||
103 | 103 | /** |
104 | 104 | * Set custom template location (able to use directory outside of phpBB) |
105 | 105 | * @access public |
106 | + * @param string $template_path |
|
106 | 107 | */ |
107 | 108 | function set_custom_template($template_path, $template_name, $fallback_template_path = false) |
108 | 109 | { |
@@ -47,6 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | /** |
49 | 49 | * constuctor |
50 | + * @param template $template |
|
50 | 51 | */ |
51 | 52 | function template_compile(&$template) |
52 | 53 | { |
@@ -463,6 +464,7 @@ discard block |
||
463 | 464 | * Compile IF tags - much of this is from Smarty with |
464 | 465 | * some adaptions for our block level methods |
465 | 466 | * @access private |
467 | + * @param boolean $elseif |
|
466 | 468 | */ |
467 | 469 | function compile_tag_if($tag_args, $elseif) |
468 | 470 | { |
@@ -620,6 +622,7 @@ discard block |
||
620 | 622 | /** |
621 | 623 | * Compile DEFINE tags |
622 | 624 | * @access private |
625 | + * @param boolean $op |
|
623 | 626 | */ |
624 | 627 | function compile_tag_define($tag_args, $op) |
625 | 628 | { |
@@ -698,6 +701,7 @@ discard block |
||
698 | 701 | * parse expression |
699 | 702 | * This is from Smarty |
700 | 703 | * @access private |
704 | + * @param string $is_arg |
|
701 | 705 | */ |
702 | 706 | function _parse_is_expr($is_arg, $tokens) |
703 | 707 | { |
@@ -794,6 +798,8 @@ discard block |
||
794 | 798 | * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
795 | 799 | * NOTE: does not expect a trailing "." on the blockname. |
796 | 800 | * @access private |
801 | + * @param string $blockname |
|
802 | + * @param boolean $include_last_iterator |
|
797 | 803 | */ |
798 | 804 | function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) |
799 | 805 | { |
@@ -832,6 +838,7 @@ discard block |
||
832 | 838 | /** |
833 | 839 | * Write compiled file to cache directory |
834 | 840 | * @access private |
841 | + * @param string $data |
|
835 | 842 | */ |
836 | 843 | function compile_write($handle, $data) |
837 | 844 | { |
@@ -857,6 +864,7 @@ discard block |
||
857 | 864 | /** |
858 | 865 | * Minifies template w/i PHP code by removing extra spaces |
859 | 866 | * @access private |
867 | + * @return string |
|
860 | 868 | */ |
861 | 869 | function minify($html) |
862 | 870 | { |