Completed
Push — php-cs-fixer ( b6f93e...b9836a )
by Fabio
07:15
created
framework/TComponentReflection.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 class TComponentReflection extends \Prado\TComponent
37 37
 {
38 38
 	private $_className;
39
-	private $_properties = [];
40
-	private $_events = [];
41
-	private $_methods = [];
39
+	private $_properties=[];
40
+	private $_events=[];
41
+	private $_methods=[];
42 42
 
43 43
 	/**
44 44
 	 * Constructor.
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	public function __construct($component)
49 49
 	{
50 50
 		if(is_string($component) && class_exists($component, false))
51
-			$this->_className = $component;
51
+			$this->_className=$component;
52 52
 		elseif(is_object($component))
53
-			$this->_className = get_class($component);
53
+			$this->_className=get_class($component);
54 54
 		else
55 55
 			throw new TInvalidDataTypeException('componentreflection_class_invalid');
56 56
 		$this->reflect();
@@ -58,74 +58,74 @@  discard block
 block discarded – undo
58 58
 
59 59
 	private function isPropertyMethod($method)
60 60
 	{
61
-		$methodName = $method->getName();
62
-		return $method->getNumberOfRequiredParameters() === 0
63
-				&& strncasecmp($methodName, 'get', 3) === 0
61
+		$methodName=$method->getName();
62
+		return $method->getNumberOfRequiredParameters()===0
63
+				&& strncasecmp($methodName, 'get', 3)===0
64 64
 				&& isset($methodName[3]);
65 65
 	}
66 66
 
67 67
 	private function isEventMethod($method)
68 68
 	{
69
-		$methodName = $method->getName();
70
-		return strncasecmp($methodName, 'on', 2) === 0
69
+		$methodName=$method->getName();
70
+		return strncasecmp($methodName, 'on', 2)===0
71 71
 				&& isset($methodName[2]);
72 72
 	}
73 73
 
74 74
 	private function reflect()
75 75
 	{
76
-		$class = new \ReflectionClass($this->_className);
77
-		$properties = [];
78
-		$events = [];
79
-		$methods = [];
80
-		$isComponent = is_subclass_of($this->_className, 'TComponent') || strcasecmp($this->_className, 'TComponent') === 0;
76
+		$class=new \ReflectionClass($this->_className);
77
+		$properties=[];
78
+		$events=[];
79
+		$methods=[];
80
+		$isComponent=is_subclass_of($this->_className, 'TComponent') || strcasecmp($this->_className, 'TComponent')===0;
81 81
 		foreach($class->getMethods() as $method)
82 82
 		{
83 83
 			if($method->isPublic() || $method->isProtected())
84 84
 			{
85
-				$methodName = $method->getName();
85
+				$methodName=$method->getName();
86 86
 				if(!$method->isStatic() && $isComponent)
87 87
 				{
88 88
 					if($this->isPropertyMethod($method))
89
-						$properties[substr($methodName, 3)] = $method;
89
+						$properties[substr($methodName, 3)]=$method;
90 90
 					elseif($this->isEventMethod($method))
91 91
 					{
92
-						$methodName[0] = 'O';
93
-						$events[$methodName] = $method;
92
+						$methodName[0]='O';
93
+						$events[$methodName]=$method;
94 94
 					}
95 95
 				}
96
-				if(strncmp($methodName, '__', 2) !== 0)
97
-					$methods[$methodName] = $method;
96
+				if(strncmp($methodName, '__', 2)!==0)
97
+					$methods[$methodName]=$method;
98 98
 			}
99 99
 		}
100
-		$reserved = [];
100
+		$reserved=[];
101 101
 		ksort($properties);
102 102
 		foreach($properties as $name => $method)
103 103
 		{
104
-			$this->_properties[$name] = [
104
+			$this->_properties[$name]=[
105 105
 				'type' => $this->determinePropertyType($method),
106
-				'readonly' => !$class->hasMethod('set' . $name),
106
+				'readonly' => !$class->hasMethod('set'.$name),
107 107
 				'protected' => $method->isProtected(),
108 108
 				'class' => $method->getDeclaringClass()->getName(),
109 109
 				'comments' => $method->getDocComment()
110 110
 			];
111
-			$reserved['get' . strtolower($name)] = 1;
112
-			$reserved['set' . strtolower($name)] = 1;
111
+			$reserved['get'.strtolower($name)]=1;
112
+			$reserved['set'.strtolower($name)]=1;
113 113
 		}
114 114
 		ksort($events);
115 115
 		foreach($events as $name => $method)
116 116
 		{
117
-			$this->_events[$name] = [
117
+			$this->_events[$name]=[
118 118
 				'class' => $method->getDeclaringClass()->getName(),
119 119
 				'protected' => $method->isProtected(),
120 120
 				'comments' => $method->getDocComment()
121 121
 			];
122
-			$reserved[strtolower($name)] = 1;
122
+			$reserved[strtolower($name)]=1;
123 123
 		}
124 124
 		ksort($methods);
125 125
 		foreach($methods as $name => $method)
126 126
 		{
127 127
 			if(!isset($reserved[strtolower($name)]))
128
-				$this->_methods[$name] = [
128
+				$this->_methods[$name]=[
129 129
 					'class' => $method->getDeclaringClass()->getName(),
130 130
 					'protected' => $method->isProtected(),
131 131
 					'static' => $method->isStatic(),
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	protected function determinePropertyType($method)
144 144
 	{
145
-		$comment = $method->getDocComment();
145
+		$comment=$method->getDocComment();
146 146
 		if(preg_match('/@return\\s+(.*?)\\s+/', $comment, $matches))
147 147
 			return $matches[1];
148 148
 		else
Please login to merge, or discard this patch.
framework/Caching/TFileCacheDependency.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function setFileName($value)
52 52
 	{
53
-		$this->_fileName = $value;
54
-		$this->_timestamp = @filemtime($value);
53
+		$this->_fileName=$value;
54
+		$this->_timestamp=@filemtime($value);
55 55
 	}
56 56
 
57 57
 	/**
@@ -69,6 +69,6 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public function getHasChanged()
71 71
 	{
72
-		return @filemtime($this->_fileName) !== $this->_timestamp;
72
+		return @filemtime($this->_fileName)!==$this->_timestamp;
73 73
 	}
74 74
 }
75 75
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Caching/TDbCache.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	/**
96 96
 	 * @var string the ID of TDataSourceConfig module
97 97
 	 */
98
-	private $_connID = '';
98
+	private $_connID='';
99 99
 	/**
100 100
 	 * @var TDbConnection the DB connection instance
101 101
 	 */
@@ -103,26 +103,26 @@  discard block
 block discarded – undo
103 103
 	/**
104 104
 	 * @var string name of the DB cache table
105 105
 	 */
106
-	private $_cacheTable = 'pradocache';
106
+	private $_cacheTable='pradocache';
107 107
 	/**
108 108
 	 * @var integer Interval expired items will be removed from cache
109 109
 	 */
110
-	private $_flushInterval = 60;
110
+	private $_flushInterval=60;
111 111
 	/**
112 112
 	 * @var boolean
113 113
 	 */
114
-	private $_cacheInitialized = false;
114
+	private $_cacheInitialized=false;
115 115
 	/**
116 116
 	 * @var boolean
117 117
 	 */
118
-	private $_createCheck = false;
118
+	private $_createCheck=false;
119 119
 	/**
120 120
 	 * @var boolean whether the cache DB table should be created automatically
121 121
 	 */
122
-	private $_autoCreate = true;
123
-	private $_username = '';
124
-	private $_password = '';
125
-	private $_connectionString = '';
122
+	private $_autoCreate=true;
123
+	private $_username='';
124
+	private $_password='';
125
+	private $_connectionString='';
126 126
 
127 127
 	/**
128 128
 	 * Destructor.
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function __destruct()
132 132
 	{
133
-		if($this->_db !== null)
133
+		if($this->_db!==null)
134 134
 			$this->_db->setActive(false);
135 135
 	}
136 136
 
@@ -183,26 +183,26 @@  discard block
 block discarded – undo
183 183
 	 * @throws TConfigurationException if any error happens during creating database or cache table.
184 184
 	 * @since 3.1.5
185 185
 	 */
186
-	protected function initializeCache($force = false)
186
+	protected function initializeCache($force=false)
187 187
 	{
188 188
 		if($this->_cacheInitialized && !$force) return;
189
-		$db = $this->getDbConnection();
189
+		$db=$this->getDbConnection();
190 190
 		try
191 191
 		{
192
-			$key = 'TDbCache:' . $this->_cacheTable . ':created';
192
+			$key='TDbCache:'.$this->_cacheTable.':created';
193 193
 			if($force)
194
-				$this -> _createCheck = false;
194
+				$this -> _createCheck=false;
195 195
 			else
196
-				$this -> _createCheck = $this -> getApplication() -> getGlobalState($key, 0);
196
+				$this -> _createCheck=$this -> getApplication() -> getGlobalState($key, 0);
197 197
 
198 198
 			if($this->_autoCreate && !$this -> _createCheck) {
199 199
 
200
-				Prado::trace(($force ? 'Force initializing: ' : 'Initializing: ') . $this -> id . ', ' . $this->_cacheTable, '\Prado\Caching\TDbCache');
200
+				Prado::trace(($force ? 'Force initializing: ' : 'Initializing: ').$this -> id.', '.$this->_cacheTable, '\Prado\Caching\TDbCache');
201 201
 
202
-				$sql = 'SELECT 1 FROM ' . $this->_cacheTable . ' WHERE 0=1';
202
+				$sql='SELECT 1 FROM '.$this->_cacheTable.' WHERE 0=1';
203 203
 				$db->createCommand($sql)->queryScalar();
204 204
 
205
-				$this -> _createCheck = true;
205
+				$this -> _createCheck=true;
206 206
 				$this -> getApplication() -> setGlobalState($key, time());
207 207
 			}
208 208
 		}
@@ -211,29 +211,29 @@  discard block
 block discarded – undo
211 211
 			// DB table not exists
212 212
 			if($this->_autoCreate)
213 213
 			{
214
-				Prado::trace('Autocreate: ' . $this->_cacheTable, '\Prado\Caching\TDbCache');
214
+				Prado::trace('Autocreate: '.$this->_cacheTable, '\Prado\Caching\TDbCache');
215 215
 
216
-				$driver = $db->getDriverName();
217
-				if($driver === 'mysql')
218
-					$blob = 'LONGBLOB';
219
-				elseif($driver === 'pgsql')
220
-					$blob = 'BYTEA';
216
+				$driver=$db->getDriverName();
217
+				if($driver==='mysql')
218
+					$blob='LONGBLOB';
219
+				elseif($driver==='pgsql')
220
+					$blob='BYTEA';
221 221
 				else
222
-					$blob = 'BLOB';
222
+					$blob='BLOB';
223 223
 
224
-				$sql = 'CREATE TABLE ' . $this->_cacheTable . " (itemkey CHAR(128) PRIMARY KEY, value $blob, expire INTEGER)";
224
+				$sql='CREATE TABLE '.$this->_cacheTable." (itemkey CHAR(128) PRIMARY KEY, value $blob, expire INTEGER)";
225 225
 				$db->createCommand($sql)->execute();
226 226
 
227
-				$sql = 'CREATE INDEX IX_expire ON ' . $this->_cacheTable . ' (expire)';
227
+				$sql='CREATE INDEX IX_expire ON '.$this->_cacheTable.' (expire)';
228 228
 				$db->createCommand($sql)->execute();
229 229
 
230
-				$this -> _createCheck = true;
230
+				$this -> _createCheck=true;
231 231
 				$this -> getApplication() -> setGlobalState($key, time());
232 232
 			}
233 233
 			else
234 234
 				throw new TConfigurationException('db_cachetable_inexistent', $this->_cacheTable);
235 235
 		}
236
-		$this->_cacheInitialized = true;
236
+		$this->_cacheInitialized=true;
237 237
 	}
