Completed
Push — remove_deprecates ( 1de955 )
by Fabio
07:55
created
framework/Collections/TPriorityList.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -390,8 +390,7 @@  discard block
 block discarded – undo
390 390
 			}
391 391
 			$this->removeAtIndexInPriority($p[1],$p[0]);
392 392
 			return $p[2];
393
-		}
394
-		else
393
+		} else
395 394
 			throw new TInvalidDataValueException('list_item_inexistent');
396 395
 	}
397 396
 
@@ -676,14 +675,12 @@  discard block
 block discarded – undo
676 675
 				foreach($data->itemsAtPriority($priority) as $index=>$item)
677 676
 					$this->insertAtIndexInPriority($item,false,$priority);
678 677
 			}
679
-		}
680
-		else if(is_array($data)||$data instanceof \Traversable)
678
+		} else if(is_array($data)||$data instanceof \Traversable)
681 679
 		{
682 680
 			foreach($data as $priority=>$item)
683 681
 				$this->add($item);
684 682
 
685
-		}
686
-		else if($data!==null)
683
+		} else if($data!==null)
687 684
 			throw new TInvalidDataTypeException('map_data_not_iterable');
688 685
 	}
689 686
 
Please login to merge, or discard this patch.
framework/Collections/TPriorityMap.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -364,13 +364,11 @@  discard block
 block discarded – undo
364 364
 			if(!isset($this->_d[$priority])) {
365 365
 				$this->_d[$priority]=array($key=>$value);
366 366
 				$this->_o=false;
367
-			}
368
-			else
367
+			} else
369 368
 				$this->_d[$priority][$key]=$value;
370 369
 			$this->_c++;
371 370
 			$this->_fd=null;
372
-		}
373
-		else
371
+		} else
374 372
 			throw new TInvalidOperationException('map_readonly',get_class($this));
375 373
 		return $priority;
376 374
 	}
@@ -412,8 +410,7 @@  discard block
 block discarded – undo
412 410
 						return $value;
413 411
 					}
414 412
 				return null;
415
-			}
416
-			else
413
+			} else
417 414
 			{
418 415
 				$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
419 416
 				if(isset($this->_d[$priority])&&(isset($this->_d[$priority][$key])||array_key_exists($key,$this->_d[$priority])))
@@ -427,12 +424,10 @@  discard block
 block discarded – undo
427 424
 					}
428 425
 					$this->_fd=null;
429 426
 					return $value;
430
-				}
431
-				else
427
+				} else
432 428
 					return null;
433 429
 			}
434
-		}
435
-		else
430
+		} else
436 431
 			throw new TInvalidOperationException('map_readonly',get_class($this));
437 432
 	}
438 433
 
@@ -525,15 +520,13 @@  discard block
 block discarded – undo
525 520
 					$this->add($key,$value,$priority);
526 521
 				}
527 522
 			}
528
-		}
529
-		else if(is_array($data)||$data instanceof \Traversable)
523
+		} else if(is_array($data)||$data instanceof \Traversable)
530 524
 		{
531 525
 			if($this->getCount()>0)
532 526
 				$this->clear();
533 527
 			foreach($data as $key=>$value)
534 528
 				$this->add($key,$value);
535
-		}
536
-		else if($data!==null)
529
+		} else if($data!==null)
537 530
 			throw new TInvalidDataTypeException('map_data_not_iterable');
538 531
 	}
539 532
 
@@ -553,13 +546,11 @@  discard block
 block discarded – undo
553 546
 				foreach($data->itemsAtPriority($priority) as $key => $value)
554 547
 					$this->add($key,$value,$priority);
555 548
 			}
556
-		}
557
-		else if(is_array($data)||$data instanceof \Traversable)
549
+		} else if(is_array($data)||$data instanceof \Traversable)
558 550
 		{
559 551
 			foreach($data as $key=>$value)
560 552
 				$this->add($key,$value);
561
-		}
562
-		else if($data!==null)
553
+		} else if($data!==null)
563 554
 			throw new TInvalidDataTypeException('map_data_not_iterable');
