@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function load_db_settings() { |
66 | 66 | $dbsettings = array(); |
67 | 67 | |
68 | - require(SN_ROOT_PHYSICAL . "config" . DOT_PHP_EX); |
|
68 | + require(SN_ROOT_PHYSICAL."config".DOT_PHP_EX); |
|
69 | 69 | |
70 | 70 | $this->dbsettings = $dbsettings; |
71 | 71 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $sql = $query; |
131 | 131 | if (strpos($sql, '{{') !== false) { |
132 | 132 | foreach ($this->table_list as $tableName) { |
133 | - $sql = str_replace("{{{$tableName}}}", $this->db_prefix . $tableName, $sql); |
|
133 | + $sql = str_replace("{{{$tableName}}}", $this->db_prefix.$tableName, $sql); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $arr = debug_backtrace(); |
151 | 151 | $file = end(explode('/', $arr[0]['file'])); |
152 | 152 | $line = $arr[0]['line']; |
153 | - classSupernova::$debug->add("<tr><th>Query {$this->queryCount}: </th><th>$query</th><th>{$file} @ {$line}</th><th> </th><th> " . ($fetch ? '+' : ' ') . " </th></tr>"); |
|
153 | + classSupernova::$debug->add("<tr><th>Query {$this->queryCount}: </th><th>$query</th><th>{$file} @ {$line}</th><th> </th><th> ".($fetch ? '+' : ' ')." </th></tr>"); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -219,13 +219,13 @@ discard block |
||
219 | 219 | ->execute() |
220 | 220 | ->getResult(); |
221 | 221 | } else { |
222 | - $queryResult = $this->db_sql_query($stringQuery . DbSqlHelper::quoteComment($queryTrace)); |
|
222 | + $queryResult = $this->db_sql_query($stringQuery.DbSqlHelper::quoteComment($queryTrace)); |
|
223 | 223 | } |
224 | 224 | if (!$queryResult) { |
225 | 225 | throw new Exception(); |
226 | 226 | } |
227 | 227 | } catch (Exception $e) { |
228 | - classSupernova::$debug->error($this->db_error() . "<br />{$query}<br />", 'SQL Error'); |
|
228 | + classSupernova::$debug->error($this->db_error()."<br />{$query}<br />", 'SQL Error'); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | if ($fetch) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | ->execute() |
273 | 273 | ->getIterator(); |
274 | 274 | } else { |
275 | - $queryResult = $this->db_sql_query($stringQuery . DbSqlHelper::quoteComment($queryTrace)); |
|
275 | + $queryResult = $this->db_sql_query($stringQuery.DbSqlHelper::quoteComment($queryTrace)); |
|
276 | 276 | |
277 | 277 | if (!$queryResult) { |
278 | 278 | throw new Exception(); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | } |
287 | 287 | } catch (Exception $e) { |
288 | - classSupernova::$debug->error($this->db_error() . "<br />{$query}<br />", 'SQL Error'); |
|
288 | + classSupernova::$debug->error($this->db_error()."<br />{$query}<br />", 'SQL Error'); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | return $result; |
@@ -354,10 +354,10 @@ discard block |
||
354 | 354 | $this->isWatching = true; |
355 | 355 | $msg = "\$query = \"{$query}\"\n\r"; |
356 | 356 | if (!empty($_POST)) { |
357 | - $msg .= "\n\r" . dump($_POST, '$_POST'); |
|
357 | + $msg .= "\n\r".dump($_POST, '$_POST'); |
|
358 | 358 | } |
359 | 359 | if (!empty($_GET)) { |
360 | - $msg .= "\n\r" . dump($_GET, '$_GET'); |
|
360 | + $msg .= "\n\r".dump($_GET, '$_GET'); |
|
361 | 361 | } |
362 | 362 | classSupernova::$debug->warning($msg, "Watching user {$user['id']}", 399, array('base_dump' => true)); |
363 | 363 | $this->isWatching = false; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | |
373 | 373 | global $user, $dm_change_legit, $mm_change_legit; |
374 | 374 | |
375 | - switch(true) { |
|
375 | + switch (true) { |
|
376 | 376 | case stripos($query, 'RUNCATE TABL') != false: |
377 | 377 | case stripos($query, 'ROP TABL') != false: |
378 | 378 | case stripos($query, 'ENAME TABL') != false: |
@@ -383,37 +383,37 @@ discard block |
||
383 | 383 | case stripos($query, 'RPG_POINTS') != false && stripos(trim($query), 'UPDATE ') === 0 && !$dm_change_legit: |
384 | 384 | case stripos($query, 'METAMATTER') != false && stripos(trim($query), 'UPDATE ') === 0 && !$mm_change_legit: |
385 | 385 | case stripos($query, 'AUTHLEVEL') != false && $user['authlevel'] < 3 && stripos($query, 'SELECT') !== 0: |
386 | - $report = "Hacking attempt (" . date("d.m.Y H:i:s") . " - [" . time() . "]):\n"; |
|
386 | + $report = "Hacking attempt (".date("d.m.Y H:i:s")." - [".time()."]):\n"; |
|
387 | 387 | $report .= ">Database Inforamation\n"; |
388 | - $report .= "\tID - " . $user['id'] . "\n"; |
|
389 | - $report .= "\tUser - " . $user['username'] . "\n"; |
|
390 | - $report .= "\tAuth level - " . $user['authlevel'] . "\n"; |
|
391 | - $report .= "\tAdmin Notes - " . $user['adminNotes'] . "\n"; |
|
392 | - $report .= "\tCurrent Planet - " . $user['current_planet'] . "\n"; |
|
393 | - $report .= "\tUser IP - " . $user['user_lastip'] . "\n"; |
|
394 | - $report .= "\tUser IP at Reg - " . $user['ip_at_reg'] . "\n"; |
|
395 | - $report .= "\tUser Agent- " . $_SERVER['HTTP_USER_AGENT'] . "\n"; |
|
396 | - $report .= "\tCurrent Page - " . $user['current_page'] . "\n"; |
|
397 | - $report .= "\tRegister Time - " . $user['register_time'] . "\n"; |
|
388 | + $report .= "\tID - ".$user['id']."\n"; |
|
389 | + $report .= "\tUser - ".$user['username']."\n"; |
|
390 | + $report .= "\tAuth level - ".$user['authlevel']."\n"; |
|
391 | + $report .= "\tAdmin Notes - ".$user['adminNotes']."\n"; |
|
392 | + $report .= "\tCurrent Planet - ".$user['current_planet']."\n"; |
|
393 | + $report .= "\tUser IP - ".$user['user_lastip']."\n"; |
|
394 | + $report .= "\tUser IP at Reg - ".$user['ip_at_reg']."\n"; |
|
395 | + $report .= "\tUser Agent- ".$_SERVER['HTTP_USER_AGENT']."\n"; |
|
396 | + $report .= "\tCurrent Page - ".$user['current_page']."\n"; |
|
397 | + $report .= "\tRegister Time - ".$user['register_time']."\n"; |
|
398 | 398 | $report .= "\n"; |
399 | 399 | |
400 | 400 | $report .= ">Query Information\n"; |
401 | - $report .= "\tQuery - " . $query . "\n"; |
|
401 | + $report .= "\tQuery - ".$query."\n"; |
|
402 | 402 | $report .= "\n"; |
403 | 403 | |
404 | 404 | $report .= ">\$_SERVER Information\n"; |
405 | - $report .= "\tIP - " . $_SERVER['REMOTE_ADDR'] . "\n"; |
|
406 | - $report .= "\tHost Name - " . $_SERVER['HTTP_HOST'] . "\n"; |
|
407 | - $report .= "\tUser Agent - " . $_SERVER['HTTP_USER_AGENT'] . "\n"; |
|
408 | - $report .= "\tRequest Method - " . $_SERVER['REQUEST_METHOD'] . "\n"; |
|
409 | - $report .= "\tCame From - " . $_SERVER['HTTP_REFERER'] . "\n"; |
|
410 | - $report .= "\tPage is - " . $_SERVER['SCRIPT_NAME'] . "\n"; |
|
411 | - $report .= "\tUses Port - " . $_SERVER['REMOTE_PORT'] . "\n"; |
|
412 | - $report .= "\tServer Protocol - " . $_SERVER['SERVER_PROTOCOL'] . "\n"; |
|
405 | + $report .= "\tIP - ".$_SERVER['REMOTE_ADDR']."\n"; |
|
406 | + $report .= "\tHost Name - ".$_SERVER['HTTP_HOST']."\n"; |
|
407 | + $report .= "\tUser Agent - ".$_SERVER['HTTP_USER_AGENT']."\n"; |
|
408 | + $report .= "\tRequest Method - ".$_SERVER['REQUEST_METHOD']."\n"; |
|
409 | + $report .= "\tCame From - ".$_SERVER['HTTP_REFERER']."\n"; |
|
410 | + $report .= "\tPage is - ".$_SERVER['SCRIPT_NAME']."\n"; |
|
411 | + $report .= "\tUses Port - ".$_SERVER['REMOTE_PORT']."\n"; |
|
412 | + $report .= "\tServer Protocol - ".$_SERVER['SERVER_PROTOCOL']."\n"; |
|
413 | 413 | |
414 | 414 | $report .= "\n--------------------------------------------------------------------------------------------------\n"; |
415 | 415 | |
416 | - $fp = fopen(SN_ROOT_PHYSICAL . 'badqrys.txt', 'a'); |
|
416 | + $fp = fopen(SN_ROOT_PHYSICAL.'badqrys.txt', 'a'); |
|
417 | 417 | fwrite($fp, $report); |
418 | 418 | fclose($fp); |
419 | 419 | |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | $prefix_length = strlen($this->db_prefix); |
435 | 435 | |
436 | 436 | $tl = array(); |
437 | - while($row = $this->db_fetch($query)) { |
|
437 | + while ($row = $this->db_fetch($query)) { |
|
438 | 438 | foreach ($row as $table_name) { |
439 | 439 | if (strpos($table_name, $this->db_prefix) === 0) { |
440 | 440 | $table_name = substr($table_name, $prefix_length); |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | if (is_bool($query)) { |
566 | 566 | throw new Exception('Result of SHOW STATUS command is boolean - which should never happen. Connection to DB is lost?'); |
567 | 567 | } |
568 | - while($row = db_fetch($query)) { |
|
568 | + while ($row = db_fetch($query)) { |
|
569 | 569 | $result[$row['Variable_name']] = $row['Value']; |
570 | 570 | } |
571 | 571 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | $fields[0] = &$this->_result; |
16 | 16 | |
17 | - while($field = mysqli_fetch_field($data)) { |
|
17 | + while ($field = mysqli_fetch_field($data)) { |
|
18 | 18 | $fields[] = &$out[$field->name]; |
19 | 19 | } |
20 | 20 |
@@ -101,7 +101,7 @@ |
||
101 | 101 | static::makeArrayRef($arrayNew); |
102 | 102 | static::makeArrayRef($arrayOld); |
103 | 103 | |
104 | - switch($mergeStrategy) { |
|
104 | + switch ($mergeStrategy) { |
|
105 | 105 | case HelperArray::MERGE_PHP: |
106 | 106 | $arrayOld = array_merge($arrayOld, $arrayNew); |
107 | 107 | break; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | // Removing comment placeholder from statement |
165 | 165 | $this->queryPrepared = str_replace(static::COMMENT_PLACEHOLDER, DbSqlHelper::quoteComment($this->comment), $this->queryPrepared); |
166 | 166 | // Removing comment value from values list |
167 | - $this->paramsPrepared = array_filter($this->paramsPrepared, function ($value) { return $value != DbSqlPrepare::COMMENT_PLACEHOLDER; }); |
|
167 | + $this->paramsPrepared = array_filter($this->paramsPrepared, function($value) { return $value != DbSqlPrepare::COMMENT_PLACEHOLDER; }); |
|
168 | 168 | // TODO - Add comment value directly to statement |
169 | 169 | } |
170 | 170 | |
@@ -268,9 +268,9 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | public function getIterator() { |
271 | - if(DbSqlPrepare::$isUseGetResult) { |
|
271 | + if (DbSqlPrepare::$isUseGetResult) { |
|
272 | 272 | $mysqli_result = $this->statement->get_result(); |
273 | - if($mysqli_result instanceof mysqli_result) { |
|
273 | + if ($mysqli_result instanceof mysqli_result) { |
|
274 | 274 | $iterator = new DbMysqliResultIterator($this->statement->get_result()); |
275 | 275 | } else { |
276 | 276 | $iterator = new DbEmptyIterator(); |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | } |
347 | 347 | |
348 | 348 | protected function compileFrom() { |
349 | - $this->_compiledQuery[] = 'FROM `{{' . $this->escapeString($this->table) . '}}`'; |
|
349 | + $this->_compiledQuery[] = 'FROM `{{'.$this->escapeString($this->table).'}}`'; |
|
350 | 350 | if (!empty($this->alias)) { |
351 | - $this->_compiledQuery[] = 'AS `' . $this->escapeString($this->alias) . '`'; |
|
351 | + $this->_compiledQuery[] = 'AS `'.$this->escapeString($this->alias).'`'; |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | |
@@ -358,29 +358,29 @@ discard block |
||
358 | 358 | |
359 | 359 | protected function compileWhere() { |
360 | 360 | // TODO - fields should be escaped !! |
361 | - !empty($this->where) ? $this->_compiledQuery[] = 'WHERE ' . implode(' AND ', $this->where) : false; |
|
361 | + !empty($this->where) ? $this->_compiledQuery[] = 'WHERE '.implode(' AND ', $this->where) : false; |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | protected function compileGroupBy() { |
365 | 365 | // TODO - fields should be escaped !! |
366 | 366 | // !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . implode(',', $this->arrayEscape($this->groupBy)) : false; |
367 | - !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . $this->selectFieldsToString($this->groupBy) : false; |
|
367 | + !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY '.$this->selectFieldsToString($this->groupBy) : false; |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | protected function compileOrderBy() { |
371 | 371 | // TODO - fields should be escaped !! |
372 | - !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY ' . implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
372 | + !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY '.implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | protected function compileHaving() { |
376 | 376 | // TODO - fields should be escaped !! |
377 | - !empty($this->having) ? $this->_compiledQuery[] = 'HAVING ' . implode(' AND ', $this->having) : false; |
|
377 | + !empty($this->having) ? $this->_compiledQuery[] = 'HAVING '.implode(' AND ', $this->having) : false; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | protected function compileLimit() { |
381 | 381 | // TODO - fields should be escaped !! |
382 | 382 | if ($limit = $this->fetchOne ? 1 : $this->limit) { |
383 | - $this->_compiledQuery[] = 'LIMIT ' . $limit . (!empty($this->offset) ? ' OFFSET ' . $this->offset : ''); |
|
383 | + $this->_compiledQuery[] = 'LIMIT '.$limit.(!empty($this->offset) ? ' OFFSET '.$this->offset : ''); |
|
384 | 384 | } |
385 | 385 | } |
386 | 386 | |
@@ -424,14 +424,14 @@ discard block |
||
424 | 424 | */ |
425 | 425 | protected function processField($fieldName) { |
426 | 426 | if (is_bool($fieldName)) { |
427 | - $result = (string)intval($fieldName); |
|
427 | + $result = (string) intval($fieldName); |
|
428 | 428 | } elseif (is_numeric($fieldName)) { |
429 | 429 | $result = $fieldName; |
430 | 430 | } elseif (is_null($fieldName)) { |
431 | 431 | $result = 'NULL'; |
432 | 432 | } else { |
433 | 433 | // Field has other type - string or should be convertible to string |
434 | - $result = (string)$fieldName; |
|
434 | + $result = (string) $fieldName; |
|
435 | 435 | if (!$fieldName instanceof DbSqlLiteral) { |
436 | 436 | $result = $this->quoteField($fieldName); |
437 | 437 | } |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | * @param array $arguments |
20 | 20 | */ |
21 | 21 | public function __call($method_name, array $arguments) { |
22 | - foreach($this->_container as $object) { |
|
23 | - if(is_object($object) && method_exists($object, $method_name)) { |
|
22 | + foreach ($this->_container as $object) { |
|
23 | + if (is_object($object) && method_exists($object, $method_name)) { |
|
24 | 24 | call_user_func_array(array($object, $method_name), $arguments); |
25 | 25 | } |
26 | 26 | } |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function getSumProperty($property_name) { |
37 | 37 | $result = 0.0; |
38 | - foreach($this->_container as $object) { |
|
39 | - if(is_object($object) && property_exists($object, $property_name)) { |
|
38 | + foreach ($this->_container as $object) { |
|
39 | + if (is_object($object) && property_exists($object, $property_name)) { |
|
40 | 40 | $result += $object->$property_name; |
41 | 41 | } |
42 | 42 | } |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | * @return mixed |
53 | 53 | */ |
54 | 54 | public function aggregateByMethod($method_name, &$result) { |
55 | - foreach($this->_container as $object) { |
|
56 | - if(is_object($object) && method_exists($object, $method_name)) { |
|
55 | + foreach ($this->_container as $object) { |
|
56 | + if (is_object($object) && method_exists($object, $method_name)) { |
|
57 | 57 | call_user_func(array($object, $method_name), $result); |
58 | 58 | } |
59 | 59 | } |
@@ -53,20 +53,20 @@ discard block |
||
53 | 53 | //+ |
54 | 54 | protected function checkPropertyExists($name) { |
55 | 55 | if (!array_key_exists($name, static::$_properties)) { |
56 | - throw new ExceptionPropertyNotExists('Property [' . get_called_class() . '::' . $name . '] not exists', ERR_ERROR); |
|
56 | + throw new ExceptionPropertyNotExists('Property ['.get_called_class().'::'.$name.'] not exists', ERR_ERROR); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | 60 | //+ |
61 | 61 | protected function checkOverwriteAdjusted($name) { |
62 | 62 | if (array_key_exists($name, $this->propertiesAdjusted)) { |
63 | - throw new PropertyAccessException('Property [' . get_called_class() . '::' . $name . '] already was adjusted so no SET is possible until dbSave', ERR_ERROR); |
|
63 | + throw new PropertyAccessException('Property ['.get_called_class().'::'.$name.'] already was adjusted so no SET is possible until dbSave', ERR_ERROR); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | 67 | //+ |
68 | 68 | private function getPhysicalPropertyName($name) { |
69 | - return '_' . $name; |
|
69 | + return '_'.$name; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | //+ |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | |
89 | 89 | $result = null; |
90 | 90 | // Now deciding - will we call a protected setter or will we work with protected property |
91 | - if (method_exists($this, $methodName = 'get' . ucfirst($name))) { |
|
91 | + if (method_exists($this, $methodName = 'get'.ucfirst($name))) { |
|
92 | 92 | // If method exists - just calling it |
93 | 93 | $result = call_user_func_array(array($this, $methodName), array()); |
94 | 94 | } elseif ($this->isPropertyDeclared($name)) { |
95 | 95 | // No getter exists - works directly with protected property |
96 | 96 | $result = $this->{$this->getPhysicalPropertyName($name)}; |
97 | 97 | } else { |
98 | - throw new ExceptionPropertyNotExists('Property [' . get_called_class() . '::' . $name . '] does not have getter/property to get', ERR_ERROR); |
|
98 | + throw new ExceptionPropertyNotExists('Property ['.get_called_class().'::'.$name.'] does not have getter/property to get', ERR_ERROR); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return $result; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | protected function _setUnsafe($name, $value) { |
115 | 115 | $result = null; |
116 | 116 | // Now deciding - will we call a protected setter or will we work with protected property |
117 | - if (method_exists($this, $methodName = 'set' . ucfirst($name))) { |
|
117 | + if (method_exists($this, $methodName = 'set'.ucfirst($name))) { |
|
118 | 118 | // If method exists - just calling it |
119 | 119 | // TODO - should return TRUE if value changed or FALSE otherwise |
120 | 120 | $result = call_user_func_array(array($this, $methodName), array($value)); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $this->{$this->getPhysicalPropertyName($name)} = $value; |
125 | 125 | // } |
126 | 126 | } else { |
127 | - throw new ExceptionPropertyNotExists('Property [' . get_called_class() . '::' . $name . '] does not have setter/property to set', ERR_ERROR); |
|
127 | + throw new ExceptionPropertyNotExists('Property ['.get_called_class().'::'.$name.'] does not have setter/property to set', ERR_ERROR); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | // TODO - should be primed only if value changed |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @return string |
183 | 183 | */ |
184 | 184 | protected function _adjustValueString($name, $diff) { |
185 | - return (string)$this->$name . (string)$diff; |
|
185 | + return (string) $this->$name.(string) $diff; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | * @return array |
193 | 193 | */ |
194 | 194 | protected function _adjustValueArray($name, $diff) { |
195 | - $copy = (array)$this->$name; |
|
196 | - HelperArray::merge($copy, (array)$diff, HelperArray::MERGE_PHP); |
|
195 | + $copy = (array) $this->$name; |
|
196 | + HelperArray::merge($copy, (array) $diff, HelperArray::MERGE_PHP); |
|
197 | 197 | return $copy; |
198 | 198 | } |
199 | 199 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @return int |
205 | 205 | */ |
206 | 206 | protected function _adjustValueIntegerDiff($name, $diff) { |
207 | - return (int)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int)$diff; |
|
207 | + return (int) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int) $diff; |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * @return float |
215 | 215 | */ |
216 | 216 | protected function _adjustValueDoubleDiff($name, $diff) { |
217 | - return (float)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float)$diff; |
|
217 | + return (float) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float) $diff; |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | * @return string |
225 | 225 | */ |
226 | 226 | protected function _adjustValueStringDiff($name, $diff) { |
227 | - return (string)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '') . (string)$diff; |
|
227 | + return (string) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '').(string) $diff; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | * @return array |
235 | 235 | */ |
236 | 236 | protected function _adjustValueArrayDiff($name, $diff) { |
237 | - $copy = (array)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array()); |
|
237 | + $copy = (array) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array()); |
|
238 | 238 | HelperArray::merge($copy, $diff, HelperArray::MERGE_PHP); |
239 | 239 | return $copy; |
240 | 240 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | array_walk($type, 'DbSqlHelper::UCFirstByRef'); |
259 | 259 | $type = implode('', $type); |
260 | 260 | |
261 | - if (!method_exists($this, $methodName = '_adjustValue' . $type . $suffix)) { |
|
261 | + if (!method_exists($this, $methodName = '_adjustValue'.$type.$suffix)) { |
|
262 | 262 | throw new ExceptionTypeUnsupported(); |
263 | 263 | } |
264 | 264 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $this->checkPropertyExists($name); |
305 | 305 | |
306 | 306 | // Now deciding - will we call a protected setter or will we work with protected property |
307 | - if (method_exists($this, $methodName = 'adj' . ucfirst($name))) { |
|
307 | + if (method_exists($this, $methodName = 'adj'.ucfirst($name))) { |
|
308 | 308 | // If method exists - just calling it |
309 | 309 | // Method returns new adjusted value |
310 | 310 | $newValue = call_user_func_array(array($this, $methodName), array($diff)); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | } |
324 | 324 | |
325 | 325 | // Adding diff to adjustment accumulator |
326 | - if (method_exists($this, $methodName = 'adj' . ucfirst($name) . 'Diff')) { |
|
326 | + if (method_exists($this, $methodName = 'adj'.ucfirst($name).'Diff')) { |
|
327 | 327 | call_user_func_array(array($this, $methodName), array($diff)); |
328 | 328 | } else { |
329 | 329 | // TODO - property type checks |