Completed
Push — prado-3.3 ( f4da81...5dd4b5 )
by Fabio
09:03
created
framework/Data/SqlMap/Statements/TMappedStatement.php 1 patch
Braces   +18 added lines, -32 removed lines patch added patch discarded remove patch
@@ -237,8 +237,7 @@  discard block
 block discarded – undo
237 237
 				$param = new TResultSetListItemParameter($obj, $parameter, $list);
238 238
 				$this->raiseRowDelegate($delegate, $param);
239 239
 			}
240
-		}
241
-		else
240
+		} else
242 241
 		{
243 242
 			//var_dump($sql,$parameter);
244 243
 			foreach($reader as $row)
@@ -314,8 +313,7 @@  discard block
 block discarded – undo
314 313
 				$param = new TResultSetMapItemParameter($key, $value, $parameter, $map);
315 314
 				$this->raiseRowDelegate($delegate, $param);
316 315
 			}
317
-		}
318
-		else
316
+		} else
319 317
 		{
320 318
 			//while($row = $recordSet->fetchRow())
321 319
 			foreach($reader as $row)
@@ -341,8 +339,7 @@  discard block
 block discarded – undo
341 339
 		if(is_string($handler))
342 340
 		{
343 341
 			call_user_func($handler,$this,$param);
344
-		}
345
-		else if(is_callable($handler,true))
342
+		} else if(is_callable($handler,true))
346 343
 		{
347 344
 			// an array: 0 - object, 1 - method name/path
348 345
 			list($object,$method)=$handler;
@@ -357,8 +354,7 @@  discard block
 block discarded – undo
357 354
 				}
358 355
 				$object->$method($this,$param);
359 356
 			}
360
-		}
361
-		else
357
+		} else
362 358
 			throw new TInvalidDataValueException('sqlmap_invalid_delegate', $this->getID(), $handler);
363 359
 	}
364 360
 
@@ -520,8 +516,7 @@  discard block
 block discarded – undo
520 516
 				if($method == self::QUERY_FOR_ARRAY)
521 517
 					$values = $values->toArray();
522 518
 				TPropertyAccess::set($resultObject, $property, $values);
523
-			}
524
-			else if($method == self::QUERY_FOR_OBJECT)
519
+			} else if($method == self::QUERY_FOR_OBJECT)
525 520
 			{
526 521
 				$value = $statement->executeQueryForObject($connection, $keys, null);
527 522
 				TPropertyAccess::set($resultObject, $property, $value);
@@ -651,8 +646,7 @@  discard block
 block discarded – undo
651 646
 			else
652 647
 				foreach($resultMap->getColumns() as $property)
653 648
 					$this->setObjectProperty($resultMap, $property, $row, $resultObject);
654
-		}
655
-		else
649
+		} else
656 650
 		{
657 651
 			$resultObject = $this->fillDefaultResultMap($resultMap, $row, $resultObject);
658 652
 		}
@@ -797,8 +791,7 @@  discard block
 block discarded – undo
797 791
 		if($key === '')
798 792
 		{
799 793
 			$resultObject = $property->getPropertyValue($registry,$row);
800
-		}
801
-		else if(strlen($select) == 0 && ($nested===null))
794
+		} else if(strlen($select) == 0 && ($nested===null))
802 795
 		{
803 796
 			$value = $property->getPropertyValue($registry,$row);
804 797
 
@@ -807,8 +800,7 @@  discard block
 block discarded – undo
807 800
 				TPropertyAccess::set($resultObject, $key, $value);
808 801
 			else
809 802
 				$resultObject = $value;
810
-		}
811
-		else if($nested!==null)
803
+		} else if($nested!==null)
812 804
 		{
813 805
 			if($property->instanceOfListType($resultObject) || $property->instanceOfArrayType($resultObject))
814 806
 			{
@@ -816,16 +808,14 @@  discard block
 block discarded – undo
816 808
 					throw new TSqlMapExecutionException(
817 809
 						'sqlmap_non_groupby_array_list_type', $resultMap->getID(),
818 810
 						get_class($resultObject), $key);
819
-			}
820
-			else
811
+			} else
821 812
 			{
822 813
 				$obj = $nested->createInstanceOfResult($this->getManager()->getTypeHandlers());
823 814
 				if($this->fillPropertyWithResultMap($nested, $row, $obj) == false)
824 815
 					$obj = null;
825 816
 				TPropertyAccess::set($resultObject, $key, $obj);
826 817
 			}
