@@ -233,8 +233,7 @@ |
||
233 | 233 | $link->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']); |
234 | 234 | $cell->getControls()->add($link); |
235 | 235 | $cell->registerObject('HyperLink', $link); |
236 | - } |
|
237 | - else |
|
236 | + } else |
|
238 | 237 | parent::initializeCell($cell, $columnIndex, $itemType); |
239 | 238 | } |
240 | 239 |
@@ -177,8 +177,7 @@ |
||
177 | 177 | { |
178 | 178 | $cultureInfo = CultureInfo::getInstance($culture); |
179 | 179 | return $cultureInfo->getDateTimeFormat(); |
180 | - } |
|
181 | - else |
|
180 | + } else |
|
182 | 181 | { |
183 | 182 | $cultureInfo = CultureInfo::getInvariantCulture(); |
184 | 183 | return $cultureInfo->getDateTimeFormat(); |
@@ -41,8 +41,7 @@ |
||
41 | 41 | $limitStr = ' LIMIT ' . $limit; |
42 | 42 | $offsetStr = $offset >= 0 ? ' OFFSET ' . $offset : ''; |
43 | 43 | return $sql . $limitStr . $offsetStr; |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | return $sql; |
47 | 46 | } |
48 | 47 | } |
@@ -418,8 +418,7 @@ |
||
418 | 418 | { |
419 | 419 | $useArgs = !is_array($parameters) && is_array($args); |
420 | 420 | return new TSqlCriteria($criteria, $useArgs ? $args : $parameters); |
421 | - } |
|
422 | - elseif($criteria instanceof TSqlCriteria) |
|
421 | + } elseif($criteria instanceof TSqlCriteria) |
|
423 | 422 | return $criteria; |
424 | 423 | else |
425 | 424 | throw new TDbException('dbtablegateway_invalid_criteria'); |
@@ -79,16 +79,14 @@ |
||
79 | 79 | throw new TActiveRecordException('ar_invalid_tablename_property', |
80 | 80 | get_class($record), self::TABLE_CONST); |
81 | 81 | return $value; |
82 | - } |
|
83 | - elseif ($class->hasMethod(self::TABLE_METHOD)) |
|
82 | + } elseif ($class->hasMethod(self::TABLE_METHOD)) |
|
84 | 83 | { |
85 | 84 | $value = $record->{self::TABLE_METHOD}(); |
86 | 85 | if(empty($value)) |
87 | 86 | throw new TActiveRecordException('ar_invalid_tablename_method', |
88 | 87 | get_class($record), self::TABLE_METHOD); |
89 | 88 | return $value; |
90 | - } |
|
91 | - else |
|
89 | + } else |
|
92 | 90 | return strtolower(get_class($record)); |
93 | 91 | } |
94 | 92 |
@@ -65,8 +65,7 @@ discard block |
||
65 | 65 | $object = $object[$prop]; |
66 | 66 | else |
67 | 67 | throw new TInvalidPropertyException('sqlmap_invalid_property', $path); |
68 | - } |
|
69 | - elseif(is_object($object)) |
|
68 | + } elseif(is_object($object)) |
|
70 | 69 | { |
71 | 70 | $getter = 'get' . $prop; |
72 | 71 | if(method_exists($object, $getter) && is_callable([$object, $getter])) |
@@ -77,8 +76,7 @@ discard block |
||
77 | 76 | $object = $object->{$prop}; |
78 | 77 | else |
79 | 78 | throw new TInvalidPropertyException('sqlmap_invalid_property', $path); |
80 | - } |
|
81 | - else |
|
79 | + } else |
|
82 | 80 | throw new TInvalidPropertyException('sqlmap_invalid_property', $path); |
83 | 81 | } |
84 | 82 | return $object; |
@@ -102,8 +100,7 @@ discard block |
||
102 | 100 | $object = $object[$prop]; |
103 | 101 | else |
104 | 102 | return false; |
105 | - } |
|
106 | - elseif(is_object($object)) |
|
103 | + } elseif(is_object($object)) |
|
107 | 104 | { |
108 | 105 | $getter = 'get' . $prop; |
109 | 106 | if(method_exists($object, $getter) && is_callable([$object, $getter])) |
@@ -114,8 +111,7 @@ discard block |
||
114 | 111 | $object = $object->{$prop}; |
115 | 112 | else |
116 | 113 | return false; |
117 | - } |
|
118 | - else |
|
114 | + } else |
|
119 | 115 | return false; |
120 | 116 | } |
121 | 117 | return true; |
@@ -140,16 +136,14 @@ discard block |
||
140 | 136 | if(is_array($object) || $object instanceof \ArrayAccess) |
141 | 137 | { |
142 | 138 | $object[$prop] = $value; |
143 | - } |
|
144 | - elseif(is_object($object)) |
|
139 | + } elseif(is_object($object)) |
|
145 | 140 | { |
146 | 141 | $setter = 'set' . $prop; |
147 | 142 | if (method_exists($object, $setter) && is_callable([$object, $setter])) |
148 | 143 | $object->{$setter}($value); |
149 | 144 | else |
150 | 145 | $object->{$prop} = $value; |
151 | - } |
|
152 | - else |
|
146 | + } else |
|
153 | 147 | throw new TInvalidPropertyException('sqlmap_invalid_property_type', $path); |
154 | 148 | } |
155 | 149 |
@@ -205,8 +205,7 @@ discard block |
||
205 | 205 | $this -> _createCheck = true; |
206 | 206 | $this -> getApplication() -> setGlobalState($key, time()); |
207 | 207 | } |
208 | - } |
|
209 | - catch(\Exception $e) |
|
208 | + } catch(\Exception $e) |
|
210 | 209 | { |
211 | 210 | // DB table not exists |
212 | 211 | if($this->_autoCreate) |
@@ -229,8 +228,7 @@ discard block |
||
229 | 228 | |
230 | 229 | $this -> _createCheck = true; |
231 | 230 | $this -> getApplication() -> setGlobalState($key, time()); |
232 | - } |
|
233 | - else |
|
231 | + } else |
|
234 | 232 | throw new TConfigurationException('db_cachetable_inexistent', $this->_cacheTable); |
235 | 233 | } |
236 | 234 | $this->_cacheInitialized = true; |
@@ -299,8 +297,7 @@ discard block |
||
299 | 297 | return $config->getDbConnection(); |
300 | 298 | else |
301 | 299 | throw new TConfigurationException('dbcache_connectionid_invalid', $this->_connID); |
302 | - } |
|
303 | - else |
|
300 | + } else |
|
304 | 301 | { |
305 | 302 | $db = new TDbConnection; |
306 | 303 | if($this->_connectionString !== '') |
@@ -310,8 +307,7 @@ discard block |
||
310 | 307 | $db->setUsername($this->_username); |
311 | 308 | if($this->_password !== '') |
312 | 309 | $db->setPassword($this->_password); |
313 | - } |
|
314 | - else |
|
310 | + } else |
|
315 | 311 | { |
316 | 312 | // default to SQLite3 database |
317 | 313 | $dbFile = $this->getApplication()->getRuntimePath() . '/sqlite3.cache'; |
@@ -468,8 +464,7 @@ discard block |
||
468 | 464 | $sql = 'SELECT value FROM ' . $this->_cacheTable . ' WHERE itemkey=\'' . $key . '\' AND (expire=0 OR expire>' . time() . ') ORDER BY expire DESC'; |
469 | 465 | $command = $this->getDbConnection()->createCommand($sql); |
470 | 466 | return unserialize($command->queryScalar()); |
471 | - } |
|
472 | - catch(\Exception $e) |
|
467 | + } catch(\Exception $e) |
|
473 | 468 | { |
474 | 469 | $this->initializeCache(true); |
475 | 470 | return unserialize($command->queryScalar()); |
@@ -512,16 +507,14 @@ discard block |
||
512 | 507 | $command->bindValue(':value', serialize($value), \PDO::PARAM_LOB); |
513 | 508 | $command->execute(); |
514 | 509 | return true; |
515 | - } |
|
516 | - catch(\Exception $e) |
|
510 | + } catch(\Exception $e) |
|
517 | 511 | { |
518 | 512 | try |
519 | 513 | { |
520 | 514 | $this->initializeCache(true); |
521 | 515 | $command->execute(); |
522 | 516 | return true; |
523 | - } |
|
524 | - catch(\Exception $e) |
|
517 | + } catch(\Exception $e) |
|
525 | 518 | { |
526 | 519 | return false; |
527 | 520 | } |
@@ -543,8 +536,7 @@ discard block |
||
543 | 536 | $command->bindValue(':key', $key, \PDO::PARAM_STR); |
544 | 537 | $command->execute(); |
545 | 538 | return true; |
546 | - } |
|
547 | - catch(\Exception $e) |
|
539 | + } catch(\Exception $e) |
|
548 | 540 | { |
549 | 541 | $this->initializeCache(true); |
550 | 542 | $command->execute(); |
@@ -563,16 +555,14 @@ discard block |
||
563 | 555 | { |
564 | 556 | $command = $this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable}"); |
565 | 557 | $command->execute(); |
566 | - } |
|
567 | - catch(\Exception $e) |
|
558 | + } catch(\Exception $e) |
|
568 | 559 | { |
569 | 560 | try |
570 | 561 | { |
571 | 562 | $this->initializeCache(true); |
572 | 563 | $command->execute(); |
573 | 564 | return true; |
574 | - } |
|
575 | - catch(\Exception $e) |
|
565 | + } catch(\Exception $e) |
|
576 | 566 | { |
577 | 567 | return false; |
578 | 568 | } |
@@ -168,8 +168,7 @@ |
||
168 | 168 | $server['Weight'], $server['Timeout'], $server['RetryInterval']) === false) |
169 | 169 | throw new TConfigurationException('memcache_connection_failed', $server['Host'], $server['Port']); |
170 | 170 | } |
171 | - } |
|
172 | - else |
|
171 | + } else |
|
173 | 172 | { |
174 | 173 | Prado::trace('Adding server ' . $this->_host, '\Prado\Caching\TMemCache'); |
175 | 174 | if($this->_cache->addServer($this->_host, $this->_port) === false) |
@@ -166,8 +166,7 @@ |
||
166 | 166 | { |
167 | 167 | if(($this->_recursiveLevel < 0 || $level < $this->_recursiveLevel) && $this->validateDirectory($path)) |
168 | 168 | $timestamps = array_merge($this->generateTimestamps($path, $level + 1)); |
169 | - } |
|
170 | - elseif($this->validateFile($path)) |
|
169 | + } elseif($this->validateFile($path)) |
|
171 | 170 | $timestamps[$path] = filemtime($path); |
172 | 171 | } |
173 | 172 | closedir($dir); |