Completed
Push — php-cs-fixer ( b6f93e...b9836a )
by Fabio
07:15
created
framework/Caching/TDbCache.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -205,8 +205,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.
framework/Caching/TMemCache.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,8 +168,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
framework/Caching/TDirectoryCacheDependency.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -166,8 +166,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
framework/PradoBase.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -160,8 +160,7 @@  discard block
 block discarded – undo
160 160
 		{
161 161
 			$am = self::$_application->getAssetManager();
162 162
 			$url = $am->publishFilePath(self::getPathOfNamespace('Prado\\' . $logoName, '.gif'));
163
-		}
164
-		else
163
+		} else
165 164
 			$url = 'http://pradosoft.github.io/docs/' . $logoName . '.gif';
166 165
 		return '<a title="Powered by PRADO" href="https://github.com/pradosoft/prado" target="_blank"><img src="' . $url . '" style="border-width:0px;" alt="Powered by PRADO" /></a>';
167 166
 	}
@@ -213,8 +212,7 @@  discard block
 block discarded – undo
213 212
 		if(self::$_application !== null && ($errorHandler = self::$_application->getErrorHandler()) !== null)
214 213
 		{
215 214
 			$errorHandler->handleError(null, $exception);
216
-		}
217
-		else
215
+		} else
218 216
 		{
219 217
 			echo $exception;
220 218
 		}
@@ -328,8 +326,7 @@  discard block
 block discarded – undo
328 326
 					return $component;
329 327
 				break;
330 328
 			}
331
-		}
332
-		else
329
+		} else
333 330
 			return new $type;
334 331
 	}
335 332
 
@@ -383,8 +380,7 @@  discard block
 block discarded – undo
383 380
 			if($className === '*')  // a directory
384 381
 			{
385 382
 				self::$_usings[substr($namespace, 0, $pos)] = $path;
386
-			}
387
-			else  // a file
383
+			} else  // a file
388 384
 			{
389 385
 				//self::$_usings[$namespace]=$path;
390 386
 				if(!$checkClassExistence || (!class_exists($className, false) && !interface_exists($className, false)))
@@ -394,8 +390,7 @@  discard block
 block discarded – undo
394 390
 						include_once($path);
395 391
 						if(class_exists($namespace, false) || interface_exists($namespace, false))
396 392
 							class_alias($namespace, $className);
397
-					}
398
-					catch(\Exception $e)
393
+					} catch(\Exception $e)
399 394
 					{
400 395
 						if($checkClassExistence && !class_exists($className, false))
401 396
 							throw new TInvalidOperationException('prado_component_unknown', $className, $e->getMessage());
@@ -471,8 +466,7 @@  discard block
 block discarded – undo
471 466
 				self::$_aliases[$alias] = $rp;
472 467
 			else
473 468
 				throw new TInvalidDataValueException('prado_aliasname_invalid', $alias);
474
-		}
475
-		else
469
+		} else
476 470
 			throw new TInvalidDataValueException('prado_alias_invalid', $alias, $path);
477 471
 	}
478 472
 
@@ -517,8 +511,7 @@  discard block
 block discarded – undo
517 511
 							echo "'" . substr($str, 0, 70) . "...'";
518 512
 						else
519 513
 							echo "'" . $str . "'";
520
-					}
521
-					elseif (is_int($item) || is_float($item))
514
+					} elseif (is_int($item) || is_float($item))
522 515
 						echo $item;
523 516
 					elseif (is_object($item))
524 517
 						echo get_class($item);
@@ -613,8 +606,7 @@  discard block
 block discarded – undo
613 606
 			if(isset($trace[0]['file']) && isset($trace[0]['line']))
614 607
 				$msg .= " (line {$trace[0]['line']}, {$trace[0]['file']})";
615 608
 			$level = TLogger::DEBUG;
616
-		}
617
-		else
609
+		} else
618 610
 			$level = TLogger::INFO;
619 611
 		self::log($msg, $level, $category, $ctl);
620 612
 	}
Please login to merge, or discard this patch.
framework/Exceptions/TErrorHandler.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -235,8 +235,7 @@  discard block
 block discarded – undo
235 235
 			echo "<body><h1>Recursive Error</h1>\n";
236 236
 			echo "<pre>" . $exception->__toString() . "</pre>\n";
237 237
 			echo "</body></html>";
238
-		}
239
-		else
238
+		} else
240 239
 		{
241 240
 			error_log("Error happened while processing an existing error:\n" . $exception->__toString());
242 241
 			header('HTTP/1.0 500 Internal Error');
@@ -267,15 +266,13 @@  discard block
 block discarded – undo
267 266
 			if($fileName === '')
268 267
 				$fileName = '---embedded template---';
269 268
 			$errorLine = $exception->getLineNumber();
270
-		}
271
-		else
269
+		} else
272 270
 		{
273 271
 			if(($trace = $this->getExactTrace($exception)) !== null)
274 272
 			{
275 273
 				$fileName = $trace['file'];
276 274
 				$errorLine = $trace['line'];
277
-			}
278
-			else
275
+			} else
279 276
 			{
280 277
 				$fileName = $exception->getFile();
281 278
 				$errorLine = $exception->getLine();
@@ -435,8 +432,7 @@  discard block
 block discarded – undo
435 432
 			{
436 433
 				$line = htmlspecialchars(sprintf("%04d: %s", $i + 1, str_replace("\t", '    ', $lines[$i])));
437 434
 				$source .= "<div class=\"error\">" . $line . "</div>";
438
-			}
439
-			else
435
+			} else
440 436
 				$source .= htmlspecialchars(sprintf("%04d: %s", $i + 1, str_replace("\t", '    ', $lines[$i])));
