@@ -85,6 +85,9 @@ |
||
85 | 85 | return $this->db->doSelectIterator($query); |
86 | 86 | } |
87 | 87 | |
88 | + /** |
|
89 | + * @param string $table |
|
90 | + */ |
|
88 | 91 | public function doUpdateRowSetAffected($table, $fieldsAndValues, $where) { |
89 | 92 | $this->db->doUpdateRowSet($table, $fieldsAndValues, $where); |
90 | 93 | return $this->db->db_affected_rows(); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @param int $sigma |
19 | 19 | * @param bool $strict |
20 | 20 | * |
21 | - * @return int |
|
21 | + * @return double |
|
22 | 22 | */ |
23 | 23 | public static function sn_rand_gauss($mu = 0, $sigma = 1, $strict = false) { |
24 | 24 | // http://ru.wikipedia.org/wiki/Среднеквадратическое_отклонение |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @param float $range_start - Начало диапазона |
44 | 44 | * @param float $range_end - Конец диапазона |
45 | - * @param bool|int $round - До скольки знаков округлять результат. False - не округлять, True - округлять до целого, 1 - округлять до десятков, 2 - до сотен итд |
|
45 | + * @param boolean $round - До скольки знаков округлять результат. False - не округлять, True - округлять до целого, 1 - округлять до десятков, 2 - до сотен итд |
|
46 | 46 | * @param int $strict - В сколько сигм надо уложить результат |
47 | 47 | * @param bool|false $cut_extreme - надо ли обрезать крайние значения. Например, при $strict = 2 их слишком много |
48 | 48 | * |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | require_once('general_pname.php'); |
12 | 12 | |
13 | 13 | /** |
14 | - * @param $func_name |
|
14 | + * @param string $func_name |
|
15 | 15 | * @param array $func_arg |
16 | 16 | * |
17 | 17 | * @return mixed |
@@ -62,6 +62,9 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | // ---------------------------------------------------------------------------------------------------------------- |
65 | +/** |
|
66 | + * @param string $filename |
|
67 | + */ |
|
65 | 68 | function sys_file_read($filename) { |
66 | 69 | return @file_get_contents($filename); |
67 | 70 | } |
@@ -104,7 +107,7 @@ discard block |
||
104 | 107 | /** |
105 | 108 | * Получение курса обмены валюты в серверную валюту |
106 | 109 | * |
107 | - * @param $currency_symbol |
|
110 | + * @param string $currency_symbol |
|
108 | 111 | * |
109 | 112 | * @return float |
110 | 113 | */ |
@@ -130,7 +133,7 @@ discard block |
||
130 | 133 | * - true - colors number to green if positive or zero; red if negative |
131 | 134 | * - 0 |
132 | 135 | * - numeric - colors number to green if less then $color; red if greater |
133 | - * @param int|bool $limit - generally converts "15000" to "15k", "2000000" to "2kk" etc |
|
136 | + * @param boolean $limit - generally converts "15000" to "15k", "2000000" to "2kk" etc |
|
134 | 137 | * - 0/false - proceed with $floor |
135 | 138 | * - numeric - divides number to segments by power of $limit and adds 'k' for each segment |
136 | 139 | * - makes sense for 1000, but works with any number |
@@ -229,6 +232,9 @@ discard block |
||
229 | 232 | return preg_replace($ListCensure, '*', $String); |
230 | 233 | } |
231 | 234 | |
235 | +/** |
|
236 | + * @param string $email |
|
237 | + */ |
|
232 | 238 | function is_email($email) { |
233 | 239 | 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)); |
234 | 240 | } |
@@ -266,6 +272,9 @@ discard block |
||
266 | 272 | return floatval(sys_get_param($param_name, $default)); |
267 | 273 | } |
268 | 274 | |
275 | +/** |
|
276 | + * @param string $param_name |
|
277 | + */ |
|
269 | 278 | function sys_get_param_escaped($param_name, $default = '') { |
270 | 279 | return db_escape(sys_get_param($param_name, $default)); |
271 | 280 | } |
@@ -434,6 +443,9 @@ discard block |
||
434 | 443 | } |
435 | 444 | |
436 | 445 | // Generates random string of $length symbols from $allowed_chars charset |
446 | +/** |
|
447 | + * @param string $allowed_chars |
|
448 | + */ |
|
437 | 449 | function sys_random_string($length = 16, $allowed_chars = SN_SYS_SEC_CHARS_ALLOWED) { |
438 | 450 | $allowed_length = strlen($allowed_chars); |
439 | 451 | |
@@ -538,6 +550,10 @@ discard block |
||
538 | 550 | return implode(';', $fleet_string); |
539 | 551 | } |
540 | 552 | |
553 | +/** |
|
554 | + * @param string $title |
|
555 | + * @param string $body |
|
556 | + */ |
|
541 | 557 | function mymail($email_unsafe, $title, $body, $from = '', $html = false) { |
542 | 558 | $from = trim($from ? $from : classSupernova::$config->game_adminEmail); |
543 | 559 | |
@@ -803,6 +819,9 @@ discard block |
||
803 | 819 | return serialize($nick_array); |
804 | 820 | } |
805 | 821 | |
822 | +/** |
|
823 | + * @param string $nick_string |
|
824 | + */ |
|
806 | 825 | function player_nick_uncompact($nick_string) { |
807 | 826 | try { |
808 | 827 | $result = unserialize($nick_string); |
@@ -990,6 +1009,9 @@ discard block |
||
990 | 1009 | return $result; |
991 | 1010 | } |
992 | 1011 | |
1012 | +/** |
|
1013 | + * @param string $groups |
|
1014 | + */ |
|
993 | 1015 | function isInGroup($groups, $unitId) { |
994 | 1016 | $group = sn_get_groups($groups); |
995 | 1017 | |
@@ -1058,6 +1080,9 @@ discard block |
||
1058 | 1080 | return $ranks; |
1059 | 1081 | } |
1060 | 1082 | |
1083 | +/** |
|
1084 | + * @param boolean $planet_id |
|
1085 | + */ |
|
1061 | 1086 | function sys_player_new_adjust($user_id, $planet_id) { return sn_function_call(__FUNCTION__, array($user_id, $planet_id, &$result)); } |
1062 | 1087 | |
1063 | 1088 | function sn_sys_player_new_adjust($user_id, $planet_id, &$result) { |
@@ -1216,6 +1241,9 @@ discard block |
||
1216 | 1241 | return $rates; |
1217 | 1242 | } |
1218 | 1243 | |
1244 | +/** |
|
1245 | + * @param integer $in_resource |
|
1246 | + */ |
|
1219 | 1247 | function get_unit_cost_in(&$cost, $in_resource = RES_METAL) { |
1220 | 1248 | static $rates; |
1221 | 1249 | |
@@ -1382,6 +1410,9 @@ discard block |
||
1382 | 1410 | return version_compare(sn_version_compare_extra($ver1), sn_version_compare_extra($ver2)); |
1383 | 1411 | } |
1384 | 1412 | |
1413 | +/** |
|
1414 | + * @param string $name |
|
1415 | + */ |
|
1385 | 1416 | function sn_setcookie($name, $value = null, $expire = null, $path = SN_ROOT_RELATIVE, $domain = null, $secure = null, $httponly = null) { |
1386 | 1417 | $_COOKIE[$name] = $value; |
1387 | 1418 |
@@ -444,7 +444,6 @@ discard block |
||
444 | 444 | } |
445 | 445 | |
446 | 446 | /** |
447 | - * @param bool $skip_query_check |
|
448 | 447 | * |
449 | 448 | * @return array |
450 | 449 | */ |
@@ -455,7 +454,6 @@ discard block |
||
455 | 454 | } |
456 | 455 | |
457 | 456 | /** |
458 | - * @param bool $skip_query_check |
|
459 | 457 | * |
460 | 458 | * @return mixed|null |
461 | 459 | */ |
@@ -293,7 +293,7 @@ |
||
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
296 | - * @param $ranklist |
|
296 | + * @param string $ranklist |
|
297 | 297 | * @param $user |
298 | 298 | */ |
299 | 299 | public static function db_ally_update_ranklist($ranklist, $user) { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | /** |
21 | 21 | * @param $user_id |
22 | - * @param $nickUnsafe |
|
22 | + * @param string $nickUnsafe |
|
23 | 23 | * @param $ally_id |
24 | 24 | * @param $message_unsafe |
25 | 25 | * @param $chat_message_sender_name_unsafe |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param $alliance |
55 | 55 | * @param $where_add |
56 | 56 | * @param $start_row |
57 | - * @param $page_limit |
|
57 | + * @param integer $page_limit |
|
58 | 58 | * |
59 | 59 | * @return array|bool|mysqli_result|null |
60 | 60 | */ |
@@ -75,7 +75,7 @@ |
||
75 | 75 | |
76 | 76 | |
77 | 77 | /** |
78 | - * @param $fleet_group_id_list |
|
78 | + * @param string $fleet_group_id_list |
|
79 | 79 | */ |
80 | 80 | public static function db_acs_delete_by_list($fleet_group_id_list) { |
81 | 81 | doquery("DELETE FROM {{aks}} WHERE `id` IN ({$fleet_group_id_list})"); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | /** |
6 | 6 | * @param $user |
7 | 7 | * @param $planet_dst |
8 | - * @param $time_limit |
|
8 | + * @param integer $time_limit |
|
9 | 9 | * |
10 | 10 | * @return array|bool|mysqli_result|null |
11 | 11 | */ |
@@ -2,6 +2,10 @@ |
||
2 | 2 | |
3 | 3 | class DBStaticFleetMissile { |
4 | 4 | |
5 | + /** |
|
6 | + * @param double $arrival |
|
7 | + * @param integer $target_structure |
|
8 | + */ |
|
5 | 9 | public static function db_missile_insert($target_coord, $user, $planetrow, $arrival, $fleet_ship_count, $target_structure) { |
6 | 10 | classSupernova::$db->doInsert( |
7 | 11 | "INSERT INTO `{{iraks}}` SET |