Completed
Push — work-fleets ( 006942...3604bd )
by SuperNova.WS
06:54
created
classes/DBAL/DbTransaction.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
    *   <p>true - транзакция должна быть запущена - для совместимости с $for_update</p>
40 40
    *   <p>false - всё равно - для совместимости с $for_update</p>
41 41
    *
42
-   * @return bool Текущий статус транзакции
42
+   * @return null|boolean Текущий статус транзакции
43 43
    */
44 44
   public function check($status = null) {
45 45
     $error_msg = false;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
     if (!empty($error_msg)) {
60 60
       // TODO - Убрать позже
61
-      print('<h1>СООБЩИТЕ ЭТО АДМИНУ: sn_db_transaction_check() - ' . $error_msg . '</h1>');
61
+      print('<h1>СООБЩИТЕ ЭТО АДМИНУ: sn_db_transaction_check() - '.$error_msg.'</h1>');
62 62
       $backtrace = debug_backtrace();
63 63
       array_shift($backtrace);
64 64
       pdump($backtrace);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
   public function start($level = '') {
72 72
     $this->check(null);
73 73
 
74
-    $level ? $this->db->doSql('SET TRANSACTION ISOLATION LEVEL ' . $level) : false;
74
+    $level ? $this->db->doSql('SET TRANSACTION ISOLATION LEVEL '.$level) : false;
75 75
 
76 76
     $this->transaction_id++;
77 77
     $this->db->doSql('START TRANSACTION');
Please login to merge, or discard this patch.
classes/DbRowDirectOperator.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -85,6 +85,9 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
classes/DbSqlLiteral.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
   }
27 27
 
28 28
   /**
29
-   * @param mixed $value
29
+   * @param string $value
30 30
    *
31 31
    * @return $this
32 32
    */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
    * @return $this
32 32
    */
33 33
   public function literal($value) {
34
-    $this->literal = (string)$value;
34
+    $this->literal = (string) $value;
35 35
 
36 36
     return $this;
37 37
   }
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
       $alias = $this->aliasFromField($functionName, $field);
65 65
     }
66 66
 
67
-    $this->literal = strtoupper($functionName) . '(' . $this->quoteField($field) . ')';
67
+    $this->literal = strtoupper($functionName).'('.$this->quoteField($field).')';
68 68
 
69 69
     if (self::SQL_LITERAL_ALIAS_NONE !== $alias && !empty($alias)) {
70
-      $this->literal .= ' AS `' . $alias . '`';
70
+      $this->literal .= ' AS `'.$alias.'`';
71 71
     }
72 72
 
73 73
     return $this;
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
       $alias = $this->aliasFromField($functionName, $field);
125 125
     }
126 126
 
127
-    $this->literal = $this->quoteField($field) . ' IS NULL';
127
+    $this->literal = $this->quoteField($field).' IS NULL';
128 128
 
129 129
     if (!empty($alias)) {
130
-      $this->literal .= ' AS `' . $alias . '`';
130
+      $this->literal .= ' AS `'.$alias.'`';
131 131
     }
132 132
 
133 133
     return $this;
Please login to merge, or discard this patch.
classes/DBStatic/DBStaticAlly.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,12 +72,12 @@
 block discarded – undo
72 72
    */
