@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | class PropertyHiderInObject extends PropertyHider { |
4 | 4 | private function getPhysicalPropertyName($name) { |
5 | - return '_' . $name; |
|
5 | + return '_'.$name; |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | /** |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | |
77 | 77 | protected function checkPropertyExists($name) { |
78 | 78 | if (!array_key_exists($name, $this->_properties)) { |
79 | - throw new ExceptionPropertyNotExists('Property [' . get_called_class() . '::' . $name . '] not exists', ERR_ERROR); |
|
79 | + throw new ExceptionPropertyNotExists('Property ['.get_called_class().'::'.$name.'] not exists', ERR_ERROR); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | 83 | protected function checkOverwriteAdjusted($name) { |
84 | 84 | if (array_key_exists($name, $this->propertiesAdjusted)) { |
85 | - throw new PropertyAccessException('Property [' . get_called_class() . '::' . $name . '] already was adjusted so no SET is possible until dbSave', ERR_ERROR); |
|
85 | + throw new PropertyAccessException('Property ['.get_called_class().'::'.$name.'] already was adjusted so no SET is possible until dbSave', ERR_ERROR); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | * @return boolean |
132 | 132 | */ |
133 | 133 | public function isContainerEmpty() { |
134 | - throw new Exception('PropertyHider::isContainerEmpty() is not implemented. You should implement it in class ' . get_called_class()); |
|
134 | + throw new Exception('PropertyHider::isContainerEmpty() is not implemented. You should implement it in class '.get_called_class()); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | |
@@ -175,15 +175,15 @@ discard block |
||
175 | 175 | $result = null; |
176 | 176 | // Now deciding - will we call a protected setter or will we work with protected property |
177 | 177 | // Todo - on init recalc all method_exists |
178 | - if (method_exists($this, $methodName = $action . ucfirst($name))) { |
|
178 | + if (method_exists($this, $methodName = $action.ucfirst($name))) { |
|
179 | 179 | // If method exists - just calling it |
180 | 180 | // TODO - should return TRUE if value changed or FALSE otherwise |
181 | 181 | $result = call_user_func_array(array($this, $methodName), array($value)); |
182 | 182 | } elseif ($this->isPropertyActionAvailable($name, $action)) { |
183 | 183 | // No setter exists - works directly with protected property |
184 | - $result = $this->{$action . 'Property'}($name, $value); |
|
184 | + $result = $this->{$action.'Property'}($name, $value); |
|
185 | 185 | } else { |
186 | - throw new ExceptionPropertyNotExists('Property [' . get_called_class() . '::' . $name . '] does not have ' . $action . 'ter/property to ' . $action, ERR_ERROR); |
|
186 | + throw new ExceptionPropertyNotExists('Property ['.get_called_class().'::'.$name.'] does not have '.$action.'ter/property to '.$action, ERR_ERROR); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | return $result; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | * @return string |
275 | 275 | */ |
276 | 276 | protected function adjustPropertyString($name, $diff) { |
277 | - return (string)$this->$name . (string)$diff; |
|
277 | + return (string) $this->$name.(string) $diff; |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | /** |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | * @return array |
285 | 285 | */ |
286 | 286 | protected function adjustPropertyArray($name, $diff) { |
287 | - $copy = (array)$this->$name; |
|
288 | - HelperArray::merge($copy, (array)$diff, HelperArray::MERGE_PHP); |
|
287 | + $copy = (array) $this->$name; |
|
288 | + HelperArray::merge($copy, (array) $diff, HelperArray::MERGE_PHP); |
|
289 | 289 | |
290 | 290 | return $copy; |
291 | 291 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * @return int |
298 | 298 | */ |
299 | 299 | protected function deltaInteger($name, $diff) { |
300 | - return (int)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int)$diff; |
|
300 | + return (int) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int) $diff; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * @return float |
308 | 308 | */ |
309 | 309 | protected function deltaDouble($name, $diff) { |
310 | - return (float)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float)$diff; |
|
310 | + return (float) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float) $diff; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | * @return string |
318 | 318 | */ |
319 | 319 | protected function deltaString($name, $diff) { |
320 | - return (string)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '') . (string)$diff; |
|
320 | + return (string) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '').(string) $diff; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | * @return array |
328 | 328 | */ |
329 | 329 | protected function deltaArray($name, $diff) { |
330 | - $copy = (array)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array()); |
|
330 | + $copy = (array) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array()); |
|
331 | 331 | HelperArray::merge($copy, $diff, HelperArray::MERGE_PHP); |
332 | 332 | |
333 | 333 | return $copy; |
@@ -350,10 +350,10 @@ discard block |
||
350 | 350 | // Capitalizing type name |
351 | 351 | $methodName = explode(' ', $type); |
352 | 352 | array_walk($methodName, 'DbSqlHelper::UCFirstByRef'); |
353 | - $methodName = $prefix . implode('', $methodName); |
|
353 | + $methodName = $prefix.implode('', $methodName); |
|
354 | 354 | |
355 | 355 | if (!method_exists($this, $methodName)) { |
356 | - throw new ExceptionTypeUnsupported('Type "' . $type . '" is unsupported in PropertyHider::propertyMethodResult'); |
|
356 | + throw new ExceptionTypeUnsupported('Type "'.$type.'" is unsupported in PropertyHider::propertyMethodResult'); |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | return call_user_func(array($this, $methodName), $name, $diff); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | break; |
31 | 31 | |
32 | 32 | case TYPE_ARRAY: |
33 | - $value = (array)$value; |
|
33 | + $value = (array) $value; |
|
34 | 34 | break; |
35 | 35 | |
36 | 36 | case TYPE_STRING: |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | case TYPE_EMPTY: |
39 | 39 | // No-type defaults to string |
40 | 40 | default: |
41 | - $value = (string)$value; |
|
41 | + $value = (string) $value; |
|
42 | 42 | break; |
43 | 43 | } |
44 | 44 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | if (is_callable($callable)) { |
53 | 53 | $this->accessors[$type][$varName] = $callable; |
54 | 54 | } else { |
55 | - throw new Exception('Error assigning callable in ' . get_called_class() . '! Callable typed [' . $type . '] is not a callable or not accessible in the scope'); |
|
55 | + throw new Exception('Error assigning callable in '.get_called_class().'! Callable typed ['.$type.'] is not a callable or not accessible in the scope'); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | public function importRow($row) { |
76 | - if(empty($row)) { |
|
76 | + if (empty($row)) { |
|
77 | 77 | return; |
78 | 78 | } |
79 | 79 |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | $that = $this; |
79 | 79 | |
80 | 80 | $this->_container->assignAccessor('type', P_CONTAINER_GETTER, |
81 | - function () use ($that) { |
|
81 | + function() use ($that) { |
|
82 | 82 | return $that->type; |
83 | 83 | } |
84 | 84 | ); |
85 | 85 | $this->_container->assignAccessor('type', P_CONTAINER_SETTER, |
86 | - function ($value) use ($that) { |
|
86 | + function($value) use ($that) { |
|
87 | 87 | $that->type = $value; |
88 | 88 | $array = get_unit_param($value); |
89 | 89 | $that->unitInfo = $array; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $propertyName = 'timeStart'; |
100 | 100 | $fieldName = self::$_properties[$propertyName][P_DB_FIELD]; |
101 | 101 | $this->_container->assignAccessor($propertyName, P_CONTAINER_IMPORTER, |
102 | - function (&$row) use ($that, $fieldName) { |
|
102 | + function(&$row) use ($that, $fieldName) { |
|
103 | 103 | if (isset($row[$fieldName])) { |
104 | 104 | $dateTime = new \DateTime($row[$fieldName]); |
105 | 105 | } else { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | ); |
111 | 111 | $this->_container->assignAccessor($propertyName, P_CONTAINER_EXPORTER, |
112 | - function (&$row) use ($that, $fieldName) { |
|
112 | + function(&$row) use ($that, $fieldName) { |
|
113 | 113 | $dateTime = $that->timeStart; |
114 | 114 | if ($dateTime instanceof \DateTime) { |
115 | 115 | $row[$fieldName] = $dateTime->format(FMT_DATE_TIME_SQL); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $propertyName = 'timeFinish'; |
123 | 123 | $fieldName = self::$_properties[$propertyName][P_DB_FIELD]; |
124 | 124 | $this->_container->assignAccessor($propertyName, P_CONTAINER_IMPORTER, |
125 | - function (&$row) use ($that, $fieldName) { |
|
125 | + function(&$row) use ($that, $fieldName) { |
|
126 | 126 | if (isset($row[$fieldName])) { |
127 | 127 | $dateTime = new \DateTime($row[$fieldName]); |
128 | 128 | } else { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | } |
133 | 133 | ); |
134 | 134 | $this->_container->assignAccessor($propertyName, P_CONTAINER_EXPORTER, |
135 | - function (&$row) use ($that, $fieldName) { |
|
135 | + function(&$row) use ($that, $fieldName) { |
|
136 | 136 | $dateTime = $that->timeFinish; |
137 | 137 | if ($dateTime instanceof \DateTime) { |
138 | 138 | $row[$fieldName] = $dateTime->format(FMT_DATE_TIME_SQL); |
@@ -27,14 +27,14 @@ |
||
27 | 27 | $cBuddy->new_request_text_unsafe = sys_get_param_str_unsafe('request_text'); |
28 | 28 | $cBuddy->playerArray = $user; |
29 | 29 | |
30 | - $cBuddy->playerId = function (BuddyRoutingParams $cBuddy) { |
|
30 | + $cBuddy->playerId = function(BuddyRoutingParams $cBuddy) { |
|
31 | 31 | return $cBuddy->playerArray['id']; |
32 | 32 | }; |
33 | - $cBuddy->playerName = function (BuddyRoutingParams $cBuddy) { |
|
33 | + $cBuddy->playerName = function(BuddyRoutingParams $cBuddy) { |
|
34 | 34 | return $cBuddy->playerArray['username']; |
35 | 35 | }; |
36 | - $cBuddy->playerNameAndCoordinates = function (BuddyRoutingParams $cBuddy) { |
|
37 | - return "{$cBuddy->playerArray['username']} " . uni_render_coordinates($cBuddy->playerArray); |
|
36 | + $cBuddy->playerNameAndCoordinates = function(BuddyRoutingParams $cBuddy) { |
|
37 | + return "{$cBuddy->playerArray['username']} ".uni_render_coordinates($cBuddy->playerArray); |
|
38 | 38 | }; |
39 | 39 | |
40 | 40 | $result = array(); |
@@ -23,7 +23,7 @@ |
||
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 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $template->assign_vars($quest_templatized); |
180 | 180 | if (!empty($quest_templatized['quest_rewards_list'])) { |
181 | 181 | foreach ($quest_templatized['quest_rewards_list'] as $quest_reward) { |
182 | - $template->assign_block_vars(($block_name ? $block_name . '.' : '') . 'quest_rewards_list', $quest_reward); |
|
182 | + $template->assign_block_vars(($block_name ? $block_name.'.' : '').'quest_rewards_list', $quest_reward); |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | } |
@@ -248,10 +248,10 @@ discard block |
||
248 | 248 | |
249 | 249 | $comment_reward = array(); |
250 | 250 | foreach ($reward_list as $unit_id => $unit_amount) { |
251 | - $comment_reward[] = $unit_amount . ' ' . classLocale::$lang['tech'][$unit_id]; |
|
251 | + $comment_reward[] = $unit_amount.' '.classLocale::$lang['tech'][$unit_id]; |
|
252 | 252 | $total_rewards[$user_id][$planet_id][$unit_id] += $unit_amount; |
253 | 253 | } |
254 | - $comment .= " {$classLocale['qst_msg_your_reward']} " . implode(',', $comment_reward); |
|
254 | + $comment .= " {$classLocale['qst_msg_your_reward']} ".implode(',', $comment_reward); |
|
255 | 255 | |
256 | 256 | DBStaticMessages::msg_send_simple_message($user['id'], 0, SN_TIME_NOW, MSG_TYPE_ADMIN, classLocale::$lang['msg_from_admin'], classLocale::$lang['qst_msg_complete_subject'], $comment); |
257 | 257 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | if (!empty($resourcesChange)) { |
291 | 291 | $planet_id = $planet_id == 0 && isset($user_row['id_planet']) ? $user_row['id_planet'] : $planet_id; |
292 | - if($planet_id) { |
|
292 | + if ($planet_id) { |
|
293 | 293 | // update planet |
294 | 294 | DBStaticPlanet::db_planet_update_resources($resourcesChange, $planet_id); |
295 | 295 | } else { |