827
-		}
828
-		else //'select' ResultProperty
818
+		} else //'select' ResultProperty
829 819
 		{
830 820
 			$this->enquequePostSelect($select, $resultMap, $property, $row, $resultObject);
831 821
 		}
@@ -857,11 +847,9 @@  discard block
 block discarded – undo
857 847
 				$values = TLazyLoadList::newInstance($statement, $key,
858 848
 								$resultObject, $property->getProperty());
859 849
 				TPropertyAccess::set($resultObject, $property->getProperty(), $values);
860
-			}
861
-			else
850
+			} else
862 851
 				$postSelect->setMethod(self::QUERY_FOR_LIST);
863
-		}
864
-		else if($property->instanceOfArrayType($resultObject))
852
+		} else if($property->instanceOfArrayType($resultObject))
865 853
 			$postSelect->setMethod(self::QUERY_FOR_ARRAY);
866 854
 		else
867 855
 			$postSelect->setMethod(self::QUERY_FOR_OBJECT);
@@ -889,8 +877,7 @@  discard block
 block discarded – undo
889 877
 				$keys[trim($pair[0])] = $row[trim($pair[1])];
890 878
 			}
891 879
 			return $keys;
892
-		}
893
-		else
880
+		} else
894 881
 		{
895 882
 			$registry=$this->getManager()->getTypeHandlers();
896 883
 			return $property->getPropertyValue($registry,$row);
@@ -1048,8 +1035,7 @@  discard block
 block discarded – undo
1048 1035
 			{
1049 1036
 				$found = true;
1050 1037
 				$childs[$key][$node] = array();
1051
-			}
1052
-			else
1038
+			} else
1053 1039
 			{
1054 1040
 				$found = $found || $this->addNode($childs[$key], $parent, $node);
1055 1041
 			}
@@ -1062,8 +1048,9 @@  discard block
 block discarded – undo
1062 1048
 	 */
1063 1049
 	public function collect()
1064 1050
 	{
1065
-		while(count($this->_tree) > 0)
1066
-			$this->collectChildren(null, $this->_tree);
1051
+		while(count($this->_tree) > 0) {
1052
+					$this->collectChildren(null, $this->_tree);
1053
+		}
1067 1054
 		return $this->getCollection();
1068 1055
 	}
1069 1056
 
@@ -1096,8 +1083,7 @@  discard block
 block discarded – undo
1096 1083
 			{
1097 1084
 				$childs[] = $key;
1098 1085
 				unset($nodes[$key]);
1099
-			}
1100
-			else
1086
+			} else
1101 1087
 				$this->collectChildren($key, $nodes[$key]);
1102 1088
 		}
1103 1089
 		if(count($childs) > 0)
Please login to merge, or discard this patch.
framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
 		if ($this->sourcepath === NULL)
59 59
 		{
60 60
 			$this->sourcepath = $sourcepath;
61
-		}
62
-		else
61
+		} else
63 62
 		{
64 63
 			$this->sourcepath->append($sourcepath);
65 64
 		}
Please login to merge, or discard this patch.
framework/Data/TDbCommand.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -109,8 +109,7 @@  discard block
 block discarded – undo
109 109
 			try