73 73
   public static function db_ally_insert($ally_name_unsafe, $ally_tag_unsafe, $userId) {
74 74
     $ally = classSupernova::$db->doInsertSet(TABLE_ALLIANCE, array(
75
-      'ally_name'          => (string)$ally_name_unsafe,
76
-      'ally_tag'           => (string)$ally_tag_unsafe,
75
+      'ally_name'          => (string) $ally_name_unsafe,
76
+      'ally_tag'           => (string) $ally_tag_unsafe,
77 77
       'ally_owner'         => $userId,
78
-      'ally_owner_range'   => (string)classLocale::$lang['ali_leaderRank'],
79
-      'ally_members'       => (int)1,
80
-      'ranklist'           => (string)(classLocale::$lang['ali_defaultRankName'] . ",0,0,0,0,0"),
78
+      'ally_owner_range'   => (string) classLocale::$lang['ali_leaderRank'],
79
+      'ally_members'       => (int) 1,
80
+      'ranklist'           => (string) (classLocale::$lang['ali_defaultRankName'].",0,0,0,0,0"),
81 81
       'ally_register_time' => SN_TIME_NOW,
82 82
     ));
83 83
 
Please login to merge, or discard this patch.
classes/DBStatic/DBStaticChat.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
    */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
       JOIN {{users}} AS u ON u.id = cp.chat_player_player_id
13 13
     WHERE
14 14
       `chat_player_refresh_last` >= '{$sql_date}'
15
-      AND (`banaday` IS NULL OR `banaday` <= " . SN_TIME_NOW . ")
15
+      AND (`banaday` IS NULL OR `banaday` <= ".SN_TIME_NOW.")
16 16
       {$ally_add}
17 17
     ORDER BY authlevel DESC, `username`");
18 18
   }
Please login to merge, or discard this patch.
classes/DBStatic/DBStaticFleetACS.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
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})");
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
    */
