Completed
Push — work-fleets ( 8591a1...0fb536 )
by SuperNova.WS
07:12
created
classes/Common/Accessors.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 //      $method = new \ReflectionMethod($callable[0], $callable[1]);
71 71
 //      $callable = $method->getClosure($callable[0]);
72 72
 //    }
73
-    if(is_array($callable) && ($invoker = Invoker::build($callable))) {
73
+    if (is_array($callable) && ($invoker = Invoker::build($callable))) {
74 74
       $callable = $invoker;
75 75
     }
76 76
 
77 77
     $functionName = $accessor . $varName;
78 78
     $this->accessors[$functionName] = $callable;
79
-    if($shared == ACCESSOR_SHARED) {
79
+    if ($shared == ACCESSOR_SHARED) {
80 80
       $this->shared[$functionName] = true;
81 81
     }
82 82
   }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     }
109 109
 
110 110
     $functionName = $accessor . $varName;
111
-    if(!isset($this->shared[$functionName]) || !array_key_exists($functionName, $this->executed)) {
111
+    if (!isset($this->shared[$functionName]) || !array_key_exists($functionName, $this->executed)) {
112 112
       $this->executed[$functionName] = call_user_func_array($this->accessors[$functionName], $params);
113 113
     }
114 114
 
Please login to merge, or discard this patch.
classes/DbQueryConstructor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
   // TODO - rewrite
232 232
   public function getParamsFromStaticClass($className) {
233 233
     if (is_string($className) && $className && class_exists($className)) {
234
-      if(method_exists($className, 'getDb')) {
234
+      if (method_exists($className, 'getDb')) {
235 235
         $this->setDb($className::getDb());
236 236
       }
237 237
       $this->from($className::$_table);
@@ -398,14 +398,14 @@  discard block
 block discarded – undo
398 398
    */
399 399
   protected function processField($fieldName) {
400 400
     if (is_bool($fieldName)) {
401
-      $result = (string)intval($fieldName);
401
+      $result = (string) intval($fieldName);
402 402
     } elseif (is_numeric($fieldName)) {
403 403
       $result = $fieldName;
404 404
     } elseif (is_null($fieldName)) {
405 405
       $result = 'NULL';
406 406
     } else {
407 407
       // Field has other type - string or should be convertible to string
408
-      $result = (string)$fieldName;
408
+      $result = (string) $fieldName;
409 409
       if (!$fieldName instanceof DbSqlLiteral) {
410 410
         $result = $this->quoteField($fieldName);
411 411
       }
Please login to merge, or discard this patch.
classes/UnitList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@
 block discarded – undo
248 248
    */
249 249
   public function unitsCostInMetal($shipCostInMetalPerPiece) {
250 250
     $shipsCostInMetal = array();
251
-    foreach($this->mapUnitIdToDb as $ship_id => $ship) {
251
+    foreach ($this->mapUnitIdToDb as $ship_id => $ship) {
252 252
       $shipsCostInMetal[$ship_id] = $ship->count * $shipCostInMetalPerPiece[$ship_id];
253 253
     }
254 254
 
Please login to merge, or discard this patch.
classes/PropertyHider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
    * @return string
278 278
    */
279 279
   protected function adjustPropertyString($name, $diff) {
280
-    return (string)$this->$name . (string)$diff;
280
+    return (string) $this->$name . (string) $diff;
281 281
   }
282 282
 
283 283
   /**
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
    * @return array
288 288
    */
289 289
   protected function adjustPropertyArray($name, $diff) {
290
-    $copy = (array)$this->$name;
291
-    HelperArray::merge($copy, (array)$diff, HelperArray::MERGE_PHP);
290
+    $copy = (array) $this->$name;
291
+    HelperArray::merge($copy, (array) $diff, HelperArray::MERGE_PHP);
292 292
 
293 293
     return $copy;
294 294
   }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
    * @return int
301 301
    */
302 302
   protected function deltaInteger($name, $diff) {
303
-    return (int)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int)$diff;
303
+    return (int) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int) $diff;
304 304
   }
305 305
 
306 306
   /**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
    * @return float
311 311
    */
312 312
   protected function deltaDouble($name, $diff) {
313
-    return (float)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float)$diff;
313
+    return (float) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float) $diff;
314 314
   }
315 315
 
316 316
   /**
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
    * @return string
321 321
    */
322 322
   protected function deltaString($name, $diff) {
323
-    return (string)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '') . (string)$diff;
323
+    return (string) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '') . (string) $diff;
324 324
   }
325 325
 
326 326
   /**
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
    * @return array
331 331
    */
332 332
   protected function deltaArray($name, $diff) {
333
-    $copy = (array)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array());
333
+    $copy = (array) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array());
334 334
     HelperArray::merge($copy, $diff, HelperArray::MERGE_PHP);
335 335
 
336 336
     return $copy;
Please login to merge, or discard this patch.
classes/DbSqlAware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
    */
60 60
   protected function quoteFieldSimpleByRef(&$string) {
61 61
     $string = $this->escapeString($string);
62
-    if ((string)$string && '*' != $string) {
62
+    if ((string) $string && '*' != $string) {
63 63
       $string = '`' . $string . '`';
64 64
     }
65 65
   }
Please login to merge, or discard this patch.
classes/PlayerToAccountTranslate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
   protected static $is_init = false;
20 20
 
21 21
   protected static function init() {
22
-    if(!empty(static::$db)) {
22
+    if (!empty(static::$db)) {
23 23
       return;
24 24
     }
25 25
     static::$db = classSupernova::$db;
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
     $provider_id_safe = intval($provider_id_unsafe);
67 67
     !is_array($account_list) ? $account_list = array($account_list) : false;
68 68
 
69
-    foreach($account_list as $provider_account_id_unsafe) {
69
+    foreach ($account_list as $provider_account_id_unsafe) {
70 70
       $provider_account_id_safe = intval($provider_account_id_unsafe);
71 71
 
72 72
       // TODO - Здесь могут отсутствовать аккаунты - проверять провайдером
73 73
       $query = static::$db->doquery("SELECT `user_id` FROM {{account_translate}} WHERE `provider_id` = {$provider_id_safe} AND `provider_account_id` = {$provider_account_id_safe} FOR UPDATE");
74
-      while($row = static::$db->db_fetch($query)) {
74
+      while ($row = static::$db->db_fetch($query)) {
75 75
         $account_translation[$row['user_id']][$provider_id_unsafe][$provider_account_id_unsafe] = true;
76 76
       }
77 77
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
       "SELECT * FROM {{account_translate}} WHERE `user_id` = {$user_id_safe} " .
92 92
       ($provider_id_unsafe ? "AND `provider_id` = {$provider_id_safe} " : '') .
93 93
       "ORDER BY `timestamp` FOR UPDATE");
94
-    while($row = static::$db->db_fetch($query)) {
94
+    while ($row = static::$db->db_fetch($query)) {
95 95
       $account_translation[$row['user_id']][$row['provider_id']][$row['provider_account_id']] = $row;
96 96
     }
97 97
 
Please login to merge, or discard this patch.
classes/Buddy/BuddyParams.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @property string           $playerName
22 22
  * @property string           $playerNameAndCoordinates
23 23
  */
24
-class BuddyParams extends ContainerPlus  {
24
+class BuddyParams extends ContainerPlus {
25 25
 
26 26
   /**
27 27
    * BuddyParams constructor.
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
     $this->new_friend_name_unsafe = sys_get_param_str_unsafe('request_user_name');
38 38
     $this->request_text_unsafe = sys_get_param_str_unsafe('request_text');
39 39
 
40
-    $this->playerId = function (BuddyParams $cBuddy) {
40
+    $this->playerId = function(BuddyParams $cBuddy) {
41 41
       return $cBuddy->playerArray['id'];
42 42
     };
43
-    $this->playerName = function (BuddyParams $cBuddy) {
43
+    $this->playerName = function(BuddyParams $cBuddy) {
44 44
       return $cBuddy->playerArray['username'];
45 45
     };
46
-    $this->playerNameAndCoordinates = function (BuddyParams $cBuddy) {
46
+    $this->playerNameAndCoordinates = function(BuddyParams $cBuddy) {
47 47
       return "{$cBuddy->playerArray['username']} " . uni_render_coordinates($cBuddy->playerArray);
48 48
     };
49 49
   }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
  * @property string           $playerName
22 22
  * @property string           $playerNameAndCoordinates
23 23
  */
24
-class BuddyParams extends ContainerPlus  {
24
+class BuddyParams extends ContainerPlus {
25 25
 
26 26
   /**
27 27
    * BuddyParams constructor.
Please login to merge, or discard this patch.
classes/DBAL/DbQuery.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
    * @return string
141 141
    */
142 142
   protected function setInsertCommand($replace) {
143
-    switch($replace) {
143
+    switch ($replace) {
144 144
       case DB_INSERT_IGNORE:
145 145
         $result = static::INSERT_IGNORE;
146 146
       break;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     $this->build = array();
161 161
     $this->buildCommand($this->setInsertCommand($replace));
162 162
 
163
-    if(!$forceSingleInsert && is_array($this->fields) && !empty($this->fields)) {
163
+    if (!$forceSingleInsert && is_array($this->fields) && !empty($this->fields)) {
164 164
       // If there are fields - it's batch insert... unless it forced single insert
165 165
       $this->build[] = " (";
166 166
       $this->buildFieldNames(); // used $this->fields
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
    * @return string
311 311
    */
312 312
   protected function stringValue($value) {
313
-    return "'" . $this->escape((string)$value) . "'";
313
+    return "'" . $this->escape((string) $value) . "'";
314 314
   }
315 315
 
316 316
   /**
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
    * @return string
322 322
    */
323 323
   public function quote($fieldName) {
324
-    return "`" . $this->escape((string)$fieldName) . "`";
324
+    return "`" . $this->escape((string) $fieldName) . "`";
325 325
   }
326 326
 
327 327
   public function makeAdjustString($fieldValue, $fieldName) {
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
    * @return string
346 346
    */
347 347
   protected function quoteTable($tableName) {
348
-    return "`{{" . $this->escape((string)$tableName) . "}}`";
348
+    return "`{{" . $this->escape((string) $tableName) . "}}`";
349 349
   }
350 350
 
351 351
   public function castAsDbValue($value) {
352
-    switch(gettype($value)) {
352
+    switch (gettype($value)) {
353 353
       case TYPE_INTEGER:
354 354
       case TYPE_DOUBLE:
355 355
         // do nothing
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 
381 381
 
382 382
   protected function buildCommand($command) {
383
-    switch($this->command = $command) {
383
+    switch ($this->command = $command) {
384 384
       case static::UPDATE:
385 385
         $this->build[] = $this->command . " " . $this->quoteTable($this->table);
386 386
       break;
Please login to merge, or discard this patch.
classes/DbSqlHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@
 block discarded – undo
15 15
    * @return string
16 16
    */
17 17
   public static function quoteComment($comment) {
18
-    if($comment == '') {
18
+    if ($comment == '') {
19 19
       return '';
20 20
     }
21 21
 
22
-    $comment = str_replace(array('/*', '*/'), '__',$comment);
22
+    $comment = str_replace(array('/*', '*/'), '__', $comment);
23 23
 
24 24
     return "\r\n/*" . $comment . "*/";
25 25
   }
Please login to merge, or discard this patch.