Completed
Push — work-fleets ( 7f5906...04acf9 )
by SuperNova.WS
06:14
created
includes/classes/DBStaticMessages.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -477,6 +477,9 @@
 block discarded – undo
477 477
   {$StartRec}, 25;");
478 478
   }
479 479
 
480
+  /**
481
+   * @param integer $message_type
482
+   */
480 483
   public static function db_message_insert_all($message_type, $from, $subject, $text) {
481 484
     return classSupernova::$db->doInsert('INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) ' .
482 485
       "SELECT `id`, 0, unix_timestamp(now()), {$message_type}, '{$from}', '{$subject}', '{$text}' FROM {{users}}");
Please login to merge, or discard this patch.
includes/classes/debug.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -187,6 +187,9 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
includes/db.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -9,6 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 require_once('db/db_queries.php');
11 11
 
12
+/**
13
+ * @param string $tablename
14
+ */
12 15
 function db_change_units_perform($query, $tablename, $object_id) {
13 16
   $query = implode(',', $query);
14 17
   if($query && $object_id) {
@@ -60,6 +63,9 @@  discard block
 block discarded – undo
60 63
   db_change_units_perform($query[LOC_USER], 'users', $user['id']);
61 64
   db_change_units_perform($query[LOC_PLANET], 'planets', $planet['id']);
62 65
 }
66
+/**
67
+ * @param string $table
68
+ */
63 69
 function sn_db_perform($table, $values, $type = 'insert', $options = false) {
64 70
   $field_set = '';
65 71
 
@@ -153,6 +159,9 @@  discard block
 block discarded – undo
153 159
 
154 160
 
155 161
 
162
+/**
163
+ * @param boolean $transaction_should_be_started
164
+ */
156 165
 function sn_db_transaction_check($transaction_should_be_started = null) {
157 166
   return classSupernova::$gc->db->getTransaction()->check($transaction_should_be_started);
158 167
 }
Please login to merge, or discard this patch.
includes/db/db_queries.php 1 patch
Doc Comments   +13 added lines, -8 removed lines patch added patch discarded remove patch
@@ -173,6 +173,11 @@  discard block
 block discarded – undo
173 173
  */
174 174
 // OK v4
175 175
 // TODO - вынести в отдельный класс
176
+/**
177
+ * @param string $db_id_field_name
178
+ * @param string $db_table_name
179
+ * @param string $db_value_field_name
180
+ */
176 181
 function db_get_set_unique_id_value($current_value_unsafe, $db_id_field_name, $db_table_name, $db_value_field_name) {
177 182
   $current_value_safe = db_escape($current_value_unsafe);
178 183
   $value_id = classSupernova::$db->doSelectFetch("SELECT `{$db_id_field_name}` AS id_field FROM {{{$db_table_name}}} WHERE `{$db_value_field_name}` = '{$current_value_safe}' LIMIT 1 FOR UPDATE");
@@ -474,8 +479,8 @@  discard block
 block discarded – undo
474 479
 
475 480
 
476 481
 /**
477
- * @param $user_id
478
- * @param $change_type
482
+ * @param integer $user_id
483
+ * @param integer $change_type
479 484
  * @param $dark_matter
480 485
  * @param $comment
481 486
  * @param $row
@@ -495,7 +500,7 @@  discard block
 block discarded – undo
495 500
 /**
496 501
  * @param $user_id_safe
497 502
  *
498
- * @return array|bool|mysqli_result|null
503
+ * @return integer
499 504
  */
500 505
 function db_referral_get_by_id($user_id_safe) {
501 506
   $old_referral = classSupernova::$db->doSelectFetch("SELECT * FROM {{referrals}} WHERE `id` = {$user_id_safe} LIMIT 1 FOR UPDATE;");
@@ -523,9 +528,9 @@  discard block
 block discarded – undo
523 528
 
524 529
 // Quests ***********************************************************************************************************
525 530
 /**
526
- * @param $query_add_select
531
+ * @param string $query_add_select
527 532
  * @param $query_add_from
528
- * @param $query_add_where
533
+ * @param string $query_add_where
529 534
  *
530 535
  * @return array|bool|mysqli_result|null
531 536
  */
@@ -570,10 +575,10 @@  discard block
 block discarded – undo
570 575
 
571 576
 /**
572 577
  * @param $quest_name
573
- * @param $quest_type
578
+ * @param integer $quest_type
574 579
  * @param $quest_description
575 580
  * @param $quest_conditions
576
- * @param $quest_rewards
581
+ * @param string $quest_rewards
577 582
  * @param $quest_id
578 583
  */
579 584
 function db_quest_update($quest_name, $quest_type, $quest_description, $quest_conditions, $quest_rewards, $quest_id) {
@@ -592,7 +597,7 @@  discard block
 block discarded – undo
592 597
 /**
593 598
  * @param $banner
594 599
  * @param $banned
595
- * @param $reason
600
+ * @param string $reason
596 601
  * @param $ban_until
597 602
  */
598 603
 function db_ban_insert($banner, $banned, $reason, $ban_until) {
Please login to merge, or discard this patch.
includes/general.php 1 patch
Doc Comments   +33 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 require_once('general_pname.php');
13 13
 
14 14
 /**
15
- * @param       $func_name
15
+ * @param       string $func_name
16 16
  * @param array $func_arg
17 17
  *
18 18
  * @return mixed
@@ -63,6 +63,9 @@  discard block
 block discarded – undo
63 63
 }
64 64
 
65 65
 // ----------------------------------------------------------------------------------------------------------------
66
+/**
67
+ * @param string $filename
68
+ */
66 69
 function sys_file_read($filename) {
67 70
   return @file_get_contents($filename);
68 71
 }
@@ -105,7 +108,7 @@  discard block
 block discarded – undo
105 108
 /**
106 109
  * Получение курса обмены валюты в серверную валюту
107 110
  *
108
- * @param $currency_symbol
111
+ * @param string $currency_symbol
109 112
  *
110 113
  * @return float
111 114
  */
@@ -146,7 +149,7 @@  discard block
 block discarded – undo
146 149
  * @param float     $n
147 150
  * @param int|bool  $floor
148 151
  * @param int|bool  $color
149
- * @param int|bool  $limit
152
+ * @param boolean  $limit
150 153
  * @param bool|null $style
151 154
  *
152 155
  * @return array|float|string
@@ -239,6 +242,9 @@  discard block
 block discarded – undo
239 242
   return preg_replace($ListCensure, '*', $String);
240 243
 }
241 244
 
245
+/**
246
+ * @param string $email
247
+ */
242 248
 function is_email($email) {
243 249
   return (preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i", $email));
244 250
 }
@@ -276,6 +282,9 @@  discard block
 block discarded – undo
276 282
   return floatval(sys_get_param($param_name, $default));
277 283
 }
278 284
 
285
+/**
286
+ * @param string $param_name
287
+ */
279 288
 function sys_get_param_escaped($param_name, $default = '') {
280 289
   return db_escape(sys_get_param($param_name, $default));
281 290
 }
@@ -444,6 +453,9 @@  discard block
 block discarded – undo
444 453
 }
445 454
 
446 455
 // Generates random string of $length symbols from $allowed_chars charset
456
+/**
457
+ * @param string $allowed_chars
458
+ */
447 459
 function sys_random_string($length = 16, $allowed_chars = SN_SYS_SEC_CHARS_ALLOWED) {
448 460
   $allowed_length = strlen($allowed_chars);
449 461
 
@@ -548,6 +560,9 @@  discard block
 block discarded – undo
548 560
   return implode(';', $fleet_string);
549 561
 }
550 562
 
563
+/**
564
+ * @param string $body
565
+ */
551 566
 function mymail($email_unsafe, $title, $body, $from = '', $html = false) {
552 567
   $from = trim($from ? $from : classSupernova::$config->game_adminEmail);
553 568
 
@@ -808,6 +823,9 @@  discard block
 block discarded – undo
808 823
   return serialize($nick_array);
809 824
 }
810 825
 
826
+/**
827
+ * @param string $nick_string
828
+ */
811 829
 function player_nick_uncompact($nick_string) {
812 830
   try {
813 831
     $result = unserialize($nick_string);
@@ -995,6 +1013,9 @@  discard block
 block discarded – undo
995 1013
   return $result;
996 1014
 }
997 1015
 
1016
+/**
1017
+ * @param string $groups
1018
+ */
998 1019
 function isInGroup($groups, $unitId) {
999 1020
   $group = sn_get_groups($groups);
1000 1021
 
@@ -1063,6 +1084,9 @@  discard block
 block discarded – undo
1063 1084
   return $ranks;
1064 1085
 }
1065 1086
 
1087
+/**
1088
+ * @param boolean $planet_id
1089
+ */
1066 1090
 function sys_player_new_adjust($user_id, $planet_id) { return sn_function_call(__FUNCTION__, array($user_id, $planet_id, &$result)); }
1067 1091
 
1068 1092
 function sn_sys_player_new_adjust($user_id, $planet_id, &$result) {
@@ -1213,6 +1237,9 @@  discard block
 block discarded – undo
1213 1237
   return $rates;
1214 1238
 }
1215 1239
 
1240
+/**
1241
+ * @param integer $in_resource
1242
+ */
1216 1243
 function get_unit_cost_in(&$cost, $in_resource = RES_METAL) {
1217 1244
   static $rates;
1218 1245
 
@@ -1379,6 +1406,9 @@  discard block
 block discarded – undo
1379 1406
   return version_compare(sn_version_compare_extra($ver1), sn_version_compare_extra($ver2));
1380 1407
 }
1381 1408
 
1409
+/**
1410
+ * @param string $name
1411
+ */
1382 1412
 function sn_setcookie($name, $value = null, $expire = null, $path = SN_ROOT_RELATIVE, $domain = null, $secure = null, $httponly = null) {
1383 1413
   $_COOKIE[$name] = $value;
1384 1414
 
Please login to merge, or discard this patch.
includes/classes/DBStaticUser.php 1 patch
Doc Comments   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,6 +104,9 @@  discard block
 block discarded – undo
104 104
     return $result;
105 105
   }
106 106
 
107
+  /**
108
+   * @param integer $config_user_birthday_range
109
+   */
107 110
   public static function db_user_list_to_celebrate($config_user_birthday_range) {
108 111
     $query = static::buildDBQ()
109 112
       ->field('id', 'username', 'user_birthday', 'user_birthday_celebrated')
@@ -178,6 +181,9 @@  discard block
 block discarded – undo
178 181
   }
179 182
 
180 183
 
184
+  /**
185
+   * @param string $username_unsafe
186
+   */
181 187
   public static function db_user_by_username($username_unsafe, $for_update = false, $fields = '*', $player = null, $like = false) {
182 188
     // TODO Проверить, кстати - а везде ли нужно выбирать юзеров или где-то все-таки ищутся Альянсы ?
183 189
     if (!($username_unsafe = trim($username_unsafe))) {
@@ -232,8 +238,8 @@  discard block
 block discarded – undo
232 238
    *    <p>array - запись пользователя с установленным полем ['id']</p>
233 239
    * @param bool      $for_update @deprecated
234 240
    * @param string    $fields @deprecated список полей или '*'/'' для всех полей
235
-   * @param null      $player
236
-   * @param bool|null $player Признак выбора записи пользователь типа "игрок"
241
+   * @param boolean      $player
242
+   * @param boolean $player Признак выбора записи пользователь типа "игрок"
237 243
    *    <p>null - Можно выбрать запись любого типа</p>
238 244
    *    <p>true - Выбирается только запись типа "игрок"</p>
239 245
    *    <p>false - Выбирается только запись типа "альянс"</p>
Please login to merge, or discard this patch.
includes/functions/eco_planet_update.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -9,6 +9,9 @@
 block discarded – undo
9 9
  *     [+] Full rewrote and optimization
10 10
  *
11 11
  */
12
+/**
13
+ * @param integer $UpdateTime
14
+ */
12 15
 function sys_o_get_updated($user, $planet, $UpdateTime, $simulation = false, $no_user_update = false) {
13 16
   sn_db_transaction_check(true);
14 17
 
Please login to merge, or discard this patch.
includes/classes/SnDbCachedOperator.php 1 patch
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -314,6 +314,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
    */
Please login to merge, or discard this patch.
includes/classes/db_mysql.php 1 patch
Doc Comments   +16 added lines, -3 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
   /**
156 156
    * @param string $query
157 157
    *
158
-   * @return mixed|string
158
+   * @return string
159 159
    */
160 160
   public function replaceTablePlaceholders($query) {
161 161
     $sql = $query;
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
   }
170 170
 
171 171
   /**
172
-   * @param $query
172
+   * @param string $query
173 173
    */
174 174
   protected function logQuery($query) {
175 175
     if (!classSupernova::$config->debug) {
@@ -311,10 +311,16 @@  discard block
 block discarded – undo
311 311
     return $this->doExecute($query);
312 312
   }
313 313
 
314
+  /**
315
+   * @param string $table
316
+   */
314 317
   public function doInsertSet($table, $fieldsAndValues) {
315 318
     return $this->doSet($table, $fieldsAndValues, false);
316 319
   }
317 320
 
321
+  /**
322
+   * @param string $table
323
+   */
318 324
   public function doReplaceSet($table, $fieldsAndValues) {
319 325
     return $this->doSet($table, $fieldsAndValues, true);
320 326
   }
@@ -427,7 +433,7 @@  discard block
 block discarded – undo
427 433
    *
428 434
    * Usually used for mallformed $where conditions
429 435
    *
430
-   * @param $table
436
+   * @param string $table
431 437
    * @param $where
432 438
    *
433 439
    * @return array|bool|mysqli_result|null
@@ -565,6 +571,10 @@  discard block
 block discarded – undo
565 571
   }
566 572
 
567 573
   // TODO Заменить это на новый логгер
574
+
575
+  /**
576
+   * @param string $query
577
+   */
568 578
   protected function security_watch_user_queries($query) {
569 579
     global $user;
570 580
 
@@ -588,6 +598,9 @@  discard block
 block discarded – undo
588 598
   }
589 599
 
590 600
 
601
+  /**
602
+   * @param string $query
603
+   */
591 604
   public function security_query_check_bad_words($query) {
592 605
     if ($this->skipQueryCheck) {
593 606
       return;
Please login to merge, or discard this patch.