238 238
 
239 239
 	/**
@@ -242,20 +242,20 @@  discard block
 block discarded – undo
242 242
 	 * @return void
243 243
 	 * @since 3.1.5
244 244
 	 */
245
-	public function flushCacheExpired($force = false)
245
+	public function flushCacheExpired($force=false)
246 246
 	{
247
-		$interval = $this -> getFlushInterval();
248
-		if(!$force && $interval === 0) return;
247
+		$interval=$this -> getFlushInterval();
248
+		if(!$force && $interval===0) return;
249 249
 
250
-		$key = 'TDbCache:' . $this->_cacheTable . ':flushed';
251
-		$now = time();
252
-		$next = $interval + (integer)$this -> getApplication() -> getGlobalState($key, 0);
250
+		$key='TDbCache:'.$this->_cacheTable.':flushed';
251
+		$now=time();
252
+		$next=$interval + (integer) $this -> getApplication() -> getGlobalState($key, 0);
253 253
 
254 254
 		if($force || $next <= $now)
255 255
 		{
256 256
 			if(!$this->_cacheInitialized) $this->initializeCache();
257
-			Prado::trace(($force ? 'Force flush of expired items: ' : 'Flush expired items: ') . $this -> id . ', ' . $this->_cacheTable, '\Prado\Caching\TDbCache');
258
-			$sql = 'DELETE FROM ' . $this->_cacheTable . ' WHERE expire<>0 AND expire<' . $now;
257
+			Prado::trace(($force ? 'Force flush of expired items: ' : 'Flush expired items: ').$this -> id.', '.$this->_cacheTable, '\Prado\Caching\TDbCache');
258
+			$sql='DELETE FROM '.$this->_cacheTable.' WHERE expire<>0 AND expire<'.$now;
259 259
 			$this->getDbConnection()->createCommand($sql)->execute();
260 260
 			$this -> getApplication() -> setGlobalState($key, $now);
261 261
 		}
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	public function setFlushInterval($value)
283 283
 	{
284
-		$this->_flushInterval = (integer) $value;
284
+		$this->_flushInterval=(integer) $value;
285 285
 	}
286 286
 
287 287
 	/**
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
 	 */
293 293
 	protected function createDbConnection()
294 294
 	{
295
-		if($this->_connID !== '')
295
+		if($this->_connID!=='')
296 296
 		{
297
-			$config = $this->getApplication()->getModule($this->_connID);
297
+			$config=$this->getApplication()->getModule($this->_connID);
298 298
 			if($config instanceof TDataSourceConfig)
299 299
 				return $config->getDbConnection();
300 300
 			else
@@ -302,20 +302,20 @@  discard block
 block discarded – undo
302 302
 		}
303 303
 		else
304 304
 		{
305
-			$db = new TDbConnection;
306
-			if($this->_connectionString !== '')
305
+			$db=new TDbConnection;
306
+			if($this->_connectionString!=='')
307 307
 			{
308 308
 				$db->setConnectionString($this->_connectionString);
309
-				if($this->_username !== '')
309
+				if($this->_username!=='')
310 310
 					$db->setUsername($this->_username);
311
-				if($this->_password !== '')
311
+				if($this->_password!=='')
312 312
 					$db->setPassword($this->_password);
313 313
 			}
314 314
 			else
315 315
 			{
316 316
 				// default to SQLite3 database
317
-				$dbFile = $this->getApplication()->getRuntimePath() . '/sqlite3.cache';
318
-				$db->setConnectionString('sqlite:' . $dbFile);
317
+				$dbFile=$this->getApplication()->getRuntimePath().'/sqlite3.cache';
318
+				$db->setConnectionString('sqlite:'.$dbFile);
319 319
 			}
320 320
 			return $db;
321 321
 		}
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 	 */
327 327
 	public function getDbConnection()
328 328
 	{
329
-		if($this->_db === null)
330
-			$this->_db = $this->createDbConnection();
329
+		if($this->_db===null)
330
+			$this->_db=$this->createDbConnection();
331 331
 
332 332
 		$this->_db->setActive(true);
333 333
 		return $this->_db;
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 	 */
353 353
 	public function setConnectionID($value)
354 354
 	{
355
-		$this->_connID = $value;
355
+		$this->_connID=$value;
356 356
 	}
357 357
 
358 358
 	/**
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 	 */
370 370
 	public function setConnectionString($value)
371 371
 	{
372
-		$this->_connectionString = $value;
372
+		$this->_connectionString=$value;
373 373
 	}
374 374
 
375 375
 	/**
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 	 */
386 386
 	public function setUsername($value)
387 387
 	{
388
-		$this->_username = $value;
388
+		$this->_username=$value;
389 389
 	}
390 390
 
391 391
 	/**
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 	 */
402 402
 	public function setPassword($value)
403 403
 	{
404
-		$this->_password = $value;
404
+		$this->_password=$value;
405 405
 	}
406 406
 
407 407
 	/**
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 */
435 435
 	public function setCacheTableName($value)
436 436
 	{
437
-		$this->_cacheTable = $value;
437
+		$this->_cacheTable=$value;
438 438
 	}
439 439
 
440 440
 	/**
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	 */
453 453
 	public function setAutoCreateCacheTable($value)
454 454
 	{
455
-		$this->_autoCreate = TPropertyValue::ensureBoolean($value);
455
+		$this->_autoCreate=TPropertyValue::ensureBoolean($value);
456 456
 	}
457 457
 
458 458
 	/**
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
 	{
466 466
 		if(!$this->_cacheInitialized) $this->initializeCache();
467 467
 		try {
468
-			$sql = 'SELECT value FROM ' . $this->_cacheTable . ' WHERE itemkey=\'' . $key . '\' AND (expire=0 OR expire>' . time() . ') ORDER BY expire DESC';
469
-			$command = $this->getDbConnection()->createCommand($sql);
468
+			$sql='SELECT value FROM '.$this->_cacheTable.' WHERE itemkey=\''.$key.'\' AND (expire=0 OR expire>'.time().') ORDER BY expire DESC';
469
+			$command=$this->getDbConnection()->createCommand($sql);
470 470
 			return unserialize($command->queryScalar());
471 471
 		}
472 472
 		catch(\Exception $e)
@@ -503,11 +503,11 @@  discard block
 block discarded – undo
503 503
 	protected function addValue($key, $value, $expire)
504 504
 	{
505 505
 		if(!$this->_cacheInitialized) $this->initializeCache();
506
-		$expire = ($expire <= 0)?0:time() + $expire;
507
-		$sql = "INSERT INTO {$this->_cacheTable} (itemkey,value,expire) VALUES(:key,:value,$expire)";
506
+		$expire=($expire <= 0) ? 0 : time() + $expire;
507
+		$sql="INSERT INTO {$this->_cacheTable} (itemkey,value,expire) VALUES(:key,:value,$expire)";
508 508
 		try
509 509
 		{
510
-			$command = $this->getDbConnection()->createCommand($sql);
510
+			$command=$this->getDbConnection()->createCommand($sql);
511 511
 			$command->bindValue(':key', $key, \PDO::PARAM_STR);
512 512
 			$command->bindValue(':value', serialize($value), \PDO::PARAM_LOB);
513 513
 			$command->execute();
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 		if(!$this->_cacheInitialized) $this->initializeCache();
540 540
 		try
541 541
 		{
542
-			$command = $this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable} WHERE itemkey=:key");
542
+			$command=$this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable} WHERE itemkey=:key");
543 543
 			$command->bindValue(':key', $key, \PDO::PARAM_STR);
544 544
 			$command->execute();
545 545
 			return true;
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 		if(!$this->_cacheInitialized) $this->initializeCache();
562 562
 		try
563 563
 		{
564
-			$command = $this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable}");
564
+			$command=$this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable}");
565 565
 			$command->execute();
566 566
 		}
567 567
 		catch(\Exception $e)
Please login to merge, or discard this patch.
framework/Caching/ICache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 * @param ICacheDependency dependency of the cached item. If the dependency changes, the item is labelled invalid.
40 40
 	 * @return boolean true if the value is successfully stored into cache, false otherwise
41 41
 	 */
42
-	public function set($id, $value, $expire = 0, $dependency = null);
42
+	public function set($id, $value, $expire=0, $dependency=null);
43 43
 	/**
44 44
 	 * Stores a value identified by a key into cache if the cache does not contain this key.
45 45
 	 * Nothing will be done if the cache already contains the key.
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @param ICacheDependency dependency of the cached item. If the dependency changes, the item is labelled invalid.
50 50
 	 * @return boolean true if the value is successfully stored into cache, false otherwise
51 51
 	 */
52
-	public function add($id, $value, $expire = 0, $dependency = null);
52
+	public function add($id, $value, $expire=0, $dependency=null);
53 53
 	/**
54 54
 	 * Deletes a value with the specified key from cache
55 55
 	 * @param string the key of the value to be deleted
Please login to merge, or discard this patch.
framework/Caching/TMemCache.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	/**
93 93
 	 * @var boolean if the module is initialized
94 94
 	 */
95
-	private $_initialized = false;
95
+	private $_initialized=false;
96 96
 	/**
97 97
 	 * @var Memcache the Memcache instance
98 98
 	 */
@@ -100,23 +100,23 @@  discard block
 block discarded – undo
100 100
 	/**
101 101
 	 * @var string host name of the memcache server
102 102
 	 */
103
-	private $_host = 'localhost';
103
+	private $_host='localhost';
104 104
 	/**
105 105
 	 * @var integer the port number of the memcache server
106 106
 	 */
107
-	private $_port = 11211;
107
+	private $_port=11211;
108 108
 
109
-	private $_timeout = 360;
109
+	private $_timeout=360;
110 110
 
111 111
 	/**
112 112
 	 * @var integer Controls the minimum value length before attempting to compress automatically.
113 113
 	 */
114
-	private $_threshold = 0;
114
+	private $_threshold=0;
115 115
 
116 116
 	/**
117 117
 	 * @var float Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings.
118 118
 	 */
119
-	private $_minSavings = 0.0;
119
+	private $_minSavings=0.0;
120 120
 
121 121
 	/**
122 122
 	 * @var boolean whether to use memcached or memcache as the underlying caching extension.
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 	 * If false {@link http://pecl.php.net/package/memcache memcache}. will be used.
125 125
 	 * Defaults to false.
126 126
 	 */
127
-	private $_useMemcached = false;
127
+	private $_useMemcached=false;
128 128
 	
129 129
 	/**
130 130
 	 * @var array list of servers available
131 131
 	 */
132
-	private $_servers = [];
132
+	private $_servers=[];
133 133
 
134 134
 	/**
135 135
 	 * Destructor.
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	public function __destruct()
139 139
 	{
140
-		if($this->_cache !== null && !$this->_useMemcached)
140
+		if($this->_cache!==null && !$this->_useMemcached)
141 141
 			$this->_cache->close();
142 142
 	}
143 143
 
@@ -157,27 +157,27 @@  discard block
 block discarded – undo
157 157
 		if(!extension_loaded('memcached') && $this->_useMemcached)
158 158
 			throw new TConfigurationException('memcached_extension_required');
159 159
 		
160
-		$this->_cache = $this->_useMemcached ? new Memcached : new Memcache;
160
+		$this->_cache=$this->_useMemcached ? new Memcached : new Memcache;
161 161
 		$this->loadConfig($config);
162 162
 		if(count($this->_servers))
163 163
 		{
164 164
 			foreach($this->_servers as $server)
165 165
 			{
166
-				Prado::trace('Adding server ' . $server['Host'] . ' from serverlist', '\Prado\Caching\TMemCache');
167
-				if($this->_cache->addServer($server['Host'],$server['Port'],$server['Persistent'],
168
-					$server['Weight'], $server['Timeout'], $server['RetryInterval']) === false)
166
+				Prado::trace('Adding server '.$server['Host'].' from serverlist', '\Prado\Caching\TMemCache');
167
+				if($this->_cache->addServer($server['Host'], $server['Port'], $server['Persistent'],
168
+					$server['Weight'], $server['Timeout'], $server['RetryInterval'])===false)
169 169
 					throw new TConfigurationException('memcache_connection_failed', $server['Host'], $server['Port']);
170 170
 			}
171 171
 		}
172 172
 		else
173 173
 		{
174
-			Prado::trace('Adding server ' . $this->_host, '\Prado\Caching\TMemCache');
175
-			if($this->_cache->addServer($this->_host, $this->_port) === false)
174
+			Prado::trace('Adding server '.$this->_host, '\Prado\Caching\TMemCache');
175
+			if($this->_cache->addServer($this->_host, $this->_port)===false)
176 176
 				throw new TConfigurationException('memcache_connection_failed', $this->_host, $this->_port);
177 177
 		}
178
-		if($this->_threshold !== 0)
178
+		if($this->_threshold!==0)
179 179
 			$this->_cache->setCompressThreshold($this->_threshold, $this->_minSavings);
180
-		$this->_initialized = true;
180
+		$this->_initialized=true;
181 181
 		parent::init($config);
182 182
 	}
183 183
 
@@ -192,29 +192,29 @@  discard block
 block discarded – undo
192 192
 		{
193 193
 			foreach($xml->getElementsByTagName('server') as $serverConfig)
194 194
 			{
195
-				$properties = $serverConfig->getAttributes();
196
-				if(($host = $properties->remove('Host')) === null)
195
+				$properties=$serverConfig->getAttributes();
196
+				if(($host=$properties->remove('Host'))===null)
197 197
 					throw new TConfigurationException('memcache_serverhost_required');
198
-				if(($port = $properties->remove('Port')) === null)
198
+				if(($port=$properties->remove('Port'))===null)
199 199
 					throw new TConfigurationException('memcache_serverport_required');
200 200
 				if(!is_numeric($port))
201 201
 					throw new TConfigurationException('memcache_serverport_invalid');
202
-				$server = ['Host' => $host,'Port' => $port,'Weight' => 1,'Timeout' => 1800,'RetryInterval' => 15,'Persistent' => true];
203
-				$checks = [
202
+				$server=['Host' => $host, 'Port' => $port, 'Weight' => 1, 'Timeout' => 1800, 'RetryInterval' => 15, 'Persistent' => true];
203
+				$checks=[
204 204
 					'Weight' => 'memcache_serverweight_invalid',
205 205
 					'Timeout' => 'memcache_servertimeout_invalid',
206 206
 					'RetryInterval' => 'memcach_serverretryinterval_invalid'
207 207
 				];
208 208
 				foreach($checks as $property => $exception)
209 209
 				{
210
-					$value = $properties->remove($property);
211
-					if($value !== null && is_numeric($value))
212
-						$server[$property] = $value;
213
-					elseif($value !== null)
210
+					$value=$properties->remove($property);
211
+					if($value!==null && is_numeric($value))
212
+						$server[$property]=$value;
213
+					elseif($value!==null)
214 214
 						throw new TConfigurationException($exception);
215 215
 				}
216
-				$server['Persistent'] = TPropertyValue::ensureBoolean($properties->remove('Persistent'));
217
-				$this->_servers[] = $server;
216
+				$server['Persistent']=TPropertyValue::ensureBoolean($properties->remove('Persistent'));
217
+				$this->_servers[]=$server;
218 218
 			}
219 219
 		}
220 220
 	}
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		if($this->_initialized)
237 237
 			throw new TInvalidOperationException('memcache_host_unchangeable');
238 238
 		else
239
-			$this->_host = $value;
239
+			$this->_host=$value;
240 240
 	}
241 241
 
242 242
 	/**
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 		if($this->_initialized)
257 257
 			throw new TInvalidOperationException('memcache_port_unchangeable');
258 258
 		else
259
-			$this->_port = TPropertyValue::ensureInteger($value);
259
+			$this->_port=TPropertyValue::ensureInteger($value);
260 260
 	}
261 261
 	
262 262
 	/**
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		if($this->_initialized)
277 277
 			throw new TInvalidOperationException('memcache_host_unchangeable');
278 278
 		else
279
-			$this->_useMemcached = $value;
279
+			$this->_useMemcached=$value;
280 280
 	}
281 281
 	
282 282
 	/**
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 		if($this->_initialized)
297 297
 			throw new TInvalidOperationException('memcache_threshold_unchangeable');
298 298
 		else
299
-			$this->_threshold = TPropertyValue::ensureInteger($value);
299
+			$this->_threshold=TPropertyValue::ensureInteger($value);
300 300
 	}
301 301
 
302 302
 	/**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		if($this->_initialized)
317 317
 			throw new TInvalidOperationException('memcache_min_savings_unchangeable');
318 318
 		else
319
-			$this->_minSavings = TPropertyValue::ensureFloat($value);
319
+			$this->_minSavings=TPropertyValue::ensureFloat($value);
320 320
 	}
321 321
 
322 322
 	/**
Please login to merge, or discard this patch.
framework/Caching/TApplicationStateCacheDependency.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,6 +39,6 @@
 block discarded – undo
39 39
 	 */
40 40
 	public function getHasChanged()
41 41
 	{
42
-		return Prado::getApplication()->getMode() !== TApplicationMode::Performance;
42
+		return Prado::getApplication()->getMode()!==TApplicationMode::Performance;
43 43
 	}
44 44
 }
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Caching/TChainedCacheDependency.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function getDependencies()
38 38
 	{
39
-		if($this->_dependencies === null)
40
-			$this->_dependencies = new TCacheDependencyList;
39
+		if($this->_dependencies===null)
40
+			$this->_dependencies=new TCacheDependencyList;
41 41
 		return $this->_dependencies;
42 42
 	}
43 43
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function getHasChanged()
51 51
 	{
52
-		if($this->_dependencies !== null)
52
+		if($this->_dependencies!==null)
53 53
 		{
54 54
 			foreach($this->_dependencies as $dependency)
55 55
 				if($dependency->getHasChanged())
Please login to merge, or discard this patch.
framework/Caching/TXCache.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 		if(!function_exists('xcache_isset'))
57 57
 			throw new TConfigurationException('xcache_extension_required');
58 58
 
59
-		$enabled = (int)ini_get('xcache.cacher') !== 0;
60
-		$var_size = (int)ini_get('xcache.var_size');
59
+		$enabled=(int) ini_get('xcache.cacher')!==0;
60
+		$var_size=(int) ini_get('xcache.var_size');
61 61
 
62 62
 		if(!($enabled && $var_size > 0))
63 63
 			throw new TConfigurationException('xcache_extension_not_enabled');
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function flush()
123 123
 	{
124
-		for($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++)
124
+		for($i=0, $max=xcache_count(XC_TYPE_VAR); $i < $max; $i++)
125 125
 		{
126
-			if(xcache_clear_cache(XC_TYPE_VAR, $i) === false)
126
+			if(xcache_clear_cache(XC_TYPE_VAR, $i)===false)
127 127
 				return false;
128 128
 		}
129 129
 		return true;
Please login to merge, or discard this patch.
framework/Caching/TGlobalStateCacheDependency.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function setStateName($value)
55 55
 	{
56
-		$this->_stateName = $value;
57
-		$this->_stateValue = Prado::getApplication()->getGlobalState($value);
56
+		$this->_stateName=$value;
57
+		$this->_stateValue=Prado::getApplication()->getGlobalState($value);
58 58
 	}
59 59
 
60 60
 	/**
@@ -64,6 +64,6 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public function getHasChanged()
66 66
 	{
67
-		return $this->_stateValue !== Prado::getApplication()->getGlobalState($this->_stateName);
67
+		return $this->_stateValue!==Prado::getApplication()->getGlobalState($this->_stateName);
68 68
 	}
69 69
 }
70 70
\ No newline at end of file
Please login to merge, or discard this patch.