110 110
 			{
111 111
 				$this->_statement=$this->getConnection()->getPdoInstance()->prepare($this->getText());
112
-			}
113
-			catch(Exception $e)
112
+			} catch(Exception $e)
114 113
 			{
115 114
 				throw new TDbException('dbcommand_prepare_failed',$e->getMessage(),$this->getText());
116 115
 			}
@@ -186,11 +185,9 @@  discard block
 block discarded – undo
186 185
 			{
187 186
 				$this->_statement->execute();
188 187
 				return $this->_statement->rowCount();
189
-			}
190
-			else
188
+			} else
191 189
 				return $this->getConnection()->getPdoInstance()->exec($this->getText());
192
-		}
193
-		catch(Exception $e)
190
+		} catch(Exception $e)
194 191
 		{
195 192
 			throw new TDbException('dbcommand_execute_failed',$e->getMessage(),$this->getDebugStatementText());
196 193
 		}
@@ -223,8 +220,7 @@  discard block
 block discarded – undo
223 220
 			else
224 221
 				$this->_statement=$this->getConnection()->getPdoInstance()->query($this->getText());
225 222
 			return new TDbDataReader($this);
226
-		}
227
-		catch(Exception $e)
223
+		} catch(Exception $e)
228 224
 		{
229 225
 			throw new TDbException('dbcommand_query_failed',$e->getMessage(),$this->getDebugStatementText());
230 226
 		}
@@ -250,8 +246,7 @@  discard block
 block discarded – undo
250 246
 			$result=$this->_statement->fetch($fetchAssociative ? PDO::FETCH_ASSOC : PDO::FETCH_NUM);
251 247
 			$this->_statement->closeCursor();
252 248
 			return $result;
253
-		}
254
-		catch(Exception $e)
249
+		} catch(Exception $e)
255 250
 		{
256 251
 			throw new TDbException('dbcommand_query_failed',$e->getMessage(),$this->getDebugStatementText());
257 252
 		}
@@ -279,8 +274,7 @@  discard block
 block discarded – undo
279 274
 				return stream_get_contents($result);
280 275
 			else
281 276
 				return $result;
282
-		}
283
-		catch(Exception $e)
277
+		} catch(Exception $e)
284 278
 		{
285 279
 			throw new TDbException('dbcommand_query_failed',$e->getMessage(),$this->getDebugStatementText());
286 280
 		}
Please login to merge, or discard this patch.
framework/Data/TDbTransaction.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -189,8 +189,7 @@  discard block
 block discarded – undo
189 189
 				return file_put_contents($fileName,file_get_contents($this->_localName))!==false;
190 190
 			else
191 191
 				return false;
192
-		}
193
-		else
192
+		} else
194 193
 			return false;
195 194
 	}
196 195
 
@@ -211,8 +210,7 @@  discard block
 block discarded – undo
211 210
 			$this->_errorCode=$_FILES[$key]['error'];
212 211
 			$this->_localName=$_FILES[$key]['tmp_name'];
213 212
 			return $this->_dataChanged=true;
214
-		}
215
-		else
213
+		} else
216 214
 			return false;
217 215
 	}
218 216
 
Please login to merge, or discard this patch.
framework/TApplication.php 1 patch
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -357,8 +357,7 @@  discard block
 block discarded – undo
357 357
 		{
358 358
 			$configFile=$basePath;
359 359
 			$basePath=dirname($configFile);
360
-		}
361
-		else
360
+		} else
362 361
 			$configFile=null;
363 362
 
364 363
 		// determine runtime path
@@ -378,8 +377,7 @@  discard block
 block discarded – undo
378 377
 			}
379 378
 			$this->setBasePath($basePath);
380 379
 			$this->setRuntimePath($runtimePath);
381
-		}
382
-		else
380
+		} else
383 381
 			throw new TConfigurationException('application_runtimepath_invalid',$runtimePath);
384 382
 
385 383
 	}
@@ -408,8 +406,7 @@  discard block
 block discarded – undo
408 406
 				$this->$method();