441 437
 		}
442 438
 		return $source;
@@ -456,8 +452,7 @@  discard block
 block discarded – undo
456 452
 			$class = $matches[0];
457 453
 			try {
458 454
 				$function = new \ReflectionClass($class);
459
-			}
460
-			catch (\Exception $e) {
455
+			} catch (\Exception $e) {
461 456
 				return null;
462 457
 			}
463 458
 			$classname = $function->getNamespaceName();
Please login to merge, or discard this patch.
framework/TApplicationConfiguration.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -70,8 +70,7 @@  discard block
 block discarded – undo
70 70
 		{
71 71
 			$fcontent = include $fname;
72 72
 			$this->loadFromPhp($fcontent, dirname($fname));
73
-		}
74
-		else
73
+		} else
75 74
 		{
76 75
 			$dom = new TXmlDocument;
77 76
 			$dom->loadFromFile($fname);
@@ -218,8 +217,7 @@  discard block
 block discarded – undo
218 217
 						if(isset($this->_aliases[$id]))
219 218
 							throw new TConfigurationException('appconfig_alias_redefined', $id);
220 219
 						$this->_aliases[$id] = $p;
221
-					}
222
-					else
220
+					} else
223 221
 						throw new TConfigurationException('appconfig_alias_invalid');
224 222
 					$this->_empty = false;
225 223
 					break;
@@ -286,8 +284,7 @@  discard block
 block discarded – undo
286 284
 				else
287 285
 					$this->_modules[$id] = [$type,$properties->toArray(),$element];
288 286
 				$this->_empty = false;
289
-			}
290
-			else
287
+			} else
291 288
 				throw new TConfigurationException('appconfig_modules_invalid', $element->getTagName());
292 289
 		}
293 290
 	}
@@ -331,8 +328,7 @@  discard block
 block discarded – undo
331 328
 				$element->setParent(null);
332 329
 				$this->_services[$id] = [$type,$properties->toArray(),$element];
333 330
 				$this->_empty = false;
334
-			}
335
-			else
331
+			} else
336 332
 				throw new TConfigurationException('appconfig_services_invalid', $element->getTagName());
337 333
 		}
338 334
 	}
@@ -356,8 +352,7 @@  discard block
 block discarded – undo
356 352
 					$properties['id'] = $id;
357 353
 					$this->_parameters[$id] = [$type,$properties];
358 354
 				}
359
-			}
360
-			else
355
+			} else
361 356
 			{
362 357
 				$this->_parameters[$id] = $parameter;
363 358
 			}
@@ -384,12 +379,10 @@  discard block
 block discarded – undo
384 379
 						$this->_parameters[$id] = $element;
385 380
 					else
386 381
 						$this->_parameters[$id] = $value;
387
-				}
388
-				else
382
+				} else
389 383
 					$this->_parameters[$id] = [$type,$properties->toArray()];
390 384
 				$this->_empty = false;
391
-			}
392
-			else
385
+			} else
393 386
 				throw new TConfigurationException('appconfig_parameters_invalid', $element->getTagName());
394 387
 		}
395 388
 	}
Please login to merge, or discard this patch.
framework/Security/TAuthorizationRuleCollection.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 					return ($decision > 0);
42 42
 			}
43 43
 			return true;
44
-		}
45
-		else
44
+		} else
46 45
 			return false;
47 46
 	}
48 47
 
Please login to merge, or discard this patch.
framework/Security/TUserManager.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -117,8 +117,7 @@  discard block
 block discarded – undo
117 117
 			{
118 118
 				$userFile = include $this->_userFile;
119 119
 				$this->loadUserDataFromPhp($userFile);
120
-			}
121
-			else
120
+			} else
122 121
 			{
123 122
 				$dom = new TXmlDocument;
124 123
 				$dom->loadFromFile($this->_userFile);
@@ -314,8 +313,7 @@  discard block
 block discarded – undo
314 313
 			$user = new TUser($this);
315 314
 			$user->setIsGuest(true);
316 315
 			return $user;
317
-		}
318
-		else
316
+		} else
319 317
 		{
320 318
 			$username = strtolower($username);
321 319
 			if(isset($this->_users[$username]))
@@ -326,8 +324,7 @@  discard block
 block discarded – undo
326 324
 				if(isset($this->_roles[$username]))
327 325
 					$user->setRoles($this->_roles[$username]);
328 326
 				return $user;
329
-			}
330
-			else
327
+			} else
331 328
 				return null;
332 329
 		}
333 330
 	}
Please login to merge, or discard this patch.
framework/Security/TDbUserManager.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -123,8 +123,7 @@  discard block
 block discarded – undo
123 123
 			$user = Prado::createComponent($this->_userClass, $this);
124 124
 			$user->setIsGuest(true);
125 125
 			return $user;
126
-		}
127
-		else
126
+		} else
128 127
 			return $this->_userFactory->createUser($username);
129 128
 	}
130 129
 
@@ -175,8 +174,7 @@  discard block
 block discarded – undo
175 174
 				return $conn->getDbConnection();
176 175
 			else
177 176
 				throw new TConfigurationException('dbusermanager_connectionid_invalid', $connectionID);
178
-		}
179
-		else
177
+		} else
180 178
 			throw new TConfigurationException('dbusermanager_connectionid_required');
181 179
 	}
182 180
 
Please login to merge, or discard this patch.