@@ -373,13 +373,13 @@ discard block |
||
373 | 373 | if(!$this->_currentViewValid) |
374 | 374 | { |
375 | 375 | if($this->_currentView && $this->_currentViewIsFromDataSourceID) |
376 | - $this->_currentView->detachEventHandler('DataSourceViewChanged', [$this,'dataSourceViewChanged']); |
|
376 | + $this->_currentView->detachEventHandler('DataSourceViewChanged', [$this, 'dataSourceViewChanged']); |
|
377 | 377 | if(($dataSource = $this->determineDataSource()) !== null) |
378 | 378 | { |
379 | 379 | if(($view = $dataSource->getView($this->getDataMember())) === null) |
380 | 380 | throw new TInvalidDataValueException('databoundcontrol_datamember_invalid', $this->getDataMember()); |
381 | 381 | if($this->_currentViewIsFromDataSourceID = $this->getUsingDataSourceID()) |
382 | - $view->attachEventHandler('OnDataSourceViewChanged', [$this,'dataSourceViewChanged']); |
|
382 | + $view->attachEventHandler('OnDataSourceViewChanged', [$this, 'dataSourceViewChanged']); |
|
383 | 383 | $this->_currentView = $view; |
384 | 384 | } |
385 | 385 | else |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | { |
435 | 435 | parent::onInit($param); |
436 | 436 | $page = $this->getPage(); |
437 | - $page->attachEventHandler('OnPreLoad', [$this,'pagePreLoad']); |
|
437 | + $page->attachEventHandler('OnPreLoad', [$this, 'pagePreLoad']); |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | /** |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | if(is_array($value)) |
481 | 481 | $list->add($value); |
482 | 482 | else |
483 | - $list->add([$value,is_string($key)?$key:$value]); |
|
483 | + $list->add([$value, is_string($key) ? $key : $value]); |
|
484 | 484 | } |
485 | 485 | return $list; |
486 | 486 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | if($object instanceof TDataGridColumn) |
228 | 228 | $this->getColumns()->add($object); |
229 | 229 | else |
230 | - parent::addParsedObject($object); // this is needed by EmptyTemplate |
|
230 | + parent::addParsedObject($object); // this is needed by EmptyTemplate |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public function getItemCount() |
267 | 267 | { |
268 | - return $this->_items?$this->_items->getCount():0; |
|
268 | + return $this->_items ? $this->_items->getCount() : 0; |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | { |
534 | 534 | $item = $items->itemAt($current); |
535 | 535 | if($item->getItemType() !== TListItemType::EditItem) |
536 | - $item->setItemType($current % 2?TListItemType::AlternatingItem:TListItemType::Item); |
|
536 | + $item->setItemType($current % 2 ?TListItemType::AlternatingItem : TListItemType::Item); |
|
537 | 537 | } |
538 | 538 | if($value >= 0 && $value < $itemCount) |
539 | 539 | { |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | $items = $this->getItems(); |
583 | 583 | $itemCount = $items->getCount(); |
584 | 584 | if($current >= 0 && $current < $itemCount) |
585 | - $items->itemAt($current)->setItemType($current % 2?TListItemType::AlternatingItem:TListItemType::Item); |
|
585 | + $items->itemAt($current)->setItemType($current % 2 ?TListItemType::AlternatingItem : TListItemType::Item); |
|
586 | 586 | if($value >= 0 && $value < $itemCount) |
587 | 587 | $items->itemAt($value)->setItemType(TListItemType::EditItem); |
588 | 588 | } |
@@ -959,7 +959,7 @@ discard block |
||
959 | 959 | $column->initialize(); |
960 | 960 | $selectedIndex = $this->getSelectedItemIndex(); |
961 | 961 | $editIndex = $this->getEditItemIndex(); |
962 | - for($index = 0;$index < $itemCount;++$index) |
|
962 | + for($index = 0; $index < $itemCount; ++$index) |
|
963 | 963 | { |
964 | 964 | if($index === 0) |
965 | 965 | { |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | |
1021 | 1021 | $index = 0; |
1022 | 1022 | $allowPaging = $this->getAllowPaging() && ($data instanceof TPagedDataSource); |
1023 | - $dsIndex = $allowPaging?$data->getFirstIndexInPage():0; |
|
1023 | + $dsIndex = $allowPaging ? $data->getFirstIndexInPage() : 0; |
|
1024 | 1024 | $this->setViewState('DataSourceIndex', $dsIndex, 0); |
1025 | 1025 | if($columns->getCount()) |
1026 | 1026 | { |
@@ -1321,12 +1321,12 @@ discard block |
||
1321 | 1321 | $pageCount = $this->getPageCount(); |
1322 | 1322 | $pageIndex = $this->getCurrentPageIndex() + 1; |
1323 | 1323 | $maxButtonCount = $style->getPageButtonCount(); |
1324 | - $buttonCount = $maxButtonCount > $pageCount?$pageCount:$maxButtonCount; |
|
1324 | + $buttonCount = $maxButtonCount > $pageCount ? $pageCount : $maxButtonCount; |
|
1325 | 1325 | $startPageIndex = 1; |
1326 | 1326 | $endPageIndex = $buttonCount; |
1327 | 1327 | if($pageIndex > $endPageIndex) |
1328 | 1328 | { |
1329 | - $startPageIndex = ((int)(($pageIndex - 1) / $maxButtonCount)) * $maxButtonCount + 1; |
|
1329 | + $startPageIndex = ((int) (($pageIndex - 1) / $maxButtonCount)) * $maxButtonCount + 1; |
|
1330 | 1330 | if(($endPageIndex = $startPageIndex + $maxButtonCount - 1) > $pageCount) |
1331 | 1331 | $endPageIndex = $pageCount; |
1332 | 1332 | if($endPageIndex - $startPageIndex + 1 < $maxButtonCount) |
@@ -1350,7 +1350,7 @@ discard block |
||
1350 | 1350 | $controls->add("\n"); |
1351 | 1351 | } |
1352 | 1352 | |
1353 | - for($i = $startPageIndex;$i <= $endPageIndex;++$i) |
|
1353 | + for($i = $startPageIndex; $i <= $endPageIndex; ++$i) |
|
1354 | 1354 | { |
1355 | 1355 | if($i === $pageIndex) |
1356 | 1356 | { |
@@ -1539,7 +1539,7 @@ discard block |
||
1539 | 1539 | { |
1540 | 1540 | $n = $this->_columns->getCount(); |
1541 | 1541 | $cells = $item->getCells(); |
1542 | - for($i = 0;$i < $n;++$i) |
|
1542 | + for($i = 0; $i < $n; ++$i) |
|
1543 | 1543 | { |
1544 | 1544 | $cell = $cells->itemAt($i); |
1545 | 1545 | $column = $this->_columns->itemAt($i); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | parent::addAttributesToRender($writer); |
42 | 42 | if(($scope = $this->getScope()) !== TTableHeaderScope::NotSet) |
43 | - $writer->addAttribute('scope', $scope === TTableHeaderScope::Row?'row':'col'); |
|
43 | + $writer->addAttribute('scope', $scope === TTableHeaderScope::Row ? 'row' : 'col'); |
|
44 | 44 | if(($text = $this->getAbbreviatedText()) !== '') |
45 | 45 | $writer->addAttribute('abbr', $text); |
46 | 46 | if(($text = $this->getCategoryText()) !== '') |
@@ -110,7 +110,7 @@ |
||
110 | 110 | if(($border = $this->getBorderWidth()) === '') |
111 | 111 | $border = 1; |
112 | 112 | else |
113 | - $border = (int)$border; |
|
113 | + $border = (int) $border; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | $writer->addAttribute('border', "$border"); |
@@ -119,7 +119,7 @@ |
||
119 | 119 | |
120 | 120 | private function generateTokenHash($token) |
121 | 121 | { |
122 | - for($h = 0,$i = strlen($token) - 1;$i >= 0;--$i) |
|
122 | + for($h = 0, $i = strlen($token) - 1; $i >= 0; --$i) |
|
123 | 123 | $h += ord($token[$i]); |
124 | 124 | return $h; |
125 | 125 | } |
@@ -95,14 +95,14 @@ |
||
95 | 95 | if(($ret = @parse_url($uri)) !== false) |
96 | 96 | { |
97 | 97 | // decoding??? |
98 | - $this->_scheme = isset($ret['scheme'])?$ret['scheme']:''; |
|
99 | - $this->_host = isset($ret['host'])?$ret['host']:''; |
|
100 | - $this->_port = isset($ret['port'])?$ret['port']:''; |
|
101 | - $this->_user = isset($ret['user'])?$ret['user']:''; |
|
102 | - $this->_pass = isset($ret['pass'])?$ret['pass']:''; |
|
103 | - $this->_path = isset($ret['path'])?$ret['path']:''; |
|
104 | - $this->_query = isset($ret['query'])?$ret['query']:''; |
|
105 | - $this->_fragment = isset($ret['fragment'])?$ret['fragment']:''; |
|
98 | + $this->_scheme = isset($ret['scheme']) ? $ret['scheme'] : ''; |
|
99 | + $this->_host = isset($ret['host']) ? $ret['host'] : ''; |
|
100 | + $this->_port = isset($ret['port']) ? $ret['port'] : ''; |
|
101 | + $this->_user = isset($ret['user']) ? $ret['user'] : ''; |
|
102 | + $this->_pass = isset($ret['pass']) ? $ret['pass'] : ''; |
|
103 | + $this->_path = isset($ret['path']) ? $ret['path'] : ''; |
|
104 | + $this->_query = isset($ret['query']) ? $ret['query'] : ''; |
|
105 | + $this->_fragment = isset($ret['fragment']) ? $ret['fragment'] : ''; |
|
106 | 106 | $this->_uri = $uri; |
107 | 107 | } |
108 | 108 | else |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | if(!$this->_started) |
141 | 141 | { |
142 | 142 | if($this->_customStorage) |
143 | - session_set_save_handler([$this,'_open'], [$this,'_close'], [$this,'_read'], [$this,'_write'], [$this,'_destroy'], [$this,'_gc']); |
|
143 | + session_set_save_handler([$this, '_open'], [$this, '_close'], [$this, '_read'], [$this, '_write'], [$this, '_destroy'], [$this, '_gc']); |
|
144 | 144 | if($this->_cookie !== null) |
145 | 145 | session_set_cookie_params($this->_cookie->getExpire(), $this->_cookie->getPath(), $this->_cookie->getDomain(), $this->_cookie->getSecure(), $this->_cookie->getHttpOnly()); |
146 | 146 | if(ini_get('session.auto_start') !== '1') |
@@ -405,9 +405,9 @@ discard block |
||
405 | 405 | else |
406 | 406 | { |
407 | 407 | $value = TPropertyValue::ensureBoolean($value); |
408 | - if ($value && $this->getCookieMode() == THttpSessionCookieMode::Only) |
|
408 | + if($value && $this->getCookieMode() == THttpSessionCookieMode::Only) |
|
409 | 409 | throw new TInvalidOperationException('httpsession_transid_cookieonly'); |
410 | - ini_set('session.use_trans_sid', $value?'1':'0'); |
|
410 | + ini_set('session.use_trans_sid', $value ? '1' : '0'); |
|
411 | 411 | } |
412 | 412 | } |
413 | 413 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | //mark untranslated text |
66 | 66 | if($ps = $config['marker']) |
67 | - self::$formatters[$catalogue]->setUntranslatedPS([$ps,$ps]); |
|
67 | + self::$formatters[$catalogue]->setUntranslatedPS([$ps, $ps]); |
|
68 | 68 | |
69 | 69 | //save the message on end request |
70 | 70 | // Do it only once ! |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | if($onceonly) |
98 | 98 | { |
99 | - foreach (self::$formatters as $catalogue => $formatter) |
|
99 | + foreach(self::$formatters as $catalogue => $formatter) |
|
100 | 100 | { |
101 | 101 | $app = Prado::getApplication()->getGlobalization(); |
102 | 102 | $config = $app->getTranslationConfiguration(); |
@@ -233,13 +233,13 @@ |
||
233 | 233 | if(!empty($culture) && $app->getCulture() != $culture) |
234 | 234 | { |
235 | 235 | $formatter = new NumberFormat($culture); |
236 | - return $formatter->format($this->getValue(),$pattern, |
|
236 | + return $formatter->format($this->getValue(), $pattern, |
|
237 | 237 | $this->getCurrency(), |
238 | 238 | $this->getCharset()); |
239 | 239 | } |
240 | 240 | |
241 | 241 | //return the application wide culture formatted number. |
242 | - return self::$formatter->format($this->getValue(),$pattern, |
|
242 | + return self::$formatter->format($this->getValue(), $pattern, |
|
243 | 243 | $this->getCurrency(), |
244 | 244 | $this->getCharset()); |
245 | 245 | } |