564 555
 	}
565 556
 
Please login to merge, or discard this patch.
framework/TPropertyValue.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -123,11 +123,9 @@  discard block
 block discarded – undo
123 123
 			{
124 124
 				eval('$array=array'.$value.';');
125 125
 				return $array;
126
-			}
127
-			else
126
+			} else
128 127
 				return $len>0?array($value):array();
129
-		}
130
-		else
128
+		} else
131 129
 			return (array)$value;
132 130
 	}
133 131
 
@@ -170,8 +168,7 @@  discard block
 block discarded – undo
170 168
 				throw new TInvalidDataValueException(
171 169
 					'propertyvalue_enumvalue_invalid',$value,
172 170
 						implode(' | ',$types[$enums]->getConstants()));
173
-		}
174
-		else if(!is_array($enums))
171
+		} else if(!is_array($enums))
175 172
 		{
176 173
 			$enums=func_get_args();
177 174
 			array_shift($enums);
Please login to merge, or discard this patch.
framework/Util/TBrowserLogRoute.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -42,8 +42,7 @@  discard block
 block discarded – undo
42 42
 			{
43 43
 				$timing['delta'] = $logs[$i+1][3] - $logs[$i][3];
44 44
 				$timing['total'] = $logs[$i+1][3] - $first;
45
-			}
46
-			else
45
+			} else
47 46
 			{
48 47
 				$timing['delta'] = '?';
49 48
 				$timing['total'] = $logs[$i][3] - $first;
@@ -86,8 +85,7 @@  discard block
 block discarded – undo
86 85
 		<th>Category</th><th>Message</th><th>Time Spent (s)</th><th>Cumulated Time Spent (s)</th>
87 86
 	</tr>
88 87
 EOD;
89
-		}
90
-		else
88
+		} else
91 89
 		{
92 90
 			$string = <<<EOD
93 91
 <table cellspacing="0" cellpadding="2" border="0" width="100%" style="table-layout:auto">
@@ -124,8 +122,7 @@  discard block
 block discarded – undo
124 122
 		<td class="cumulatedtime">{$total}</td>
125 123
 	</tr>
126 124
 EOD;
127
-		}
128
-		else
125
+		} else
129 126
 		{
130 127
 			$bgcolor = $info['even'] ? "#fff" : "#eee";
131 128
 			$color = $this->getColorLevel($log[1]);
@@ -167,8 +164,7 @@  discard block
 block discarded – undo
167 164
 			{
168 165
 				$string .= '<span class="level'.$level.'">'.strtoupper($name)."</span>";
169 166
 			}
170
-		}
171
-		else
167
+		} else
172 168
 		{
173 169
 			$string .= "<tr><td colspan=\"5\" style=\"text-align:center; background-color:black; border-top: 1px solid #ccc; padding:0.2em;\">";
174 170
 			foreach(self::$_levelValues as $name => $level)
Please login to merge, or discard this patch.
framework/Util/TDbLogRoute.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,8 +86,7 @@  discard block
 block discarded – undo
86 86
 		try
87 87
 		{
88 88
 			$db->createCommand($sql)->query()->close();
89
-		}
90
-		catch(Exception $e)
89
+		} catch(Exception $e)
91 90
 		{
92 91
 			// DB table not exists
93 92
 			if($this->_autoCreate)
@@ -153,8 +152,7 @@  discard block
 block discarded – undo
153 152
 				return $config->getDbConnection();
154 153
 			else
155 154
 				throw new TConfigurationException('dblogroute_connectionid_invalid',$this->_connID);
156
-		}
157
-		else
155
+		} else
158 156
 		{
159 157
 			$db=new TDbConnection;
160 158
 			// default to SQLite3 database
Please login to merge, or discard this patch.
framework/Util/TLogRouter.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,15 +72,13 @@  discard block
 block discarded – undo
72 72
 				{
73 73
 					$phpConfig = include $this->_configFile;
74 74
 					$this->loadConfig($phpConfig);
75
-				}
76
-				else
75
+				} else
77 76
 				{
78 77
 					$dom=new TXmlDocument;
79 78
 					$dom->loadFromFile($this->_configFile);
80 79
 					$this->loadConfig($dom);
81 80
 				}