52 52
   public static function db_acs_insert($fleetid, $userId, $objFleet) {
53 53
     classSupernova::$db->doInsertSet(TABLE_AKS, array(
54
-      'name'           => classLocale::$lang['flt_acs_prefix'] . $fleetid,
54
+      'name'           => classLocale::$lang['flt_acs_prefix'].$fleetid,
55 55
       'teilnehmer'     => $userId,
56 56
       'flotten'        => $fleetid,
57 57
       'ankunft'        => $objFleet->time_arrive_to_target,
Please login to merge, or discard this patch.
classes/DBStatic/DBStaticFleetMissile.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -2,6 +2,10 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
    * @return array|bool|mysqli_result|null
24 24
    */
25 25
   public static function db_missile_list_by_arrival() {
26
-    $iraks = classSupernova::$db->doSelect("SELECT * FROM `{{iraks}}` WHERE `fleet_end_time` <= " . SN_TIME_NOW . " FOR UPDATE;");
26
+    $iraks = classSupernova::$db->doSelect("SELECT * FROM `{{iraks}}` WHERE `fleet_end_time` <= ".SN_TIME_NOW." FOR UPDATE;");
27 27
 
28 28
     return $iraks;
29 29
   }
Please login to merge, or discard this patch.
classes/DBStatic/DBStaticMessages.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -467,6 +467,12 @@
 block discarded – undo
467 467
   {$StartRec}, 25;");
468 468
   }
469 469
 
470
+  /**
471
+   * @param integer $message_type
472
+   * @param string $from_unsafe
473
+   * @param string $subject_unsafe
474
+   * @param string $text_unsafe
475
+   */
470 476
   public static function db_message_insert_all($message_type, $from_unsafe, $subject_unsafe, $text_unsafe) {
471 477
     $message_type_safe = intval($message_type);
472 478
     $from_safe = db_escape($from_unsafe);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         array(),
158 158
         array(
159 159
           // TODO DANGER
160
-          '`id` IN (' . implode(',', $owners) . ')',
160
+          '`id` IN ('.implode(',', $owners).')',
161 161
         )
162 162
       );
163 163
     }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     $sendList = array();
177 177
     $list = '';
178 178
     $query = DBStaticUser::db_user_list(
179
-      "ally_id = '{$ally_id}'" . ($ally_rank_id >= 0 ? " AND ally_rank_id = {$ally_rank_id}" : ''),
179
+      "ally_id = '{$ally_id}'".($ally_rank_id >= 0 ? " AND ally_rank_id = {$ally_rank_id}" : ''),
180 180
       false, 'id, username');
181 181
     foreach ($query as $u) {
182 182
       $sendList[] = $u['id'];
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
       $subject_unsafe = substr($subject_unsafe, strlen(classLocale::$lang['msg_answer_prefix']));
266 266
       $re++;
267 267
     }
268
-    $re ? $subject_unsafe = classLocale::$lang['msg_answer_prefix'] . $subject_unsafe : false;
268
+    $re ? $subject_unsafe = classLocale::$lang['msg_answer_prefix'].$subject_unsafe : false;
269 269
 
270 270
     $subject_unsafe = $subject_unsafe ? $subject_unsafe : classLocale::$lang['msg_subject_default'];
271 271
 
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     return classSupernova::$db->doSelect(
442 442
       "SELECT * FROM {{messages}}
443 443
         WHERE
444
-          `message_type` = '" . MSG_TYPE_PLAYER . "' AND
444
+          `message_type` = '" . MSG_TYPE_PLAYER."' AND
445 445
           ((`message_owner` = '{$user['id']}' AND `message_sender` = '{$recipient_id}')
446 446
           OR
447 447
           (`message_sender` = '{$user['id']}' AND `message_owner` = '{$recipient_id}')) ORDER BY `message_time` DESC LIMIT 20;");
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 FROM
486 486
   {{messages}} AS m
487 487
   LEFT JOIN {{users}} AS u ON u.id = m.message_owner " .
488
-      ($int_type_selected >= 0 ? "WHERE `message_type` = {$int_type_selected} " : '') .
488
+      ($int_type_selected >= 0 ? "WHERE `message_type` = {$int_type_selected} " : '').
489 489
       "ORDER BY
490 490
   `message_id` DESC
491 491
 LIMIT
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
     $subject_safe = db_escape($subject_unsafe);
499 499
     $text_safe = db_escape($text_unsafe);
500 500
 
501
-    return classSupernova::$db->doInsertComplex('INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) ' .
501
+    return classSupernova::$db->doInsertComplex('INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) '.
502 502
       "SELECT `id`, 0, unix_timestamp(now()), {$message_type_safe}, '{$from_safe}', '{$subject_safe}', '{$text_safe}' FROM {{users}}");
503 503
   }
504 504
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
    * @return array|bool|mysqli_result|null
509 509
    */
510 510
   public static function db_message_count_by_type($int_type_selected) {
511
-    $page_max = classSupernova::$db->doSelectFetchArray('SELECT COUNT(*) AS `max` FROM `{{messages}}`' . ($int_type_selected >= 0 ? " WHERE `message_type` = {$int_type_selected};" : ''));
511
+    $page_max = classSupernova::$db->doSelectFetchArray('SELECT COUNT(*) AS `max` FROM `{{messages}}`'.($int_type_selected >= 0 ? " WHERE `message_type` = {$int_type_selected};" : ''));
512 512
 
513 513
     return $page_max;
514 514
   }
Please login to merge, or discard this patch.
classes/DBStatic/DBStaticNews.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@
 block discarded – undo
50 50
 
51 51
   /**
52 52
    * @param template $template
53
-   * @param          $query_where
54
-   * @param          $query_limit
53
+   * @param          string $query_where
54
+   * @param          integer $query_limit
55 55
    *
56 56
    * @return array|bool|mysqli_result|null
57 57
    */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
       LEFT JOIN {{survey}} AS s ON s.survey_announce_id = a.idAnnounce
44 44
       LEFT JOIN {{users}} AS u ON u.id = a.user_id
45 45
     {$query_where}
46
-    ORDER BY `tsTimeStamp` DESC, idAnnounce" .
46
+    ORDER BY `tsTimeStamp` DESC, idAnnounce".
47 47
       ($query_limit ? " LIMIT {$query_limit}" : ''));
48 48
 
49 49
     $template->assign_var('NEWS_COUNT', classSupernova::$db->db_num_rows($announce_list));
Please login to merge, or discard this patch.