@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | public function indexOf($item) |
325 | 325 | { |
326 | 326 | $c = $this->getCount(); |
327 | - for ($i = 0;$i < $c;++$i) { |
|
327 | + for ($i = 0; $i < $c; ++$i) { |
|
328 | 328 | if ($this->itemAt($i) === $item) { |
329 | 329 | return $i; |
330 | 330 | } |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | { |
363 | 363 | $c = $this->getCount(); |
364 | 364 | $array = []; |
365 | - for ($i = 0;$i < $c;++$i) { |
|
365 | + for ($i = 0; $i < $c; ++$i) { |
|
366 | 366 | $array[$i] = $this->itemAt($i); |
367 | 367 | } |
368 | 368 | return $array; |
@@ -289,7 +289,7 @@ |
||
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
292 | - * @return Iterator iterator |
|
292 | + * @return \ArrayIterator iterator |
|
293 | 293 | */ |
294 | 294 | public function getIterator() |
295 | 295 | { |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | if (($separatorStyle = $this->getViewState('SeparatorStyle', null)) !== null && $this->getHasSeparators()) { |
1341 | 1341 | $controls = $this->getControls(); |
1342 | 1342 | $count = $controls->getCount(); |
1343 | - for ($i = $this->_header ? 2 : 1;$i < $count;$i += 2) { |
|
1343 | + for ($i = $this->_header ? 2 : 1; $i < $count; $i += 2) { |
|
1344 | 1344 | if (($separator = $controls->itemAt($i)) instanceof IStyleable) { |
1345 | 1345 | $separator->getStyle()->mergeWith($separatorStyle); |
1346 | 1346 | } |
@@ -1398,7 +1398,7 @@ discard block |
||
1398 | 1398 | $editIndex = $this->getEditItemIndex(); |
1399 | 1399 | $hasSeparator = $this->_separatorTemplate !== null || $this->getSeparatorRenderer() !== ''; |
1400 | 1400 | $this->_header = $this->createItemInternal(-1, TListItemType::Header); |
1401 | - for ($i = 0;$i < $itemCount;++$i) { |
|
1401 | + for ($i = 0; $i < $itemCount; ++$i) { |
|
1402 | 1402 | if ($hasSeparator && $i > 0) { |
1403 | 1403 | $this->createItemInternal($i - 1, TListItemType::Separator); |
1404 | 1404 | } |
@@ -1131,7 +1131,7 @@ discard block |
||
1131 | 1131 | * This method invokes {@link createItem} to create a new datalist item. |
1132 | 1132 | * @param int $itemIndex zero-based item index. |
1133 | 1133 | * @param TListItemType $itemType item type |
1134 | - * @return TControl the created item, null if item is not created |
|
1134 | + * @return \Prado\TComponent|null the created item, null if item is not created |
|
1135 | 1135 | */ |
1136 | 1136 | private function createItemInternal($itemIndex, $itemType) |
1137 | 1137 | { |
@@ -1151,7 +1151,7 @@ discard block |
||
1151 | 1151 | * @param int $itemIndex zero-based item index. |
1152 | 1152 | * @param TListItemType $itemType item type |
1153 | 1153 | * @param mixed $dataItem data to be associated with the item |
1154 | - * @return TControl the created item, null if item is not created |
|
1154 | + * @return \Prado\TComponent|null the created item, null if item is not created |
|
1155 | 1155 | */ |
1156 | 1156 | private function createItemWithDataInternal($itemIndex, $itemType, $dataItem) |
1157 | 1157 | { |
@@ -1192,6 +1192,9 @@ discard block |
||
1192 | 1192 | } |
1193 | 1193 | } |
1194 | 1194 | |
1195 | + /** |
|
1196 | + * @param integer $itemIndex |
|
1197 | + */ |
|
1195 | 1198 | private function getEditItemDisplay($itemIndex) |
1196 | 1199 | { |
1197 | 1200 | if (($classPath = $this->getEditItemRenderer()) === '' && $this->_editItemTemplate === null) { |
@@ -1205,7 +1208,7 @@ discard block |
||
1205 | 1208 | * Creates a datalist item instance based on the item type and index. |
1206 | 1209 | * @param int $itemIndex zero-based item index |
1207 | 1210 | * @param TListItemType $itemType item type |
1208 | - * @return TControl created datalist item |
|
1211 | + * @return null|\Prado\TComponent created datalist item |
|
1209 | 1212 | */ |
1210 | 1213 | protected function createItem($itemIndex, $itemType) |
1211 | 1214 | { |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | } |
944 | 944 | $selectedIndex = $this->getSelectedItemIndex(); |
945 | 945 | $editIndex = $this->getEditItemIndex(); |
946 | - for ($index = 0;$index < $itemCount;++$index) { |
|
946 | + for ($index = 0; $index < $itemCount; ++$index) { |
|
947 | 947 | if ($index === 0) { |
948 | 948 | if ($allowPaging) { |
949 | 949 | $this->_topPager = $this->createPager(); |
@@ -1310,7 +1310,7 @@ discard block |
||
1310 | 1310 | $controls->add("\n"); |
1311 | 1311 | } |
1312 | 1312 | |
1313 | - for ($i = $startPageIndex;$i <= $endPageIndex;++$i) { |
|
1313 | + for ($i = $startPageIndex; $i <= $endPageIndex; ++$i) { |
|
1314 | 1314 | if ($i === $pageIndex) { |
1315 | 1315 | $label = $this->createPagerButton($pager, $buttonType, false, "$i", '', ''); |
1316 | 1316 | $controls->add($label); |
@@ -1493,7 +1493,7 @@ discard block |
||
1493 | 1493 | if ($this->_columns && $itemType !== TListItemType::Pager) { |
1494 | 1494 | $n = $this->_columns->getCount(); |
1495 | 1495 | $cells = $item->getCells(); |
1496 | - for ($i = 0;$i < $n;++$i) { |
|
1496 | + for ($i = 0; $i < $n; ++$i) { |
|
1497 | 1497 | $cell = $cells->itemAt($i); |
1498 | 1498 | $column = $this->_columns->itemAt($i); |
1499 | 1499 | if (!$column->getVisible()) { |
@@ -1119,6 +1119,11 @@ discard block |
||
1119 | 1119 | return new TDataGridItem($itemIndex, $dataSourceIndex, $itemType); |
1120 | 1120 | } |
1121 | 1121 | |
1122 | + /** |
|
1123 | + * @param integer $itemIndex |
|
1124 | + * @param boolean $dataBind |
|
1125 | + * @param TList $columns |
|
1126 | + */ |
|
1122 | 1127 | private function createItemInternal($itemIndex, $dataSourceIndex, $itemType, $dataBind, $dataItem, $columns) |
1123 | 1128 | { |
1124 | 1129 | $item = $this->createItem($itemIndex, $dataSourceIndex, $itemType); |
@@ -1192,7 +1197,7 @@ discard block |
||
1192 | 1197 | * Depending on the button type, a TLinkButton or a TButton may be created. |
1193 | 1198 | * If it is enabled (clickable), its command name and parameter will also be set. |
1194 | 1199 | * Derived classes may override this method to create additional types of buttons, such as TImageButton. |
1195 | - * @param mixed $pager the container pager instance of TActiveDatagridPager |
|
1200 | + * @param TDataGridPager $pager the container pager instance of TActiveDatagridPager |
|
1196 | 1201 | * @param string $buttonType button type, either LinkButton or PushButton |
1197 | 1202 | * @param bool $enabled whether the button should be enabled |
1198 | 1203 | * @param string $text caption of the button |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | // render items |
189 | 189 | $hasSeparators = $user->getHasSeparators(); |
190 | 190 | $itemCount = $user->getItemCount(); |
191 | - for ($i = 0;$i < $itemCount;++$i) { |
|
191 | + for ($i = 0; $i < $itemCount; ++$i) { |
|
192 | 192 | $user->renderItem($writer, $this, 'Item', $i); |
193 | 193 | if ($hasSeparators && $i != $itemCount - 1) { |
194 | 194 | $user->renderItem($writer, $this, 'Separator', $i); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | if ($tableLayout) { |
222 | 222 | $writer->renderBeginTag('tbody'); |
223 | 223 | $column = 0; |
224 | - for ($i = 0;$i < $itemCount;++$i) { |
|
224 | + for ($i = 0; $i < $itemCount; ++$i) { |
|
225 | 225 | if ($column == 0) { |
226 | 226 | $writer->renderBeginTag('tr'); |
227 | 227 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | if ($hasSeparators) { |
248 | 248 | $restColumns = $restColumns ? $restColumns + $restColumns + 1 : 1; |
249 | 249 | } |
250 | - for ($j = 0;$j < $restColumns;++$j) { |
|
250 | + for ($j = 0; $j < $restColumns; ++$j) { |
|
251 | 251 | $writer->write("<td></td>\n"); |
252 | 252 | } |
253 | 253 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $writer->renderEndTag(); |
261 | 261 | } else { |
262 | 262 | $column = 0; |
263 | - for ($i = 0;$i < $itemCount;++$i) { |
|
263 | + for ($i = 0; $i < $itemCount; ++$i) { |
|
264 | 264 | $user->renderItem($writer, $this, 'Item', $i); |
265 | 265 | if ($hasSeparators && $i != $itemCount - 1) { |
266 | 266 | $user->renderItem($writer, $this, 'Separator', $i); |
@@ -314,10 +314,10 @@ discard block |
||
314 | 314 | if ($tableLayout) { |
315 | 315 | $writer->renderBeginTag('tbody'); |
316 | 316 | $renderedItems = 0; |
317 | - for ($row = 0;$row < $rows;++$row) { |
|
317 | + for ($row = 0; $row < $rows; ++$row) { |
|
318 | 318 | $index = $row; |
319 | 319 | $writer->renderBeginTag('tr'); |
320 | - for ($col = 0;$col < $columns;++$col) { |
|
320 | + for ($col = 0; $col < $columns; ++$col) { |
|
321 | 321 | if ($renderedItems >= $itemCount) { |
322 | 322 | break; |
323 | 323 | } |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | if ($hasSeparators) { |
363 | 363 | $restColumns += $restColumns; |
364 | 364 | } |
365 | - for ($col = 0;$col < $restColumns;++$col) { |
|
365 | + for ($col = 0; $col < $restColumns; ++$col) { |
|
366 | 366 | $writer->write("<td></td>\n"); |
367 | 367 | } |
368 | 368 | } |
@@ -372,9 +372,9 @@ discard block |
||
372 | 372 | $writer->renderEndTag(); |
373 | 373 | } else { |
374 | 374 | $renderedItems = 0; |
375 | - for ($row = 0;$row < $rows;++$row) { |
|
375 | + for ($row = 0; $row < $rows; ++$row) { |
|
376 | 376 | $index = $row; |
377 | - for ($col = 0;$col < $columns;++$col) { |
|
377 | + for ($col = 0; $col < $columns; ++$col) { |
|
378 | 378 | if ($renderedItems >= $itemCount) { |
379 | 379 | break; |
380 | 380 | } |
@@ -591,7 +591,7 @@ |
||
591 | 591 | $controls->add("\n"); |
592 | 592 | } |
593 | 593 | |
594 | - for ($i = $startPageIndex;$i <= $endPageIndex;++$i) { |
|
594 | + for ($i = $startPageIndex; $i <= $endPageIndex; ++$i) { |
|
595 | 595 | if ($i === $pageIndex) { |
596 | 596 | $label = $this->createPagerButton($buttonType, false, "$i", self::CMD_PAGE, ''); |
597 | 597 | $controls->add($label); |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | $formatter = new TSimpleDateFormatter($this->getDateFormat()); |
719 | 719 | $days = []; |
720 | 720 | $requiresPadding = $formatter->getDayPattern() === 'dd'; |
721 | - for ($i = 1;$i <= 31;$i++) { |
|
721 | + for ($i = 1; $i <= 31; $i++) { |
|
722 | 722 | $days[$i] = $requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
723 | 723 | } |
724 | 724 | return $days; |
@@ -761,12 +761,12 @@ discard block |
||
761 | 761 | case 'MMM': return $info->getAbbreviatedMonthNames(); |
762 | 762 | case 'MM': |
763 | 763 | $array = []; |
764 | - for ($i = 1;$i <= 12;$i++) { |
|
764 | + for ($i = 1; $i <= 12; $i++) { |
|
765 | 765 | $array[$i - 1] = $i < 10 ? '0' . $i : $i; |
766 | 766 | } |
767 | 767 | return $array; |
768 | 768 | case 'M': |
769 | - $array = []; for ($i = 1;$i <= 12;$i++) { |
|
769 | + $array = []; for ($i = 1; $i <= 12; $i++) { |
|
770 | 770 | $array[$i - 1] = $i; |
771 | 771 | } |
772 | 772 | return $array; |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | * Loads date from drop down list data. |
484 | 484 | * @param string $key the key that can be used to retrieve data from the input data collection |
485 | 485 | * @param array $values the input data collection |
486 | - * @return array the date selected |
|
486 | + * @return string the date selected |
|
487 | 487 | */ |
488 | 488 | protected function getDateFromPostData($key, $values) |
489 | 489 | { |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | } |
596 | 596 | |
597 | 597 | /** |
598 | - * @return DateTimeFormatInfo date time format information for the current culture. |
|
598 | + * @return \Prado\I18N\core\DateTimeFormatInfo date time format information for the current culture. |
|
599 | 599 | */ |
600 | 600 | protected function getLocalizedCalendarInfo() |
601 | 601 | { |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | /** |
648 | 648 | * Renders the calendar drop down list depending on the DateFormat pattern. |
649 | 649 | * @param THtmlWriter $writer the Html writer to render the drop down lists. |
650 | - * @param array $date the current selected date |
|
650 | + * @param \DateTime $date the current selected date |
|
651 | 651 | */ |
652 | 652 | protected function renderCalendarSelections($writer, $date) |
653 | 653 | { |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | * Returns the localized month names that depends on the month format pattern. |
756 | 756 | * "MMMM" will return the month names, "MM" or "MMM" return abbr. month names |
757 | 757 | * and "M" return month digits. |
758 | - * @param DateTimeFormatInfo $info localized date format information. |
|
758 | + * @param \Prado\I18N\core\DateTimeFormatInfo $info localized date format information. |
|
759 | 759 | * @return array localized month names. |
760 | 760 | */ |
761 | 761 | protected function getLocalizedMonthNames($info) |
@@ -388,7 +388,7 @@ |
||
388 | 388 | public function onPreRender($param) |
389 | 389 | { |
390 | 390 | parent::onPreRender($param); |
391 | - $this->getActiveView(); // determine the active view |
|
391 | + $this->getActiveView(); // determine the active view |
|
392 | 392 | $this->registerStyleSheet(); |
393 | 393 | |
394 | 394 | $page = $this->getPage(); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | { |
461 | 461 | if ($this->_items) { |
462 | 462 | $n = $this->_items->getCount(); |
463 | - for ($i = 0;$i < $n;++$i) { |
|
463 | + for ($i = 0; $i < $n; ++$i) { |
|
464 | 464 | if ($this->_items->itemAt($i)->getSelected()) { |
465 | 465 | return $i; |
466 | 466 | } |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | $selections = []; |
498 | 498 | if ($this->_items) { |
499 | 499 | $n = $this->_items->getCount(); |
500 | - for ($i = 0;$i < $n;++$i) { |
|
500 | + for ($i = 0; $i < $n; ++$i) { |
|
501 | 501 | if ($this->_items->itemAt($i)->getSelected()) { |
502 | 502 | $selections[] = $i; |
503 | 503 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | /** |
263 | 263 | * Creates a collection object to hold list items. |
264 | 264 | * This method may be overriden to create a customized collection. |
265 | - * @return TListItemCollection the collection object |
|
265 | + * @return \Prado\Collections\TListItemCollection the collection object |
|
266 | 266 | */ |
267 | 267 | protected function createListItemCollection() |
268 | 268 | { |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | * Raises OnSelectedIndexChanged event when selection is changed. |
739 | 739 | * This method is invoked when the list control has its selection changed |
740 | 740 | * by end-users. |
741 | - * @param TEventParameter $param event parameter |
|
741 | + * @param null|integer $param event parameter |
|
742 | 742 | */ |
743 | 743 | public function onSelectedIndexChanged($param) |
744 | 744 | { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | */ |
387 | 387 | protected function getTokenImageOptions() |
388 | 388 | { |
389 | - $privateKey = $this->getPrivateKey(); // call this method to ensure private key is generated |
|
389 | + $privateKey = $this->getPrivateKey(); // call this method to ensure private key is generated |
|
390 | 390 | $token = $this->getToken(); |
391 | 391 | $options = []; |
392 | 392 | $options['publicKey'] = $this->getPublicKey(); |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $hexLength = strlen($hex); |
474 | 474 | $base = strlen($alphabet); |
475 | 475 | $result = ''; |
476 | - for ($i = 0;$i < $hexLength;$i += 6) { |
|
476 | + for ($i = 0; $i < $hexLength; $i += 6) { |
|
477 | 477 | $number = hexdec(substr($hex, $i, 6)); |
478 | 478 | while ($number) { |
479 | 479 | $result .= $alphabet[$number % $base]; |
@@ -449,7 +449,7 @@ |
||
449 | 449 | * Generates the token. |
450 | 450 | * @param string $publicKey public key |
451 | 451 | * @param string $privateKey private key |
452 | - * @param mixed $alphabet |
|
452 | + * @param string $alphabet |
|
453 | 453 | * @param int $tokenLength the length of the token |
454 | 454 | * @param bool $caseSensitive whether the token is case sensitive |
455 | 455 | * @return string the token generated. |