@@ -78,8 +78,7 @@ |
||
| 78 | 78 | $this->_d[]=$item; |
| 79 | 79 | ++$this->_c; |
| 80 | 80 | } |
| 81 | - } |
|
| 82 | - else if($data!==null) |
|
| 81 | + } else if($data!==null) |
|
| 83 | 82 | throw new TInvalidDataTypeException('stack_data_not_iterable'); |
| 84 | 83 | } |
| 85 | 84 | |
@@ -81,8 +81,7 @@ |
||
| 81 | 81 | $this->_d[]=$item; |
| 82 | 82 | ++$this->_c; |
| 83 | 83 | } |
| 84 | - } |
|
| 85 | - else if($data!==null) |
|
| 84 | + } else if($data!==null) |
|
| 86 | 85 | throw new TInvalidDataTypeException('queue_data_not_iterable'); |
| 87 | 86 | } |
| 88 | 87 | |
@@ -309,13 +309,11 @@ discard block |
||
| 309 | 309 | { |
| 310 | 310 | ini_set('session.use_cookies','0'); |
| 311 | 311 | ini_set('session.use_only_cookies','0'); |
| 312 | - } |
|
| 313 | - else if($value===THttpSessionCookieMode::Allow) |
|
| 312 | + } else if($value===THttpSessionCookieMode::Allow) |
|
| 314 | 313 | { |
| 315 | 314 | ini_set('session.use_cookies','1'); |
| 316 | 315 | ini_set('session.use_only_cookies','0'); |
| 317 | - } |
|
| 318 | - else |
|
| 316 | + } else |
|
| 319 | 317 | { |
| 320 | 318 | ini_set('session.use_cookies','1'); |
| 321 | 319 | ini_set('session.use_only_cookies','1'); |
@@ -368,8 +366,7 @@ discard block |
||
| 368 | 366 | { |
| 369 | 367 | ini_set('session.gc_probability',$value); |
| 370 | 368 | ini_set('session.gc_divisor','100'); |
| 371 | - } |
|
| 372 | - else |
|
| 369 | + } else |
|
| 373 | 370 | throw new TInvalidDataValueException('httpsession_gcprobability_invalid',$value); |
| 374 | 371 | } |
| 375 | 372 | } |
@@ -557,8 +554,7 @@ discard block |
||
| 557 | 554 | $value=$_SESSION[$key]; |
| 558 | 555 | unset($_SESSION[$key]); |
| 559 | 556 | return $value; |
| 560 | - } |
|
| 561 | - else |
|
| 557 | + } else |
|
| 562 | 558 | return null; |
| 563 | 559 | } |
| 564 | 560 | |
@@ -171,8 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | return '{'.$results.'}'; |
| 174 | - } |
|
| 175 | - else |
|
| 174 | + } else |
|
| 176 | 175 | { |
| 177 | 176 | foreach($value as $v) |
| 178 | 177 | { |
@@ -185,8 +184,7 @@ discard block |
||
| 185 | 184 | } |
| 186 | 185 | return '['.$results.']'; |
| 187 | 186 | } |
| 188 | - } |
|
| 189 | - else if(is_integer($value)) |
|
| 187 | + } else if(is_integer($value)) |
|
| 190 | 188 | return "$value"; |
| 191 | 189 | else if(is_float($value)) |
| 192 | 190 | { |
@@ -206,8 +204,7 @@ discard block |
||
| 206 | 204 | return str_replace($locale['decimal_point'], '.', "$value"); |
| 207 | 205 | break; |
| 208 | 206 | } |
| 209 | - } |
|
| 210 | - else if(is_object($value)) |
|
| 207 | + } else if(is_object($value)) |
|
| 211 | 208 | if ($value instanceof TJavaScriptLiteral) |
| 212 | 209 | return $value->toJavaScriptLiteral(); |
| 213 | 210 | else |
@@ -80,12 +80,10 @@ discard block |
||
| 80 | 80 | $name=urlencode($name.'[]'); |
| 81 | 81 | foreach($value as $v) |
| 82 | 82 | $url.=$amp.$name.'='.urlencode($v); |
| 83 | - } |
|
| 84 | - else |
|
| 83 | + } else |
|
| 85 | 84 | $url.=$amp.urlencode($name).'='.urlencode($value); |
| 86 | 85 | } |
| 87 | - } |
|
| 88 | - else |
|
| 86 | + } else |
|
| 89 | 87 | { |
| 90 | 88 | foreach($getItems as $name=>$value) |
| 91 | 89 | { |
@@ -93,8 +91,7 @@ discard block |
||
| 93 | 91 | { |
| 94 | 92 | foreach($value as $v) |
| 95 | 93 | $url.=$amp.$name.'[]='.$v; |
| 96 | - } |
|
| 97 | - else |
|
| 94 | + } else |
|
| 98 | 95 | $url.=$amp.$name.'='.$value; |
| 99 | 96 | } |
| 100 | 97 | } |
@@ -147,14 +144,12 @@ discard block |
||
| 147 | 144 | $getVariables[substr($name,0,$pos)][]=$value; |
| 148 | 145 | else |
| 149 | 146 | $getVariables[$name]=$value; |
| 150 | - } |
|
| 151 | - else |
|
| 147 | + } else |
|
| 152 | 148 | $getVariables[$path]=''; |
| 153 | 149 | } |
| 154 | 150 | } |
| 155 | 151 | return $getVariables; |
| 156 | - } |
|
| 157 | - else |
|
| 152 | + } else |
|
| 158 | 153 | return array(); |
| 159 | 154 | } |
| 160 | 155 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $status=TPropertyValue::ensureInteger($status); |
| 282 | 282 | if(isset(self::$HTTP_STATUS_CODES[$status])) { |
| 283 | 283 | $this->_reason=self::$HTTP_STATUS_CODES[$status]; |
| 284 | - }else{ |
|
| 284 | + } else{ |
|
| 285 | 285 | if($reason===null || $reason==='') { |
| 286 | 286 | throw new TInvalidDataValueException("response_status_reason_missing"); |
| 287 | 287 | } |
@@ -377,8 +377,7 @@ discard block |
||
| 377 | 377 | { |
| 378 | 378 | foreach($headers as $h) |
| 379 | 379 | header($h); |
| 380 | - } |
|
| 381 | - else |
|
| 380 | + } else |
|
| 382 | 381 | { |
| 383 | 382 | header('Pragma: public'); |
| 384 | 383 | header('Expires: 0'); |
@@ -488,13 +487,11 @@ discard block |
||
| 488 | 487 | { |
| 489 | 488 | $this->_bufferOutput = false; |
| 490 | 489 | ob_end_flush(); |
| 491 | - } |
|
| 492 | - else |
|
| 490 | + } else |
|
| 493 | 491 | ob_flush(); |
| 494 | 492 | flush(); |
| 495 | 493 | } |
| 496 | - } |
|
| 497 | - else |
|
| 494 | + } else |
|
| 498 | 495 | flush(); |
| 499 | 496 | } |
| 500 | 497 | |
@@ -645,8 +642,7 @@ discard block |
||
| 645 | 642 | $cookie->getSecure(), |
| 646 | 643 | $cookie->getHttpOnly() |
| 647 | 644 | ); |
| 648 | - } |
|
| 649 | - else { |
|
| 645 | + } else { |
|
| 650 | 646 | setcookie( |
| 651 | 647 | $cookie->getName(), |
| 652 | 648 | $cookie->getValue(), |
@@ -79,8 +79,7 @@ discard block |
||
| 79 | 79 | foreach($config['json'] as $id => $json) |
| 80 | 80 | $this->_services[$id] = $json; |
| 81 | 81 | } |
| 82 | - } |
|
| 83 | - else |
|
| 82 | + } else |
|
| 84 | 83 | { |
| 85 | 84 | foreach($config->getElementsByTagName('json') as $json) |
| 86 | 85 | { |
@@ -111,14 +110,11 @@ discard block |
||
| 111 | 110 | { |
| 112 | 111 | $properties = isset($serviceConfig['properties'])?$serviceConfig['properties']:array(); |
| 113 | 112 | $this->createJsonResponse($service,$properties,$serviceConfig); |
| 114 | - } |
|
| 115 | - else |
|
| 113 | + } else |
|
| 116 | 114 | throw new TConfigurationException('jsonservice_response_type_invalid',$id); |
| 117 | - } |
|
| 118 | - else |
|
| 115 | + } else |
|
| 119 | 116 | throw new TConfigurationException('jsonservice_class_required',$id); |
| 120 | - } |
|
| 121 | - else |
|
| 117 | + } else |
|
| 122 | 118 | { |
| 123 | 119 | $properties=$serviceConfig->getAttributes(); |
| 124 | 120 | if(($class=$properties->remove('class'))!==null) |
@@ -128,12 +124,10 @@ discard block |
||
| 128 | 124 | $this->createJsonResponse($service,$properties,$serviceConfig); |
| 129 | 125 | else |
| 130 | 126 | throw new TConfigurationException('jsonservice_response_type_invalid',$id); |
| 131 | - } |
|
| 132 | - else |
|
| 127 | + } else |
|
| 133 | 128 | throw new TConfigurationException('jsonservice_class_required',$id); |
| 134 | 129 | } |
| 135 | - } |
|
| 136 | - else |
|
| 130 | + } else |
|
| 137 | 131 | throw new THttpException(404,'jsonservice_provider_unknown',$id); |
| 138 | 132 | } |
| 139 | 133 | |
@@ -119,8 +119,7 @@ discard block |
||
| 119 | 119 | { |
| 120 | 120 | $this->raiseCallbackEvent($param); |
| 121 | 121 | return true; |
| 122 | - } |
|
| 123 | - else return false; |
|
| 122 | + } else return false; |
|
| 124 | 123 | } |
| 125 | 124 | |
| 126 | 125 | /** |
@@ -163,8 +162,7 @@ discard block |
||
| 163 | 162 | parent::render($writer); |
| 164 | 163 | if ($this->getActiveControl()->canUpdateClientSide()) |
| 165 | 164 | $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
| 166 | - } |
|
| 167 | - else |
|
| 165 | + } else |
|
| 168 | 166 | { |
| 169 | 167 | $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
| 170 | 168 | // If we update a TActiveTableRow on callback, we shouldn't update all childs, |
@@ -191,13 +191,11 @@ discard block |
||
| 191 | 191 | $control->setCaption($this->_caption); |
| 192 | 192 | $control->setCaptionAlign($this->_captionAlign); |
| 193 | 193 | } |
| 194 | - } |
|
| 195 | - else if($this->_repeatLayout===TRepeatLayout::Raw) |
|
| 194 | + } else if($this->_repeatLayout===TRepeatLayout::Raw) |
|
| 196 | 195 | { |
| 197 | 196 | $this->renderRawContents($writer,$user); |
| 198 | 197 | return; |
| 199 | - } |
|
| 200 | - else |
|
| 198 | + } else |
|
| 201 | 199 | $control=new TWebControl; |
| 202 | 200 | $control->setID($user->getClientID()); |
| 203 | 201 | $control->copyBaseAttributes($user); |
@@ -295,8 +293,7 @@ discard block |
||
| 295 | 293 | } |
| 296 | 294 | } |
| 297 | 295 | $writer->renderEndTag(); |
| 298 | - } |
|
| 299 | - else |
|
| 296 | + } else |
|
| 300 | 297 | { |
| 301 | 298 | $column=0; |
| 302 | 299 | for($i=0;$i<$itemCount;++$i) |
@@ -334,8 +331,7 @@ discard block |
||
| 334 | 331 | $rows=$itemCount; |
| 335 | 332 | $columns=1; |
| 336 | 333 | $lastColumns=1; |
| 337 | - } |
|
| 338 | - else |
|
| 334 | + } else |
|
| 339 | 335 | { |
| 340 | 336 | $columns=$this->_repeatColumns; |
| 341 | 337 | $rows=(int)(($itemCount+$columns-1)/$columns); |
@@ -391,8 +387,7 @@ discard block |
||
| 391 | 387 | $user->renderItem($writer,$this,'Separator',$index); |
| 392 | 388 | $writer->renderEndTag(); |
| 393 | 389 | $writer->writeLine(); |
| 394 | - } |
|
| 395 | - else if($columns>1) |
|
| 390 | + } else if($columns>1) |
|
| 396 | 391 | $writer->write("<td></td>\n"); |
| 397 | 392 | } |
| 398 | 393 | if($row==$rows-1) |
@@ -407,8 +402,7 @@ discard block |
||
| 407 | 402 | $writer->writeLine(); |
| 408 | 403 | } |
| 409 | 404 | $writer->renderEndTag(); |
| 410 | - } |
|
| 411 | - else |
|
| 405 | + } else |
|
| 412 | 406 | { |
| 413 | 407 | $renderedItems=0; |
| 414 | 408 | for($row=0;$row<$rows;++$row) |
@@ -473,8 +467,7 @@ discard block |
||
| 473 | 467 | $writer->renderEndTag(); |
| 474 | 468 | $writer->renderEndTag(); |
| 475 | 469 | $writer->renderEndTag(); |
| 476 | - } |
|
| 477 | - else |
|
| 470 | + } else |
|
| 478 | 471 | { |
| 479 | 472 | $user->renderItem($writer,$this,'Header',-1); |
| 480 | 473 | if($needBreak) |
@@ -505,8 +498,7 @@ discard block |
||
| 505 | 498 | $writer->renderEndTag(); |
| 506 | 499 | $writer->renderEndTag(); |
| 507 | 500 | $writer->renderEndTag(); |
| 508 | - } |
|
| 509 | - else |
|
| 501 | + } else |
|
| 510 | 502 | $user->renderItem($writer,$this,'Footer',-1); |
| 511 | 503 | $writer->writeLine(); |
| 512 | 504 | } |