82
-			}
83
-			else
81
+			} else
84 82
 				throw new TConfigurationException('logrouter_configfile_invalid',$this->_configFile);
85 83
 		}
86 84
 		$this->loadConfig($config);
@@ -112,8 +110,7 @@  discard block
 block discarded – undo
112 110
 					$route->init($route);
113 111
 				}
114 112
 			}
115
-		}
116
-		else
113
+		} else
117 114
 		{
118 115
 			foreach($config->getElementsByTagName('route') as $routeConfig)
119 116
 			{
Please login to merge, or discard this patch.
framework/Caching/TDbCache.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -204,8 +204,7 @@  discard block
 block discarded – undo
204 204
 				$this -> _createCheck = true;
205 205
 				$this -> getApplication() -> setGlobalState($key, time());
206 206
 			}
207
-		}
208
-		catch(\Exception $e)
207
+		} catch(\Exception $e)
209 208
 		{
210 209
 			// DB table not exists
211 210
 			if($this->_autoCreate)
@@ -228,8 +227,7 @@  discard block
 block discarded – undo
228 227
 
229 228
 				$this -> _createCheck = true;
230 229
 				$this -> getApplication() -> setGlobalState($key, time());
231
-			}
232
-			else
230
+			} else
233 231
 				throw new TConfigurationException('db_cachetable_inexistent',$this->_cacheTable);
234 232
 		}
235 233
 		$this->_cacheInitialized = true;
@@ -298,8 +296,7 @@  discard block
 block discarded – undo
298 296
 				return $config->getDbConnection();
299 297
 			else
300 298
 				throw new TConfigurationException('dbcache_connectionid_invalid',$this->_connID);
301
-		}
302
-		else
299
+		} else
303 300
 		{
304 301
 			$db=new TDbConnection;
305 302
 			if($this->_connectionString!=='')
@@ -309,8 +306,7 @@  discard block
 block discarded – undo
309 306
 					$db->setUsername($this->_username);
310 307
 				if($this->_password!=='')
311 308
 					$db->setPassword($this->_password);
312
-			}
313
-			else
309
+			} else
314 310
 			{
315 311
 				// default to SQLite3 database
316 312
 				$dbFile=$this->getApplication()->getRuntimePath().'/sqlite3.cache';
@@ -467,8 +463,7 @@  discard block
 block discarded – undo
467 463
 			$sql='SELECT value FROM '.$this->_cacheTable.' WHERE itemkey=\''.$key.'\' AND (expire=0 OR expire>'.time().') ORDER BY expire DESC';
468 464
 			$command=$this->getDbConnection()->createCommand($sql);
469 465
 			return unserialize($command->queryScalar());
470
-		}
471
-		catch(\Exception $e)
466
+		} catch(\Exception $e)
472 467
 		{
473 468
 			$this->initializeCache(true);
474 469
 			return unserialize($command->queryScalar());
@@ -511,16 +506,14 @@  discard block
 block discarded – undo
511 506
 			$command->bindValue(':value',serialize($value),\PDO::PARAM_LOB);
512 507
 			$command->execute();
513 508
 			return true;
514
-		}
515
-		catch(\Exception $e)
509
+		} catch(\Exception $e)
516 510
 		{
517 511
 			try
518 512
 			{
519 513
 				$this->initializeCache(true);
520 514
 				$command->execute();
521 515
 				return true;
522
-			}
523
-			catch(\Exception $e)
516
+			} catch(\Exception $e)
524 517
 			{
525 518
 				return false;
526 519
 			}
