Completed
Push — work-fleets ( d28adc...7496c9 )
by SuperNova.WS
06:01
created
includes/classes/SnCache.php 1 patch
Doc Comments   +24 added lines patch added patch discarded remove patch
@@ -121,6 +121,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
   }
Please login to merge, or discard this patch.
includes/classes/classCache.php 1 patch
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -81,6 +81,10 @@  discard block
 block discarded – undo
81 81
   // -------------------------------------------------------------------------
82 82
   // Here comes low-level functions - those that directly works with cacher engines
83 83
   // -------------------------------------------------------------------------
84
+
85
+  /**
86
+   * @param string $name
87
+   */
84 88
   public function __set($name, $value) {
85 89
     switch ($name) {
86 90
       case '_MODE':
@@ -132,6 +136,9 @@  discard block
 block discarded – undo
132 136
     return null;
133 137
   }
134 138
 
139
+  /**
140
+   * @param string $name
141
+   */
135 142
   public function __isset($name) {
136 143
     switch (self::$mode) {
137 144
       case CACHER_NO_CACHE:
Please login to merge, or discard this patch.
includes/classes/classLocale.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -173,6 +173,9 @@
 block discarded – undo
173 173
   }
174 174
 
175 175
 
176
+  /**
177
+   * @param string $path
178
+   */
176 179
   protected function lng_try_filepath($path, $file_path_relative) {
177 180
     $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative;
178 181
     return file_exists($file_path) ? $file_path : false;
Please login to merge, or discard this patch.
includes/classes/classSupernova.php 1 patch
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
    *   <p>null - транзакция НЕ должна быть запущена</p>
324 324
    *   <p>true - транзакция должна быть запущена - для совместимости с $for_update</p>
325 325
    *   <p>false - всё равно - для совместимости с $for_update</p>
326
-   * @return bool Текущий статус транзакции
326
+   * @return null|boolean Текущий статус транзакции
327 327
    */
328 328
   public static function db_transaction_check($status = null) {
329 329
     $error_msg = false;
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
   /**
400 400
    * Блокирует указанные таблицу/список таблиц
401 401
    *
402
-   * @param string|array $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов
402
+   * @param string $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов
403 403
    * <p>string - название таблицы для блокировки</p>
404 404
    * <p>array - массив, где ключ - имя таблицы, а значение - условия блокировки элементов</p>
405 405
    */
@@ -574,6 +574,9 @@  discard block
 block discarded – undo
574 574
     return $result;
575 575
   }
576 576
 
577
+  /**
578
+   * @param integer $location_type
579
+   */
577 580
   public static function db_ins_field_set($location_type, $field_set, $serialize = false) {
578 581
     // TODO multiinsert
579 582
     !sn_db_field_set_is_safe($field_set) ? $field_set = sn_db_field_set_make_safe($field_set, $serialize) : false;
Please login to merge, or discard this patch.
includes/classes/debug.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -70,6 +70,9 @@  discard block
 block discarded – undo
70 70
     $this->numqueries = 0;
71 71
   }
72 72
 
73
+  /**
74
+   * @param string $mes
75
+   */
73 76
   function add($mes) {
74 77
     $this->log .= $mes;
75 78
     $this->numqueries++;
@@ -185,6 +188,9 @@  discard block
 block discarded – undo
185 188
     return $error_backtrace;
186 189
   }
187 190
 
191
+  /**
192
+   * @param string $die_message
193
+   */
188 194
   function error_fatal($die_message, $details = 'There is a fatal error on page') {
189 195
     // TODO - Записывать детали ошибки в лог-файл
190 196
     die($die_message);
Please login to merge, or discard this patch.
includes/classes/template_compile.php 1 patch
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -47,6 +47,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
   {
Please login to merge, or discard this patch.
includes/classes/userOptions.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -151,6 +151,9 @@
 block discarded – undo
151 151
   }
152 152
 
153 153
 
154
+  /**
155
+   * @param integer $user_id
156
+   */
154 157
   public function __construct($user_id) {
155 158
     $this->user_change($user_id);
156 159
   }
Please login to merge, or discard this patch.
includes/general/math.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 /**
38 38
  * @param float      $range_start - Начало диапазона
39 39
  * @param float      $range_end - Конец диапазона
40
- * @param bool|int  $round - До скольки знаков округлять результат. False - не округлять, True - округлять до целого, 1 - округлять до десятков, 2 - до сотен итд
40
+ * @param boolean  $round - До скольки знаков округлять результат. False - не округлять, True - округлять до целого, 1 - округлять до десятков, 2 - до сотен итд
41 41
  * @param int        $strict - В сколько сигм надо уложить результат
42 42
  * @param bool|false $cut_extreme - надо ли обрезать крайние значения. Например, при $strict = 2 их слишком много
43 43
  *
Please login to merge, or discard this patch.
includes/general.php 1 patch
Doc Comments   +34 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,10 @@  discard block
 block discarded – undo
548 560
   return implode(';', $fleet_string);
549 561
 }
550 562
 
563
+/**
564
+ * @param string $title
565
+ * @param string $body
566
+ */
551 567
 function mymail($email_unsafe, $title, $body, $from = '', $html = false) {
552 568
   $from = trim($from ? $from : classSupernova::$config->game_adminEmail);
553 569
 
@@ -808,6 +824,9 @@  discard block
 block discarded – undo
808 824
   return serialize($nick_array);
809 825
 }
810 826
 
827
+/**
828
+ * @param string $nick_string
829
+ */
811 830
 function player_nick_uncompact($nick_string) {
812 831
   try {
813 832
     $result = unserialize($nick_string);
@@ -987,6 +1006,9 @@  discard block
 block discarded – undo
987 1006
   return $result;
988 1007
 }
989 1008
 
1009
+/**
1010
+ * @param string $groups
1011
+ */
990 1012
 function isInGroup($groups, $unitId) {
991 1013
   $group = sn_get_groups($groups);
992 1014
   return !empty($group[$unitId]);
@@ -1054,6 +1076,9 @@  discard block
 block discarded – undo
1054 1076
   return $ranks;
1055 1077
 }
1056 1078
 
1079
+/**
1080
+ * @param boolean $planet_id
1081
+ */
1057 1082
 function sys_player_new_adjust($user_id, $planet_id) { return sn_function_call(__FUNCTION__, array($user_id, $planet_id, &$result)); }
1058 1083
 
1059 1084
 function sn_sys_player_new_adjust($user_id, $planet_id, &$result) {
@@ -1204,6 +1229,9 @@  discard block
 block discarded – undo
1204 1229
   return $rates;
1205 1230
 }
1206 1231
 
1232
+/**
1233
+ * @param integer $in_resource
1234
+ */
1207 1235
 function get_unit_cost_in(&$cost, $in_resource = RES_METAL) {
1208 1236
   static $rates;
1209 1237
 
@@ -1370,6 +1398,9 @@  discard block
 block discarded – undo
1370 1398
   return version_compare(sn_version_compare_extra($ver1), sn_version_compare_extra($ver2));
1371 1399
 }
1372 1400
 
1401
+/**
1402
+ * @param string $name
1403
+ */
1373 1404
 function sn_setcookie($name, $value = null, $expire = null, $path = SN_ROOT_RELATIVE, $domain = null, $secure = null, $httponly = null) {
1374 1405
   $_COOKIE[$name] = $value;
1375 1406
 
Please login to merge, or discard this patch.