409 407
 				$this->_step++;
410 408
 			}
411
-		}
412
-		catch(Exception $e)
409
+		} catch(Exception $e)
413 410
 		{
414 411
 			$this->onError($e);
415 412
 		}
@@ -1010,8 +1007,7 @@  discard block
 block discarded – undo
1010 1007
 				foreach($parameter[1] as $name=>$value)
1011 1008
 					$component->setSubProperty($name,$value);
1012 1009
 				$this->_parameters->add($id,$component);
1013
-			}
1014
-			else
1010
+			} else
1015 1011
 				$this->_parameters->add($id,$parameter);
1016 1012
 		}
1017 1013
 
@@ -1070,8 +1066,7 @@  discard block
 block discarded – undo
1070 1066
 				$config->loadFromFile($this->_configFile);
1071 1067
 				if($this->_cacheFile!==null)
1072 1068
 					file_put_contents($this->_cacheFile,serialize($config),LOCK_EX);
1073
-			}
1074
-			else
1069
+			} else
1075 1070
 				$config=unserialize(file_get_contents($this->_cacheFile));
1076 1071
 
1077 1072
 			$this->applyConfiguration($config,false);
@@ -1116,8 +1111,7 @@  discard block
 block discarded – undo
1116 1111
 			}
1117 1112
 
1118 1113
 			$service->init($configElement);
1119
-		}
1120
-		else
1114
+		} else
1121 1115
 			throw new THttpException(500,'application_service_unknown',$serviceID);
1122 1116
 	}
1123 1117
 
@@ -1346,8 +1340,7 @@  discard block
 block discarded – undo
1346 1340
 		{
1347 1341
 			$fcontent = include $fname;
1348 1342
 			$this->loadFromPhp($fcontent,dirname($fname));
1349
-		}
1350
-		else
1343
+		} else
1351 1344
 		{
1352 1345
 			$dom=new TXmlDocument;
1353 1346
 			$dom->loadFromFile($fname);
@@ -1494,8 +1487,7 @@  discard block
 block discarded – undo
1494 1487
 						if(isset($this->_aliases[$id]))
1495 1488
 							throw new TConfigurationException('appconfig_alias_redefined',$id);
1496 1489
 						$this->_aliases[$id]=$p;
1497
-					}
1498
-					else
1490
+					} else
1499 1491
 						throw new TConfigurationException('appconfig_alias_invalid');
1500 1492
 					$this->_empty=false;
1501 1493
 					break;
@@ -1562,8 +1554,7 @@  discard block
 block discarded – undo
1562 1554
 				else
1563 1555
 					$this->_modules[$id]=array($type,$properties->toArray(),$element);
1564 1556
 				$this->_empty=false;
1565
-			}
1566
-			else
1557
+			} else
1567 1558
 				throw new TConfigurationException('appconfig_modules_invalid',$element->getTagName());
1568 1559
 		}
1569 1560
 	}
@@ -1607,8 +1598,7 @@  discard block
 block discarded – undo
1607 1598
 				$element->setParent(null);
1608 1599
 				$this->_services[$id]=array($type,$properties->toArray(),$element);
1609 1600
 				$this->_empty=false;
1610
-			}
1611
-			else
1601
+			} else
1612 1602
 				throw new TConfigurationException('appconfig_services_invalid',$element->getTagName());
1613 1603
 		}
1614 1604
 	}
@@ -1632,8 +1622,7 @@  discard block
 block discarded – undo
1632 1622
 					$properties['id'] = $id;
1633 1623
 					$this->_parameters[$id] = array($type,$properties);
1634 1624
 				}
1635
-			}
1636
-			else
1625
+			} else
1637 1626
 			{
1638 1627
 				$this->_parameters[$id] = $parameter;
1639 1628
 			}
@@ -1660,12 +1649,10 @@  discard block
 block discarded – undo
1660 1649
 						$this->_parameters[$id]=$element;
