@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | * @var array |
74 | 74 | */ |
75 | 75 | private static $_patternPresets = [ |
76 | - 'fulldate' => 'P','full' => 'P', |
|
77 | - 'longdate' => 'D','long' => 'd', |
|
78 | - 'mediumdate' => 'p','medium' => 'p', |
|
79 | - 'shortdate' => 'd','short' => 'd', |
|
76 | + 'fulldate' => 'P', 'full' => 'P', |
|
77 | + 'longdate' => 'D', 'long' => 'd', |
|
78 | + 'mediumdate' => 'p', 'medium' => 'p', |
|
79 | + 'shortdate' => 'd', 'short' => 'd', |
|
80 | 80 | 'fulltime' => 'Q', 'longtime' => 'T', |
81 | 81 | 'mediumtime' => 'q', 'shorttime' => 't']; |
82 | 82 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | //and let the DateFormat handle it. |
123 | 123 | if($pattern === null) |
124 | 124 | $pattern = $string; |
125 | - if (!is_array($pattern) && strlen($pattern) == 0) |
|
125 | + if(!is_array($pattern) && strlen($pattern) == 0) |
|
126 | 126 | $pattern = null; |
127 | 127 | return $pattern; |
128 | 128 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $this->_owner = $owner; |
47 | 47 | foreach($this->events() as $event => $handler) |
48 | - $owner->attachEventHandler($event, [$this,$handler]); |
|
48 | + $owner->attachEventHandler($event, [$this, $handler]); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | public function detach($owner) |
59 | 59 | { |
60 | 60 | foreach($this->events() as $event => $handler) |
61 | - $owner->detachEventHandler($event, [$this,$handler]); |
|
61 | + $owner->detachEventHandler($event, [$this, $handler]); |
|
62 | 62 | $this->_owner = null; |
63 | 63 | } |
64 | 64 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function addCall($method, $args) |
52 | 52 | { |
53 | - $this->add([$method,$args]); |
|
53 | + $this->add([$method, $args]); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | { |
97 | 97 | $args = func_get_args(); |
98 | 98 | if($this->getCount() === 0) |
99 | - return isset($args[0])?$args[0]:null; |
|
99 | + return isset($args[0]) ? $args[0] : null; |
|
100 | 100 | |
101 | 101 | if(!$this->_iterator) |
102 | 102 | { |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function __dycall($method, $args) |
145 | 145 | { |
146 | 146 | if($this->_method == $method) |
147 | - return call_user_func_array([$this,'call'], $args); |
|
147 | + return call_user_func_array([$this, 'call'], $args); |
|
148 | 148 | return null; |
149 | 149 | } |
150 | 150 | } |
151 | 151 | \ No newline at end of file |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | throw new TConfigurationException('logrouter_configfile_invalid', $this->_configFile); |
85 | 85 | } |
86 | 86 | $this->loadConfig($config); |
87 | - $this->getApplication()->attachEventHandler('OnEndRequest', [$this,'collectLogs']); |
|
87 | + $this->getApplication()->attachEventHandler('OnEndRequest', [$this, 'collectLogs']); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | foreach($config['routes'] as $route) |
102 | 102 | { |
103 | - $properties = isset($route['properties'])?$route['properties']:[]; |
|
103 | + $properties = isset($route['properties']) ? $route['properties'] : []; |
|
104 | 104 | if(!isset($route['class'])) |
105 | 105 | throw new TConfigurationException('logrouter_routeclass_required'); |
106 | 106 | $route = Prado::createComponent($route['class']); |
@@ -241,21 +241,21 @@ discard block |
||
241 | 241 | $day = null; |
242 | 242 | } |
243 | 243 | |
244 | - while ($i_format < $pattern_length) |
|
244 | + while($i_format < $pattern_length) |
|
245 | 245 | { |
246 | 246 | $c = $this->charAt($pattern, $i_format); |
247 | 247 | $token = ''; |
248 | - while ($this->charEqual($pattern, $i_format, $c) |
|
248 | + while($this->charEqual($pattern, $i_format, $c) |
|
249 | 249 | && ($i_format < $pattern_length)) |
250 | 250 | { |
251 | 251 | $token .= $this->charAt($pattern, $i_format++); |
252 | 252 | } |
253 | 253 | |
254 | - if ($token == 'yyyy' || $token == 'yy' || $token == 'y') |
|
254 | + if($token == 'yyyy' || $token == 'yy' || $token == 'y') |
|
255 | 255 | { |
256 | - if ($token == 'yyyy') { $x = 4;$y = 4; } |
|
257 | - if ($token == 'yy') { $x = 2;$y = 2; } |
|
258 | - if ($token == 'y') { $x = 2;$y = 4; } |
|
256 | + if($token == 'yyyy') { $x = 4; $y = 4; } |
|
257 | + if($token == 'yy') { $x = 2; $y = 2; } |
|
258 | + if($token == 'y') { $x = 2; $y = 4; } |
|
259 | 259 | $year = $this->getInteger($value, $i_val, $x, $y); |
260 | 260 | if($year === null) |
261 | 261 | return null; |
@@ -263,30 +263,30 @@ discard block |
||
263 | 263 | $i_val += strlen($year); |
264 | 264 | if(strlen($year) == 2) |
265 | 265 | { |
266 | - $iYear = (int)$year; |
|
266 | + $iYear = (int) $year; |
|
267 | 267 | if($iYear > 70) |
268 | 268 | $year = $iYear + 1900; |
269 | 269 | else |
270 | 270 | $year = $iYear + 2000; |
271 | 271 | } |
272 | - $year = (int)$year; |
|
272 | + $year = (int) $year; |
|
273 | 273 | } |
274 | 274 | elseif($token == 'MM' || $token == 'M') |
275 | 275 | { |
276 | - $month = $this->getInteger($value,$i_val, |
|
276 | + $month = $this->getInteger($value, $i_val, |
|
277 | 277 | $this->length($token), 2); |
278 | - $iMonth = (int)$month; |
|
278 | + $iMonth = (int) $month; |
|
279 | 279 | if($month === null || $iMonth < 1 || $iMonth > 12) |
280 | 280 | return null; |
281 | 281 | //throw new TInvalidDataValueException('Invalid month', $value); |
282 | 282 | $i_val += strlen($month); |
283 | 283 | $month = $iMonth; |
284 | 284 | } |
285 | - elseif ($token == 'dd' || $token == 'd') |
|
285 | + elseif($token == 'dd' || $token == 'd') |
|
286 | 286 | { |
287 | - $day = $this->getInteger($value,$i_val, |
|
287 | + $day = $this->getInteger($value, $i_val, |
|
288 | 288 | $this->length($token), 2); |
289 | - $iDay = (int)$day; |
|
289 | + $iDay = (int) $day; |
|
290 | 290 | if($day === null || $iDay < 1 || $iDay > 31) |
291 | 291 | return null; |
292 | 292 | //throw new TInvalidDataValueException('Invalid day', $value); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $i_val += $this->length($token); |
303 | 303 | } |
304 | 304 | } |
305 | - if ($i_val != $this->length($value)) |
|
305 | + if($i_val != $this->length($value)) |
|
306 | 306 | return null; |
307 | 307 | //throw new TInvalidDataValueException("Pattern '{$this->pattern}' mismatch", $value); |
308 | 308 | if(!$defaultToCurrentTime && ($month === null || $day === null || $year === null)) |
@@ -312,8 +312,8 @@ discard block |
||
312 | 312 | if(empty($year)) { |
313 | 313 | $year = date('Y'); |
314 | 314 | } |
315 | - $day = (int)$day <= 0 ? 1 : (int)$day; |
|
316 | - $month = (int)$month <= 0 ? 1 : (int)$month; |
|
315 | + $day = (int) $day <= 0 ? 1 : (int) $day; |
|
316 | + $month = (int) $month <= 0 ? 1 : (int) $month; |
|
317 | 317 | |
318 | 318 | $s = new \DateTime; |
319 | 319 | $s->setDate($year, $month, $day); |
@@ -366,12 +366,12 @@ discard block |
||
366 | 366 | private function getInteger($str, $i, $minlength, $maxlength) |
367 | 367 | { |
368 | 368 | //match for digits backwards |
369 | - for ($x = $maxlength; $x >= $minlength; $x--) |
|
369 | + for($x = $maxlength; $x >= $minlength; $x--) |
|
370 | 370 | { |
371 | 371 | $token = $this->substring($str, $i, $x); |
372 | - if ($this->length($token) < $minlength) |
|
372 | + if($this->length($token) < $minlength) |
|
373 | 373 | return null; |
374 | - if (preg_match('/^\d+$/', $token)) |
|
374 | + if(preg_match('/^\d+$/', $token)) |
|
375 | 375 | return $token; |
376 | 376 | } |
377 | 377 | return null; |
@@ -39,7 +39,7 @@ |
||
39 | 39 | */ |
40 | 40 | public function getPHPType() |
41 | 41 | { |
42 | - $dbtype = trim(str_replace(['unsigned', 'zerofill'], ['','',], strtolower($this->getDbType()))); |
|
42 | + $dbtype = trim(str_replace(['unsigned', 'zerofill'], ['', '', ], strtolower($this->getDbType()))); |
|
43 | 43 | if($dbtype === 'tinyint' && $this->getColumnSize() === 1) |
44 | 44 | return 'boolean'; |
45 | 45 | foreach(self::$types as $type => $dbtypes) |
@@ -28,7 +28,7 @@ |
||
28 | 28 | class TOracleTableColumn extends TDbTableColumn |
29 | 29 | { |
30 | 30 | private static $types = [ |
31 | - 'numeric' => [ 'numeric' ] |
|
31 | + 'numeric' => ['numeric'] |
|
32 | 32 | // 'integer' => array('bit', 'bit varying', 'real', 'serial', 'int', 'integer'), |
33 | 33 | // 'boolean' => array('boolean'), |
34 | 34 | // 'float' => array('bigint', 'bigserial', 'double precision', 'money', 'numeric') |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | static $stack = []; |
80 | 80 | |
81 | - $results = call_user_func_array([$this->getSourceRecord(),$method], $args); |
|
81 | + $results = call_user_func_array([$this->getSourceRecord(), $method], $args); |
|
82 | 82 | $validArray = is_array($results) && count($results) > 0; |
83 | 83 | if($validArray || $results instanceof \ArrayAccess || $results instanceof TActiveRecord) |
84 | 84 | { |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | { |
173 | 173 | $ids = []; |
174 | 174 | foreach($properties as $property) |
175 | - $ids[] = is_object($obj) ? (string)$obj->getColumnValue($property) : (string)$obj[$property]; |
|
175 | + $ids[] = is_object($obj) ? (string) $obj->getColumnValue($property) : (string) $obj[$property]; |
|
176 | 176 | return serialize($ids); |
177 | 177 | } |
178 | 178 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | { |
235 | 235 | if(is_array($results) || $results instanceof \ArrayAccess) |
236 | 236 | { |
237 | - for($i = 0,$k = count($results);$i < $k;$i++) |
|
237 | + for($i = 0, $k = count($results); $i < $k; $i++) |
|
238 | 238 | $this->setObjectProperty($results[$i], $properties, $collections); |
239 | 239 | } |
240 | 240 | else |
@@ -109,7 +109,7 @@ |
||
109 | 109 | { |
110 | 110 | $source = $this->getSourceRecord(); |
111 | 111 | $fkeys = $this->findForeignKeys($fkObjects[0], $source); |
112 | - for($i = 0;$i < $total;$i++) |
|
112 | + for($i = 0; $i < $total; $i++) |
|
113 | 113 | { |
114 | 114 | foreach($fkeys as $fKey => $srcKey) |
115 | 115 | $fkObjects[$i]->setColumnValue($fKey, $source->getColumnValue($srcKey)); |