@@ -10,6 +10,7 @@ discard block |
||
| 10 | 10 | * |
| 11 | 11 | * 1.0 - copyright (c) 2010 by Gorlum for http://supernova.ws |
| 12 | 12 | * @version 1.0 |
| 13 | + * @param integer $lab_require |
|
| 13 | 14 | */ |
| 14 | 15 | function eco_get_lab_max_effective_level(&$user, $lab_require) |
| 15 | 16 | { |
@@ -193,6 +194,9 @@ discard block |
||
| 193 | 194 | return $result; |
| 194 | 195 | } |
| 195 | 196 | |
| 197 | +/** |
|
| 198 | + * @param integer[] $unit_list |
|
| 199 | + */ |
|
| 196 | 200 | function eco_is_builds_in_que($planet_que, $unit_list) |
| 197 | 201 | { |
| 198 | 202 | $eco_is_builds_in_que = false; |
@@ -55,6 +55,9 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | +/** |
|
| 59 | + * @param integer $build_mode |
|
| 60 | + */ |
|
| 58 | 61 | function que_build($user, $planet, $build_mode = BUILD_CREATE, $redirect = true) { |
| 59 | 62 | global $lang, $config; |
| 60 | 63 | |
@@ -378,6 +381,9 @@ discard block |
||
| 378 | 381 | return classSupernova::db_que_list_by_type_location($user_id, $planet_id, $que_type, $for_update); |
| 379 | 382 | } |
| 380 | 383 | |
| 384 | +/** |
|
| 385 | + * @param integer $unit_id |
|
| 386 | + */ |
|
| 381 | 387 | function que_add_unit($unit_id, $user = array(), $planet = array(), $build_data, $unit_level = 0, $unit_amount = 1, $build_mode = BUILD_CREATE) { |
| 382 | 388 | // TODO Унифицировать проверки |
| 383 | 389 | |
@@ -141,6 +141,9 @@ |
||
| 141 | 141 | "); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | +/** |
|
| 145 | + * @param string $email_unsafe |
|
| 146 | + */ |
|
| 144 | 147 | function player_create($username_unsafe, $email_unsafe, $options) { |
| 145 | 148 | sn_db_transaction_check(true); |
| 146 | 149 | |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +/** |
|
| 4 | + * @return double |
|
| 5 | + */ |
|
| 3 | 6 | function flt_fleet_speed($user, $fleet) |
| 4 | 7 | { |
| 5 | 8 | if (!is_array($fleet)) |
@@ -29,6 +29,9 @@ |
||
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | +/** |
|
| 33 | + * @param string $group_name |
|
| 34 | + */ |
|
| 32 | 35 | function flt_spy_scan($target_planet, $group_name, $section_title, $target_user = array()) |
| 33 | 36 | { |
| 34 | 37 | global $lang; |
@@ -26,6 +26,10 @@ |
||
| 26 | 26 | return true; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | +/** |
|
| 30 | + * @param integer $mode |
|
| 31 | + * @param integer $mercenary_id |
|
| 32 | + */ |
|
| 29 | 33 | function mrc_mercenary_hire($mode, $user, $mercenary_id) { |
| 30 | 34 | global $config, $lang, $sn_powerup_buy_discounts; |
| 31 | 35 | |
@@ -2,7 +2,9 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | function dump($value,$varname = "",$level=0,$dumper = "") |
| 4 | 4 | { |
| 5 | - if ($varname) $varname .= " = "; |
|
| 5 | + if ($varname) { |
|
| 6 | + $varname .= " = "; |
|
| 7 | + } |
|
| 6 | 8 | |
| 7 | 9 | if ($level==-1) |
| 8 | 10 | { |
@@ -13,7 +15,9 @@ discard block |
||
| 13 | 15 | $trans["\0"]='⊕'; |
| 14 | 16 | return strtr(htmlspecialchars($value),$trans); |
| 15 | 17 | } |
| 16 | - if ($level==0) $dumper = '<pre>' . $varname; |
|
| 18 | + if ($level==0) { |
|
| 19 | + $dumper = '<pre>' . $varname; |
|
| 20 | + } |
|
| 17 | 21 | |
| 18 | 22 | $type = gettype($value); |
| 19 | 23 | $dumper .= $type; |
@@ -22,9 +26,9 @@ discard block |
||
| 22 | 26 | { |
| 23 | 27 | $dumper .= '('.strlen($value).')'; |
| 24 | 28 | $value = dump($value,"",-1); |
| 25 | - } |
|
| 26 | - elseif ($type=='boolean') $value= ($value?'true':'false'); |
|
| 27 | - elseif ($type=='object') |
|
| 29 | + } elseif ($type=='boolean') { |
|
| 30 | + $value= ($value?'true':'false'); |
|
| 31 | + } elseif ($type=='object') |
|
| 28 | 32 | { |
| 29 | 33 | $props= get_class_vars(get_class($value)); |
| 30 | 34 | $dumper .= '('.count($props).') <u>'.get_class($value).'</u>'; |
@@ -34,8 +38,7 @@ discard block |
||
| 34 | 38 | $dumper .= dump($value->$key,"",$level+1); |
| 35 | 39 | } |
| 36 | 40 | $value= ''; |
| 37 | - } |
|
| 38 | - elseif ($type=='array') |
|
| 41 | + } elseif ($type=='array') |
|
| 39 | 42 | { |
| 40 | 43 | $dumper .= '('.count($value).')'; |
| 41 | 44 | foreach($value as $key=>$val) |
@@ -46,7 +49,9 @@ discard block |
||
| 46 | 49 | $value= ''; |
| 47 | 50 | } |
| 48 | 51 | $dumper .= " <b>$value</b>"; |
| 49 | - if ($level==0) $dumper .= '</pre>'; |
|
| 52 | + if ($level==0) { |
|
| 53 | + $dumper .= '</pre>'; |
|
| 54 | + } |
|
| 50 | 55 | return $dumper; |
| 51 | 56 | } |
| 52 | 57 | |
@@ -70,8 +75,7 @@ discard block |
||
| 70 | 75 | if(substr(getcwd(), -4) != 'docs') |
| 71 | 76 | { |
| 72 | 77 | $path_prefix = 'docs/'; |
| 73 | -} |
|
| 74 | -else |
|
| 78 | +} else |
|
| 75 | 79 | { |
| 76 | 80 | $path_prefix = ''; |
| 77 | 81 | } |
@@ -119,8 +123,7 @@ discard block |
||
| 119 | 123 | $buffer['name'] = $chapter[0]; |
| 120 | 124 | } |
| 121 | 125 | $prev_chapter_is_header = true; |
| 122 | - } |
|
| 123 | - else |
|
| 126 | + } else |
|
| 124 | 127 | { |
| 125 | 128 | $prev_chapter_is_header = false; |
| 126 | 129 | foreach($chapter as &$note) |
@@ -150,8 +153,7 @@ discard block |
||
| 150 | 153 | if(!isset($note_out['name'])) |
| 151 | 154 | { |
| 152 | 155 | $note_out['name'] = $buf_str; |
| 153 | - } |
|
| 154 | - else |
|
| 156 | + } else |
|
| 155 | 157 | { |
| 156 | 158 | $note_out['lines'][] = $buf_str; |
| 157 | 159 | } |
@@ -228,36 +230,31 @@ discard block |
||
| 228 | 230 | if($matches[2]) |
| 229 | 231 | { |
| 230 | 232 | buf_print("<ol>\r\n"); |
| 231 | - } |
|
| 232 | - else |
|
| 233 | + } else |
|
| 233 | 234 | { |
| 234 | 235 | buf_print("<ul>\r\n"); |
| 235 | 236 | } |
| 236 | 237 | buf_print('<li>'); |
| 237 | 238 | $last_spaces = $matches[1]; |
| 238 | 239 | $depth[] = $matches[2]; |
| 239 | - } |
|
| 240 | - elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
| 240 | + } elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
| 241 | 241 | { |
| 242 | 242 | if(array_pop($depth)) |
| 243 | 243 | { |
| 244 | 244 | buf_print("</ol>\r\n"); |
| 245 | - } |
|
| 246 | - else |
|
| 245 | + } else |
|
| 247 | 246 | { |
| 248 | 247 | buf_print("</ul>\r\n"); |
| 249 | 248 | } |
| 250 | 249 | $last_spaces = $matches[1]; |
| 251 | 250 | buf_print('<li>'); |
| 252 | - } |
|
| 253 | - elseif(strlen($last_spaces) == strlen($matches[1])) |
|
| 251 | + } elseif(strlen($last_spaces) == strlen($matches[1])) |
|
| 254 | 252 | { |
| 255 | 253 | if($matches[2] == '' && $depth[count($depth) - 1] != '') |
| 256 | 254 | { |
| 257 | 255 | buf_print("</ol>\r\n"); |
| 258 | 256 | buf_print("<ul>\r\n"); |
| 259 | - } |
|
| 260 | - elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
| 257 | + } elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
| 261 | 258 | { |
| 262 | 259 | buf_print("</ul>\r\n"); |
| 263 | 260 | buf_print("<ol>\r\n"); |
@@ -274,8 +271,7 @@ discard block |
||
| 274 | 271 | if(array_pop($depth)) |
| 275 | 272 | { |
| 276 | 273 | buf_print("</ol>\r\n"); |
| 277 | - } |
|
| 278 | - else |
|
| 274 | + } else |
|
| 279 | 275 | { |
| 280 | 276 | buf_print("</ul>\r\n"); |
| 281 | 277 | } |
@@ -46,8 +46,7 @@ |
||
| 46 | 46 | sn_db_transaction_commit(); |
| 47 | 47 | sys_redirect("galaxy.php?mode=name&galaxy={$uni_galaxy}&system={$uni_system}"); |
| 48 | 48 | } |
| 49 | - } |
|
| 50 | - catch (exception $e) |
|
| 49 | + } catch (exception $e) |
|
| 51 | 50 | { |
| 52 | 51 | sn_db_transaction_rollback(); |
| 53 | 52 | $template->assign_block_vars('result', array( |
@@ -79,8 +79,7 @@ |
||
| 79 | 79 | |
| 80 | 80 | sn_db_transaction_commit(); |
| 81 | 81 | throw new Exception($info_action, ERR_NONE); |
| 82 | - } |
|
| 83 | - catch (Exception $e) |
|
| 82 | + } catch (Exception $e) |
|
| 84 | 83 | { |
| 85 | 84 | sn_db_transaction_rollback(); |
| 86 | 85 | |