@@ -27,32 +27,32 @@ |
||
27 | 27 | private $_parameterNames; |
28 | 28 | private $_parameterValues; |
29 | 29 | |
30 | - public function getPreparedSql(){ return $this->_sqlString; } |
|
31 | - public function setPreparedSql($value){ $this->_sqlString = $value; } |
|
30 | + public function getPreparedSql() { return $this->_sqlString; } |
|
31 | + public function setPreparedSql($value) { $this->_sqlString = $value; } |
|
32 | 32 | |
33 | 33 | public function getParameterNames($needed = true) |
34 | 34 | { |
35 | - if (!$this->_parameterNames and $needed) |
|
35 | + if(!$this->_parameterNames and $needed) |
|
36 | 36 | $this->_parameterNames = new TList; |
37 | 37 | return $this->_parameterNames; |
38 | 38 | } |
39 | 39 | |
40 | - public function setParameterNames($value){ $this->_parameterNames = $value; } |
|
40 | + public function setParameterNames($value) { $this->_parameterNames = $value; } |
|
41 | 41 | |
42 | 42 | public function getParameterValues($needed = true) |
43 | 43 | { |
44 | - if (!$this->_parameterValues and $needed) |
|
44 | + if(!$this->_parameterValues and $needed) |
|
45 | 45 | $this->_parameterValues = new TMap; |
46 | 46 | return $this->_parameterValues; |
47 | 47 | } |
48 | 48 | |
49 | - public function setParameterValues($value){ $this->_parameterValues = $value; } |
|
49 | + public function setParameterValues($value) { $this->_parameterValues = $value; } |
|
50 | 50 | |
51 | 51 | public function __sleep() |
52 | 52 | { |
53 | 53 | $exprops = []; $cn = __CLASS__; |
54 | - if (!$this->_parameterNames or !$this->_parameterNames->getCount()) $exprops[] = "\0$cn\0_parameterNames"; |
|
55 | - if (!$this->_parameterValues or !$this->_parameterValues->getCount()) $exprops[] = "\0$cn\0_parameterValues"; |
|
54 | + if(!$this->_parameterNames or !$this->_parameterNames->getCount()) $exprops[] = "\0$cn\0_parameterNames"; |
|
55 | + if(!$this->_parameterValues or !$this->_parameterValues->getCount()) $exprops[] = "\0$cn\0_parameterValues"; |
|
56 | 56 | return array_diff(parent::__sleep(), $exprops); |
57 | 57 | } |
58 | 58 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $properties = $prepared->getParameterNames(false); |
54 | 54 | //$parameters = $prepared->getParameterValues(); |
55 | 55 | $registry = $manager->getTypeHandlers(); |
56 | - if ($properties) |
|
56 | + if($properties) |
|
57 | 57 | for($i = 0, $k = $properties->getCount(); $i < $k; $i++) |
58 | 58 | { |
59 | 59 | $property = $statement->parameterMap()->getProperty($i); |
@@ -26,18 +26,18 @@ |
||
26 | 26 | private $_keys; |
27 | 27 | private $_method = TMappedStatement::QUERY_FOR_LIST; |
28 | 28 | |
29 | - public function getStatement(){ return $this->_statement; } |
|
30 | - public function setStatement($value){ $this->_statement = $value; } |
|
29 | + public function getStatement() { return $this->_statement; } |
|
30 | + public function setStatement($value) { $this->_statement = $value; } |
|
31 | 31 | |
32 | - public function getResultProperty(){ return $this->_property; } |
|
33 | - public function setResultProperty($value){ $this->_property = $value; } |
|
32 | + public function getResultProperty() { return $this->_property; } |
|
33 | + public function setResultProperty($value) { $this->_property = $value; } |
|
34 | 34 | |
35 | - public function getResultObject(){ return $this->_resultObject; } |
|
36 | - public function setResultObject($value){ $this->_resultObject = $value; } |
|
35 | + public function getResultObject() { return $this->_resultObject; } |
|
36 | + public function setResultObject($value) { $this->_resultObject = $value; } |
|
37 | 37 | |
38 | - public function getKeys(){ return $this->_keys; } |
|
39 | - public function setKeys($value){ $this->_keys = $value; } |
|
38 | + public function getKeys() { return $this->_keys; } |
|
39 | + public function setKeys($value) { $this->_keys = $value; } |
|
40 | 40 | |
41 | - public function getMethod(){ return $this->_method; } |
|
42 | - public function setMethod($value){ $this->_method = $value; } |
|
41 | + public function getMethod() { return $this->_method; } |
|
42 | + public function setMethod($value) { $this->_method = $value; } |
|
43 | 43 | } |
44 | 44 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | private function startVisual() |
31 | 31 | { |
32 | 32 | $scf_generator = new TWsatScaffoldingGenerator(); |
33 | - foreach ($scf_generator->getAllTableNames() as $tableName) |
|
33 | + foreach($scf_generator->getAllTableNames() as $tableName) |
|
34 | 34 | { |
35 | 35 | $dynChb = new TCheckBox(); |
36 | 36 | $dynChb->ID = "cb_$tableName"; |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function generate($sender) |
50 | 50 | { |
51 | - if ($this->IsValid) |
|
51 | + if($this->IsValid) |
|
52 | 52 | { |
53 | 53 | try |
54 | 54 | { |
55 | 55 | $scf_generator = new TWsatScaffoldingGenerator(); |
56 | 56 | $scf_generator->setOpFile($this->output_folder->Text); |
57 | - foreach ($scf_generator->getAllTableNames() as $tableName) |
|
57 | + foreach($scf_generator->getAllTableNames() as $tableName) |
|
58 | 58 | { |
59 | 59 | $id = "cb_$tableName"; |
60 | 60 | $obj = $this->tableNames->findControl($id); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | // generates unique ID by hashing the runtime path |
307 | 307 | $this->_uniqueID = md5($this->_runtimePath); |
308 | 308 | $this->_parameters = new \Prado\Collections\TMap; |
309 | - $this->_services = [$this->getPageServiceID() => ['TPageService',[],null]]; |
|
309 | + $this->_services = [$this->getPageServiceID() => ['TPageService', [], null]]; |
|
310 | 310 | |
311 | 311 | Prado::setPathOfAlias('Application', $this->_basePath); |
312 | 312 | } |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $this->_step++; |
385 | 385 | } |
386 | 386 | } |
387 | - catch(\Exception $e) |
|
387 | + catch (\Exception $e) |
|
388 | 388 | { |
389 | 389 | $this->onError($e); |
390 | 390 | } |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | */ |
420 | 420 | public function getGlobalState($key, $defaultValue = null) |
421 | 421 | { |
422 | - return isset($this->_globals[$key])?$this->_globals[$key]:$defaultValue; |
|
422 | + return isset($this->_globals[$key]) ? $this->_globals[$key] : $defaultValue; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | /** |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | // keep the key to avoid reuse of the old module id |
949 | 949 | $this->_lazyModules[$id] = null; |
950 | 950 | |
951 | - return [$module,$configElement]; |
|
951 | + return [$module, $configElement]; |
|
952 | 952 | } |
953 | 953 | /** |
954 | 954 | * Applies an application configuration. |
@@ -974,7 +974,7 @@ discard block |
||
974 | 974 | } |
975 | 975 | |
976 | 976 | if(empty($this->_services)) |
977 | - $this->_services = [$this->getPageServiceID() => ['Prado\Web\Services\TPageService',[],null]]; |
|
977 | + $this->_services = [$this->getPageServiceID() => ['Prado\Web\Services\TPageService', [], null]]; |
|
978 | 978 | |
979 | 979 | // load parameters |
980 | 980 | foreach($config->getParameters() as $id => $parameter) |
@@ -1238,7 +1238,7 @@ discard block |
||
1238 | 1238 | public function onEndRequest() |
1239 | 1239 | { |
1240 | 1240 | $this->flushOutput(false); // flush all remaining content in the buffer |
1241 | - $this->saveGlobals(); // save global state |
|
1241 | + $this->saveGlobals(); // save global state |
|
1242 | 1242 | $this->raiseEvent('OnEndRequest', $this, null); |
1243 | 1243 | } |
1244 | 1244 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | array_shift($args); |
47 | 47 | $n = count($args); |
48 | 48 | $tokens = []; |
49 | - for($i = 0;$i < $n;++$i) |
|
49 | + for($i = 0; $i < $n; ++$i) |
|
50 | 50 | $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]); |
51 | 51 | parent::__construct(strtr($errorMessage, $tokens)); |
52 | 52 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | array_shift($args); |
56 | 56 | $n = count($args); |
57 | 57 | $tokens = []; |
58 | - for($i = 0;$i < $n;++$i) |
|
58 | + for($i = 0; $i < $n; ++$i) |
|
59 | 59 | $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]); |
60 | 60 | parent::__construct(strtr($errorMessage, $tokens)); |
61 | 61 | } |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | $msgFile = $this->getErrorMessageFile(); |
71 | 71 | |
72 | 72 | // Cache messages |
73 | - if (!isset(self::$_messageCache[$msgFile])) |
|
73 | + if(!isset(self::$_messageCache[$msgFile])) |
|
74 | 74 | { |
75 | 75 | if(($entries = @file($msgFile)) !== false) |
76 | 76 | { |
77 | 77 | foreach($entries as $entry) |
78 | 78 | { |
79 | - list($code, $message) = array_merge(explode('=', $entry, 2), [ '' ]); |
|
79 | + list($code, $message) = array_merge(explode('=', $entry, 2), ['']); |
|
80 | 80 | self::$_messageCache[$msgFile][trim($code)] = trim($message); |
81 | 81 | } |
82 | 82 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | $content = $this->getErrorTemplate($statusCode, $exception); |
197 | 197 | |
198 | - $serverAdmin = isset($_SERVER['SERVER_ADMIN'])?$_SERVER['SERVER_ADMIN']:''; |
|
198 | + $serverAdmin = isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : ''; |
|
199 | 199 | |
200 | 200 | $isDebug = $this->getApplication()->getMode() === TApplicationMode::Debug; |
201 | 201 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | if($exception instanceof TTemplateException) |
263 | 263 | { |
264 | 264 | $fileName = $exception->getTemplateFile(); |
265 | - $lines = empty($fileName)?explode("\n", $exception->getTemplateSource()):@file($fileName); |
|
265 | + $lines = empty($fileName) ?explode("\n", $exception->getTemplateSource()) : @file($fileName); |
|
266 | 266 | $source = $this->getSourceCode($lines, $exception->getLineNumber()); |
267 | 267 | if($fileName === '') |
268 | 268 | $fileName = '---embedded template---'; |
@@ -425,11 +425,11 @@ discard block |
||
425 | 425 | |
426 | 426 | private function getSourceCode($lines, $errorLine) |
427 | 427 | { |
428 | - $beginLine = $errorLine - self::SOURCE_LINES >= 0?$errorLine - self::SOURCE_LINES:0; |
|
429 | - $endLine = $errorLine + self::SOURCE_LINES <= count($lines)?$errorLine + self::SOURCE_LINES:count($lines); |
|
428 | + $beginLine = $errorLine - self::SOURCE_LINES >= 0 ? $errorLine - self::SOURCE_LINES : 0; |
|
429 | + $endLine = $errorLine + self::SOURCE_LINES <= count($lines) ? $errorLine + self::SOURCE_LINES : count($lines); |
|
430 | 430 | |
431 | 431 | $source = ''; |
432 | - for($i = $beginLine;$i < $endLine;++$i) |
|
432 | + for($i = $beginLine; $i < $endLine; ++$i) |
|
433 | 433 | { |
434 | 434 | if($i === $errorLine - 1) |
435 | 435 | { |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | } |
444 | 444 | |
445 | 445 | private function addLink($message) { |
446 | - if (null !== ($class = $this->getErrorClassNameSpace($message))) { |
|
446 | + if(null !== ($class = $this->getErrorClassNameSpace($message))) { |
|
447 | 447 | return str_replace($class['name'], '<a href="' . $class['url'] . '" target="_blank">' . $class['name'] . '</a>', $message); |
448 | 448 | } |
449 | 449 | return $message; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | private function getErrorClassNameSpace($message) { |
453 | 453 | $matches = []; |
454 | 454 | preg_match('/\b(T[A-Z]\w+)\b/', $message, $matches); |
455 | - if (is_array($matches) && count($matches) > 0) { |
|
455 | + if(is_array($matches) && count($matches) > 0) { |
|
456 | 456 | $class = $matches[0]; |
457 | 457 | try { |
458 | 458 | $function = new \ReflectionClass($class); |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function applyLimitOffset($sql, $limit = -1, $offset = -1) |
95 | 95 | { |
96 | - $limit = $limit !== null ? (int)$limit : -1; |
|
97 | - $offset = $offset !== null ? (int)$offset : -1; |
|
96 | + $limit = $limit !== null ? (int) $limit : -1; |
|
97 | + $offset = $offset !== null ? (int) $offset : -1; |
|
98 | 98 | $limitStr = $limit >= 0 ? ' LIMIT ' . $limit : ''; |
99 | 99 | $offsetStr = $offset >= 0 ? ' OFFSET ' . $offset : ''; |
100 | 100 | return $sql . $limitStr . $offsetStr; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | if($k) |
249 | 249 | $result[] = 'NULL AS ' . $columns[$key]->getColumnName(); |
250 | 250 | else |
251 | - $result[] = 'NULL' . (is_string($key) ? (' AS ' . (string)$key) : ''); |
|
251 | + $result[] = 'NULL' . (is_string($key) ? (' AS ' . (string) $key) : ''); |
|
252 | 252 | continue; |
253 | 253 | } |
254 | 254 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | if($k) |
257 | 257 | $result[] = $value . ' AS ' . $columns[$key]->getColumnName(); |
258 | 258 | else |
259 | - $result[] = $value . (is_string($key) ? (' AS ' . (string)$key) : ''); |
|
259 | + $result[] = $value . (is_string($key) ? (' AS ' . (string) $key) : ''); |
|
260 | 260 | continue; |
261 | 261 | } |
262 | 262 | |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | if(!$v && !$k && is_int($key)) { |
289 | - $result[] = is_numeric($value) ? $value : $this->getDbConnection()->quoteString((string)$value); |
|
289 | + $result[] = is_numeric($value) ? $value : $this->getDbConnection()->quoteString((string) $value); |
|
290 | 290 | continue; |
291 | 291 | } |
292 | 292 | |
293 | - $result[] = (is_numeric($value) ? $value : $this->getDbConnection()->quoteString((string)$value)) . ' AS ' . $key; |
|
293 | + $result[] = (is_numeric($value) ? $value : $this->getDbConnection()->quoteString((string) $value)) . ' AS ' . $key; |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | public function createDeleteCommand($where, $parameters = []) |
351 | 351 | { |
352 | 352 | $table = $this->getTableInfo()->getTableFullName(); |
353 | - if (!empty($where)) |
|
353 | + if(!empty($where)) |
|
354 | 354 | $where = ' WHERE ' . $where; |
355 | 355 | $command = $this->createCommand("DELETE FROM {$table}" . $where); |
356 | 356 | $this->bindArrayValues($command, $parameters); |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | else |
391 | 391 | $fields = implode(', ', $this->getColumnBindings($data)); |
392 | 392 | |
393 | - if (!empty($where)) |
|
393 | + if(!empty($where)) |
|
394 | 394 | $where = ' WHERE ' . $where; |
395 | 395 | $command = $this->createCommand("UPDATE {$table} SET {$fields}" . $where); |
396 | 396 | $this->bindArrayValues($command, array_merge($data, $parameters)); |