@@ -542,8 +535,7 @@  discard block
 block discarded – undo
542 535
 			$command->bindValue(':key',$key,\PDO::PARAM_STR);
543 536
 			$command->execute();
544 537
 			return true;
545
-		}
546
-		catch(\Exception $e)
538
+		} catch(\Exception $e)
547 539
 		{
548 540
 			$this->initializeCache(true);
549 541
 			$command->execute();
@@ -562,16 +554,14 @@  discard block
 block discarded – undo
562 554
 		{
563 555
 			$command = $this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable}");
564 556
 			$command->execute();
565
-		}
566
-		catch(\Exception $e)
557
+		} catch(\Exception $e)
567 558
 		{
568 559
 			try
569 560
 			{
570 561
 				$this->initializeCache(true);
571 562
 				$command->execute();
572 563
 				return true;
573
-			}
574
-			catch(\Exception $e)
564
+			} catch(\Exception $e)
575 565
 			{
576 566
 				return false;
577 567
 			}
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
@@ -532,8 +532,7 @@
 block discarded – undo
532 532
 			{
533 533
 				if(($this->_recursiveLevel<0 || $level<$this->_recursiveLevel) && $this->validateDirectory($path))
534 534
 					$timestamps=array_merge($this->generateTimestamps($path,$level+1));
535
-			}
536
-			else if($this->validateFile($path))
535
+			} else if($this->validateFile($path))
537 536
 				$timestamps[$path]=filemtime($path);
538 537
 		}
539 538
 		closedir($dir);
Please login to merge, or discard this patch.
framework/TApplication.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -340,8 +340,7 @@  discard block
 block discarded – undo
340 340
 		{
341 341
 			$configFile=$basePath;
342 342
 			$basePath=dirname($configFile);
343
-		}
344
-		else
343
+		} else
345 344
 			$configFile=null;
346 345
 
347 346
 		// determine runtime path
@@ -361,8 +360,7 @@  discard block
 block discarded – undo
361 360
 			}
362 361
 			$this->setBasePath($basePath);
363 362
 			$this->setRuntimePath($runtimePath);
364
-		}
365
-		else
363
+		} else
366 364
 			throw new TConfigurationException('application_runtimepath_invalid',$runtimePath);
367 365
 
368 366
 	}
@@ -391,8 +389,7 @@  discard block
 block discarded – undo
391 389
 				$this->$method();
392 390
 				$this->_step++;
393 391
 			}
394
-		}
395
-		catch(\Exception $e)
392
+		} catch(\Exception $e)
396 393
 		{
397 394
 			$this->onError($e);
398 395
 		}
@@ -993,8 +990,7 @@  discard block
 block discarded – undo
993 990
 				foreach($parameter[1] as $name=>$value)
994 991
 					$component->setSubProperty($name,$value);
995 992
 				$this->_parameters->add($id,$component);
996
-			}
997
-			else
993
+			} else
998 994
 				$this->_parameters->add($id,$parameter);
999 995
 		}
1000 996
 
@@ -1053,8 +1049,7 @@  discard block
 block discarded – undo
1053 1049
 				$config->loadFromFile($this->_configFile);
1054 1050
 				if($this->_cacheFile!==null)
1055 1051
 					file_put_contents($this->_cacheFile,serialize($config),LOCK_EX);
1056
-			}
1057
-			else
1052
+			} else
1058 1053
 				$config=unserialize(file_get_contents($this->_cacheFile));
1059 1054
 
1060 1055
 			$this->applyConfiguration($config,false);
@@ -1099,8 +1094,7 @@  discard block
 block discarded – undo
1099 1094
 			}
1100 1095
 
1101 1096
 			$service->init($configElement);
1102
-		}
1103
-		else
1097
+		} else
1104 1098
 			throw new THttpException(500,'application_service_unknown',$serviceID);
1105 1099
 	}
1106 1100
 
Please login to merge, or discard this patch.