1661 1650
 					else
1662 1651
 						$this->_parameters[$id]=$value;
1663
-				}
1664
-				else
1652
+				} else
1665 1653
 					$this->_parameters[$id]=array($type,$properties->toArray());
1666 1654
 				$this->_empty=false;
1667
-			}
1668
-			else
1655
+			} else
1669 1656
 				throw new TConfigurationException('appconfig_parameters_invalid',$element->getTagName());
1670 1657
 		}
1671 1658
 	}
Please login to merge, or discard this patch.
framework/Caching/TCache.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/Caching/TMemCache.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,8 +124,7 @@
 block discarded – undo
124 124
         	if (!@mysql_select_db($dsninfo['database'], $conn))
125 125
         		throw new Exception('Error in connecting database, dns:'.
126 126
         							$dsninfo);
127
-        }
128
-        else
127
+        } else
129 128
         	throw new Exception('Please provide a database for message'.
130 129
         						' translation.');
131 130
        return $conn;
Please login to merge, or discard this patch.
framework/Xml/TXmlDocument.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -211,13 +211,11 @@  discard block
 block discarded – undo
211 211
 				$str.=$element->toString($indent+1)."\n";
212 212
 			$str.=$prefix."</{$this->_tagName}>";
213 213
 			return $str;
214
-		}
215
-		else if(($value=$this->getValue())!=='')
214
+		} else if(($value=$this->getValue())!=='')
216 215
 		{
217 216
 			$value=$this->xmlEncode($value);
218 217
 			return $prefix."<{$this->_tagName}$attr>$value</{$this->_tagName}>";
219
-		}
220
-		else
218
+		} else
221 219
 			return $prefix."<{$this->_tagName}$attr />";
222 220
 	}
223 221
 
@@ -434,8 +432,7 @@  discard block
 block discarded – undo
434 432
 		{
435 433
 			fwrite($fw,$this->saveToString());
436 434
 			fclose($fw);
437
-		}
438
-		else
435
+		} else
439 436
 			throw new TIOException('xmldocument_file_write_failed',$file);
440 437
 	}
441 438
 
@@ -542,8 +539,7 @@  discard block
 block discarded – undo
542 539
 			if($item->getParent()!==null)
543 540
 				$item->getParent()->getElements()->remove($item);
544 541
 			$item->setParent($this->_o);
545
-		}
546
-		else
542
+		} else
547 543
 			throw new TInvalidDataTypeException('xmlelementlist_xmlelement_required');
548 544
 	}
549 545
 
Please login to merge, or discard this patch.
framework/Collections/TPagedList.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -181,22 +181,18 @@  discard block
 block discarded – undo
181 181
 					$this->_currentPageIndex=$pageIndex;
182 182
 					$this->onPageIndexChanged(new TPagedListPageChangedEventParameter($oldPage));
183 183
 					return $pageIndex;
184
-				}
185
-				else
184
+				} else
186 185
 					return false;
187
-			}
188
-			else
186
+			} else
189 187
 				return false;
190
-		}
191
-		else
188
+		} else
192 189
 		{
193 190
 			if($pageIndex>=0 && $pageIndex<$this->getPageCount())
194 191
 			{
195 192
 				$this->_currentPageIndex=$pageIndex;
196 193
 				$this->onPageIndexChanged(null);
197 194
 				return $pageIndex;
198
-			}
199
-			else
195
+			} else
200 196
 				return false;
201 197
 		}
202 198
 	}
@@ -248,8 +244,7 @@  discard block
 block discarded – undo
248 244
 				return (int)(($this->_virtualCount+$this->_pageSize-1)/$this->_pageSize);
249 245
 			else
250 246
 				return -1;
251
-		}
252
-		else
247
+		} else
253 248
 			return (int)((parent::getCount()+$this->_pageSize-1)/$this->_pageSize);
254 249
 	}
255 250
 
Please login to merge, or discard this patch.