@@ -177,8 +177,7 @@ |
||
| 177 | 177 | try |
| 178 | 178 | { |
| 179 | 179 | return TPropertyAccess::get($object, $property->getProperty()); |
| 180 | - } |
|
| 181 | - catch (TInvalidPropertyException $e) |
|
| 180 | + } catch (TInvalidPropertyException $e) |
|
| 182 | 181 | { |
| 183 | 182 | throw new TSqlMapException( |
| 184 | 183 | 'sqlmap_unable_to_get_property_for_parameter', |
@@ -164,8 +164,7 @@ |
||
| 164 | 164 | return $handler->createNewInstance(); |
| 165 | 165 | else |
| 166 | 166 | return $registry->createInstanceOf($this->getClass()); |
| 167 | - } |
|
| 168 | - catch (TSqlMapException $e) |
|
| 167 | + } catch (TSqlMapException $e) |
|
| 169 | 168 | { |
| 170 | 169 | throw new TSqlMapException( |
| 171 | 170 | 'sqlmap_unable_to_create_new_instance', |
@@ -58,8 +58,7 @@ |
||
| 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 | } |
@@ -58,8 +58,7 @@ |
||
| 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 | } |
@@ -225,8 +225,7 @@ discard block |
||
| 225 | 225 | $year = "{$date['year']}"; |
| 226 | 226 | $month = $date['mon']; |
| 227 | 227 | $day = $date['mday']; |
| 228 | - } |
|
| 229 | - else |
|
| 228 | + } else |
|
| 230 | 229 | { |
| 231 | 230 | $year = null; |
| 232 | 231 | $month = null; |
@@ -262,8 +261,7 @@ discard block |
||
| 262 | 261 | $year = $iYear + 2000; |
| 263 | 262 | } |
| 264 | 263 | $year = (int)$year; |
| 265 | - } |
|
| 266 | - elseif($token=='MM' || $token=='M') |
|
| 264 | + } elseif($token=='MM' || $token=='M') |
|
| 267 | 265 | { |
| 268 | 266 | $month=$this->getInteger($value,$i_val, |
| 269 | 267 | $this->length($token),2); |
@@ -273,8 +271,7 @@ discard block |
||
| 273 | 271 | //throw new TInvalidDataValueException('Invalid month', $value); |
| 274 | 272 | $i_val += strlen($month); |
| 275 | 273 | $month = $iMonth; |
| 276 | - } |
|
| 277 | - elseif ($token=='dd' || $token=='d') |
|
| 274 | + } elseif ($token=='dd' || $token=='d') |
|
| 278 | 275 | { |
| 279 | 276 | $day = $this->getInteger($value,$i_val, |
| 280 | 277 | $this->length($token), 2); |
@@ -284,8 +281,7 @@ discard block |
||
| 284 | 281 | //throw new TInvalidDataValueException('Invalid day', $value); |
| 285 | 282 | $i_val += strlen($day); |
| 286 | 283 | $day = $iDay; |
| 287 | - } |
|
| 288 | - else |
|
| 284 | + } else |
|
| 289 | 285 | { |
| 290 | 286 | if($this->substring($value, $i_val, $this->length($token)) != $token) |
| 291 | 287 | return null; |
@@ -219,8 +219,7 @@ discard block |
||
| 219 | 219 | echo "<body><h1>Recursive Error</h1>\n"; |
| 220 | 220 | echo "<pre>".$exception->__toString()."</pre>\n"; |
| 221 | 221 | echo "</body></html>"; |
| 222 | - } |
|
| 223 | - else |
|
| 222 | + } else |
|
| 224 | 223 | { |
| 225 | 224 | error_log("Error happened while processing an existing error:\n".$exception->__toString()); |
| 226 | 225 | header('HTTP/1.0 500 Internal Error'); |
@@ -251,15 +250,13 @@ discard block |
||
| 251 | 250 | if($fileName==='') |
| 252 | 251 | $fileName='---embedded template---'; |
| 253 | 252 | $errorLine=$exception->getLineNumber(); |
| 254 | - } |
|
| 255 | - else |
|
| 253 | + } else |
|
| 256 | 254 | { |
| 257 | 255 | if(($trace=$this->getExactTrace($exception))!==null) |
| 258 | 256 | { |
| 259 | 257 | $fileName=$trace['file']; |
| 260 | 258 | $errorLine=$trace['line']; |
| 261 | - } |
|
| 262 | - else |
|
| 259 | + } else |
|
| 263 | 260 | { |
| 264 | 261 | $fileName=$exception->getFile(); |
| 265 | 262 | $errorLine=$exception->getLine(); |
@@ -350,8 +347,7 @@ discard block |
||
| 350 | 347 | $result=$trace[0]; |
| 351 | 348 | elseif(isset($trace[1])) |
| 352 | 349 | $result=$trace[1]; |
| 353 | - } |
|
| 354 | - else if($exception instanceof TInvalidOperationException) |
|
| 350 | + } else if($exception instanceof TInvalidOperationException) |
|
| 355 | 351 | { |
| 356 | 352 | // in case of getter or setter error, find out the exact file and row |
| 357 | 353 | if(($result=$this->getPropertyAccessTrace($trace,'__get'))===null) |
@@ -388,8 +384,7 @@ discard block |
||
| 388 | 384 | { |
| 389 | 385 | $line=htmlspecialchars(sprintf("%04d: %s",$i+1,str_replace("\t",' ',$lines[$i]))); |
| 390 | 386 | $source.="<div class=\"error\">".$line."</div>"; |
| 391 | - } |
|
| 392 | - else |
|
| 387 | + } else |
|
| 393 | 388 | $source.=htmlspecialchars(sprintf("%04d: %s",$i+1,str_replace("\t",' ',$lines[$i]))); |
| 394 | 389 | } |
| 395 | 390 | return $source; |
@@ -58,8 +58,7 @@ |
||
| 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 | } |
@@ -113,8 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $userFile = include $this->_userFile; |
| 115 | 115 | $this->loadUserDataFromPhp($userFile); |
| 116 | - } |
|
| 117 | - else |
|
| 116 | + } else |
|
| 118 | 117 | { |
| 119 | 118 | $dom=new TXmlDocument; |
| 120 | 119 | $dom->loadFromFile($this->_userFile); |
@@ -310,8 +309,7 @@ discard block |
||
| 310 | 309 | $user=new TUser($this); |
| 311 | 310 | $user->setIsGuest(true); |
| 312 | 311 | return $user; |
| 313 | - } |
|
| 314 | - else |
|
| 312 | + } else |
|
| 315 | 313 | { |
| 316 | 314 | $username=strtolower($username); |
| 317 | 315 | if(isset($this->_users[$username])) |
@@ -322,8 +320,7 @@ discard block |
||
| 322 | 320 | if(isset($this->_roles[$username])) |
| 323 | 321 | $user->setRoles($this->_roles[$username]); |
| 324 | 322 | return $user; |
| 325 | - } |
|
| 326 | - else |
|
| 323 | + } else |
|
| 327 | 324 | return null; |
| 328 | 325 | } |
| 329 | 326 | } |
@@ -134,12 +134,10 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | $sub = preg_replace('/(^\')|(\'$)/','',$pattern); |
| 136 | 136 | $tokens[$i] = str_replace('``````','\'',$sub); |
| 137 | - } |
|
| 138 | - else if($pattern == '``````') |
|
| 137 | + } else if($pattern == '``````') |
|
| 139 | 138 | { |
| 140 | 139 | $tokens[$i] = '\''; |
| 141 | - } |
|
| 142 | - else |
|
| 140 | + } else |
|
| 143 | 141 | { |
| 144 | 142 | $function = $this->getFunctionName($pattern); |
| 145 | 143 | if($function != null) |
@@ -149,8 +147,7 @@ discard block |
||
| 149 | 147 | { |
| 150 | 148 | $rs = $this->$fName($date, $pattern); |
| 151 | 149 | $tokens[$i] = $rs; |
| 152 | - } |
|
| 153 | - else |
|
| 150 | + } else |
|
| 154 | 151 | throw new |
| 155 | 152 | Exception('function '.$function.' not found.'); |
| 156 | 153 | } |
@@ -285,8 +282,7 @@ discard block |
||
| 285 | 282 | if($char==null || $pattern{$i} == $char || $text) |
| 286 | 283 | { |
| 287 | 284 | $token .= $pattern{$i}; |
| 288 | - } |
|
| 289 | - else |
|
| 285 | + } else |
|
| 290 | 286 | { |
| 291 | 287 | $tokens[] = str_replace("","'",$token); |
| 292 | 288 | $token = $pattern{$i}; |