@@ -107,7 +107,7 @@ |
||
107 | 107 | if (($total = count($fkObjects)) > 0) { |
108 | 108 | $source = $this->getSourceRecord(); |
109 | 109 | $fkeys = $this->findForeignKeys($fkObjects[0], $source); |
110 | - for ($i = 0;$i < $total;$i++) { |
|
110 | + for ($i = 0; $i < $total; $i++) { |
|
111 | 111 | foreach ($fkeys as $fKey => $srcKey) { |
112 | 112 | $fkObjects[$i]->setColumnValue($fKey, $source->getColumnValue($srcKey)); |
113 | 113 | } |
@@ -236,8 +236,7 @@ discard block |
||
236 | 236 | public function runQueryForList($connection, $parameter, $sql, $result, $delegate = null) |
237 | 237 | { |
238 | 238 | $registry = $this->getManager()->getTypeHandlers(); |
239 | - $list = $result instanceof \ArrayAccess ? $result : |
|
240 | - $this->_statement->createInstanceOfListClass($registry); |
|
239 | + $list = $result instanceof \ArrayAccess ? $result : $this->_statement->createInstanceOfListClass($registry); |
|
241 | 240 | $connection->setActive(true); |
242 | 241 | $reader = $sql->query(); |
243 | 242 | //$reader = $this->executeSQLQueryLimit($connection, $sql, $max, $skip); |
@@ -313,8 +312,7 @@ discard block |
||
313 | 312 | foreach ($reader as $row) { |
314 | 313 | $obj = $this->applyResultMap($row); |
315 | 314 | $key = TPropertyAccess::get($obj, $keyProperty); |
316 | - $value = ($valueProperty === null) ? $obj : |
|
317 | - TPropertyAccess::get($obj, $valueProperty); |
|
315 | + $value = ($valueProperty === null) ? $obj : TPropertyAccess::get($obj, $valueProperty); |
|
318 | 316 | $param = new TResultSetMapItemParameter($key, $value, $parameter, $map); |
319 | 317 | $this->raiseRowDelegate($delegate, $param); |
320 | 318 | } |
@@ -323,8 +321,7 @@ discard block |
||
323 | 321 | foreach ($reader as $row) { |
324 | 322 | $obj = $this->applyResultMap($row); |
325 | 323 | $key = TPropertyAccess::get($obj, $keyProperty); |
326 | - $map[$key] = ($valueProperty === null) ? $obj : |
|
327 | - TPropertyAccess::get($obj, $valueProperty); |
|
324 | + $map[$key] = ($valueProperty === null) ? $obj : TPropertyAccess::get($obj, $valueProperty); |
|
328 | 325 | } |
329 | 326 | } |
330 | 327 | $this->onExecuteQuery($command); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
100 | - * @return TSqlMapper The SqlMap used by this MappedStatement |
|
100 | + * @return TSqlMapManager The SqlMap used by this MappedStatement |
|
101 | 101 | */ |
102 | 102 | public function getManager() |
103 | 103 | { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Creates a new mapped statement. |
125 | - * @param TSqlMapper $sqlMap an sqlmap. |
|
125 | + * @param TSqlMapManager $sqlMap an sqlmap. |
|
126 | 126 | * @param TSqlMapStatement $statement An SQL statement. |
127 | 127 | */ |
128 | 128 | public function __construct(TSqlMapManager $sqlMap, TSqlMapStatement $statement) |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * Raises delegate handler. |
338 | 338 | * This method is invoked for each new list item. It is the responsibility |
339 | 339 | * of the handler to add the item to the list. |
340 | - * @param object $handler event parameter |
|
340 | + * @param callable $handler event parameter |
|
341 | 341 | * @param mixed $param |
342 | 342 | */ |
343 | 343 | protected function raiseRowDelegate($handler, $param) |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | * Execute the select key statement, used to obtain last insert ID. |
469 | 469 | * @param IDbConnection $connection database connection |
470 | 470 | * @param mixed $parameter insert statement parameter |
471 | - * @param TSqlMapSelectKey $selectKey select key statement |
|
471 | + * @param \Prado\Data\SqlMap\Configuration\TSqlMapSelectKey $selectKey select key statement |
|
472 | 472 | * @return string last insert ID. |
473 | 473 | */ |
474 | 474 | protected function executeSelectKey($connection, $parameter, $selectKey) |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | /** |
596 | 596 | * Apply the result to a TList or an array. |
597 | 597 | * @param array $row a result set row retrieved from the database |
598 | - * @param object $resultObject result object, array or list |
|
598 | + * @param \ArrayAccess $resultObject result object, array or list |
|
599 | 599 | * @return object result filled with data. |
600 | 600 | */ |
601 | 601 | protected function fillResultArrayList($row, $resultObject) |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | * Fills the result object according to result mappings. |
641 | 641 | * @param string $resultMapName result map name. |
642 | 642 | * @param array $row a result set row retrieved from the database |
643 | - * @param null|mixed $parentGroup |
|
643 | + * @param null|string $parentGroup |
|
644 | 644 | * @param null|&object $resultObject result object to fill, will create new instances if required. |
645 | 645 | * @return object result object filled with data. |
646 | 646 | */ |
@@ -67,7 +67,7 @@ |
||
67 | 67 | 'text' => $this->getText(), |
68 | 68 | 'click' => new TJavaScriptLiteral( |
69 | 69 | "function(){new Prado.Callback('" . $this->getUniqueID() . "', 'onClick');}" |
70 | - )] ; |
|
70 | + )]; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -114,17 +114,17 @@ discard block |
||
114 | 114 | * Indexes for the rare fields. |
115 | 115 | * In order to save memory, rare fields will only be created if they are needed. |
116 | 116 | */ |
117 | - const RF_CONTROLS = 0; // child controls |
|
118 | - const RF_CHILD_STATE = 1; // child state field |
|
119 | - const RF_NAMED_CONTROLS = 2; // list of controls whose namingcontainer is this control |
|
120 | - const RF_NAMED_CONTROLS_ID = 3; // counter for automatic id |
|
121 | - const RF_SKIN_ID = 4; // skin ID |
|
122 | - const RF_DATA_BINDINGS = 5; // data bindings |
|
123 | - const RF_EVENTS = 6; // event handlers |
|
124 | - const RF_CONTROLSTATE = 7; // controlstate |
|
125 | - const RF_NAMED_OBJECTS = 8; // controls declared with ID on template |
|
126 | - const RF_ADAPTER = 9; // adapter |
|
127 | - const RF_AUTO_BINDINGS = 10; // auto data bindings |
|
117 | + const RF_CONTROLS = 0; // child controls |
|
118 | + const RF_CHILD_STATE = 1; // child state field |
|
119 | + const RF_NAMED_CONTROLS = 2; // list of controls whose namingcontainer is this control |
|
120 | + const RF_NAMED_CONTROLS_ID = 3; // counter for automatic id |
|
121 | + const RF_SKIN_ID = 4; // skin ID |
|
122 | + const RF_DATA_BINDINGS = 5; // data bindings |
|
123 | + const RF_EVENTS = 6; // event handlers |
|
124 | + const RF_CONTROLSTATE = 7; // controlstate |
|
125 | + const RF_NAMED_OBJECTS = 8; // controls declared with ID on template |
|
126 | + const RF_ADAPTER = 9; // adapter |
|
127 | + const RF_AUTO_BINDINGS = 10; // auto data bindings |
|
128 | 128 | |
129 | 129 | /** |
130 | 130 | * @var string control ID |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | public function getUniqueID() |
403 | 403 | { |
404 | 404 | if ($this->_uid === '' || $this->_uid === null) { // need to build the UniqueID |
405 | - $this->_uid = ''; // set to not-null, so that clearCachedUniqueID() may take action |
|
405 | + $this->_uid = ''; // set to not-null, so that clearCachedUniqueID() may take action |
|
406 | 406 | if ($namingContainer = $this->getNamingContainer()) { |
407 | 407 | if ($this->getPage() === $namingContainer) { |
408 | 408 | return ($this->_uid = $this->_id); |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | public function getVisible($checkParents = true) |
569 | 569 | { |
570 | 570 | if ($checkParents) { |
571 | - for ($control = $this;$control;$control = $control->_parent) { |
|
571 | + for ($control = $this; $control; $control = $control->_parent) { |
|
572 | 572 | if (!$control->getVisible(false)) { |
573 | 573 | return false; |
574 | 574 | } |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | public function getEnabled($checkParents = false) |
601 | 601 | { |
602 | 602 | if ($checkParents) { |
603 | - for ($control = $this;$control;$control = $control->_parent) { |
|
603 | + for ($control = $this; $control; $control = $control->_parent) { |
|
604 | 604 | if (!$control->getViewState('Enabled', true)) { |
605 | 605 | return false; |
606 | 606 | } |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | public function getEnableViewState($checkParents = false) |
703 | 703 | { |
704 | 704 | if ($checkParents) { |
705 | - for ($control = $this;$control !== null;$control = $control->getParent()) { |
|
705 | + for ($control = $this; $control !== null; $control = $control->getParent()) { |
|
706 | 706 | if ($control->_flags & self::IS_DISABLE_VIEWSTATE) { |
707 | 707 | return false; |
708 | 708 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * the control ID will take the precedence. |
215 | 215 | * |
216 | 216 | * @param string $name the property name or control ID |
217 | - * @return bool wether the control or property exists |
|
217 | + * @return boolean|null wether the control or property exists |
|
218 | 218 | * @see __get |
219 | 219 | */ |
220 | 220 | public function __isset($name) |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | } |
472 | 472 | |
473 | 473 | /** |
474 | - * @return bool if a skin is applied. |
|
474 | + * @return integer if a skin is applied. |
|
475 | 475 | */ |
476 | 476 | public function getIsSkinApplied() |
477 | 477 | { |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | } |
649 | 649 | |
650 | 650 | /** |
651 | - * @param mixed $name |
|
651 | + * @param string $name |
|
652 | 652 | * @return bool whether the named attribute exists |
653 | 653 | */ |
654 | 654 | public function hasAttribute($name) |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | } |
662 | 662 | |
663 | 663 | /** |
664 | - * @param mixed $name |
|
664 | + * @param string $name |
|
665 | 665 | * @return string attribute value, null if attribute does not exist |
666 | 666 | */ |
667 | 667 | public function getAttribute($name) |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | } |
699 | 699 | |
700 | 700 | /** |
701 | - * @param mixed $checkParents |
|
701 | + * @param boolean $checkParents |
|
702 | 702 | * @return bool whether viewstate is enabled |
703 | 703 | */ |
704 | 704 | public function getEnableViewState($checkParents = false) |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | * This function is mainly used in defining getter functions for control properties |
734 | 734 | * that must be kept in controlstate. |
735 | 735 | * @param string $key the name of the controlstate value to be returned |
736 | - * @param mixed $defaultValue the default value. If $key is not found in controlstate, $defaultValue will be returned |
|
736 | + * @param integer|null $defaultValue the default value. If $key is not found in controlstate, $defaultValue will be returned |
|
737 | 737 | * @return mixed the controlstate value corresponding to $key |
738 | 738 | */ |
739 | 739 | protected function getControlState($key, $defaultValue = null) |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | * Make sure that the controlstate value must be serializable and unserializable. |
750 | 750 | * @param string $key the name of the controlstate value |
751 | 751 | * @param mixed $value the controlstate value to be set |
752 | - * @param null|mixed $defaultValue default value. If $value===$defaultValue, the item will be cleared from controlstate |
|
752 | + * @param integer $defaultValue default value. If $value===$defaultValue, the item will be cleared from controlstate |
|
753 | 753 | */ |
754 | 754 | protected function setControlState($key, $value, $defaultValue = null) |
755 | 755 | { |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | * A registered object can be accessed like a public member variable. |
1085 | 1085 | * This method should only be used by framework and control developers. |
1086 | 1086 | * @param string $name name of the object |
1087 | - * @param object $object object to be declared |
|
1087 | + * @param \Prado\TComponent $object object to be declared |
|
1088 | 1088 | * @see __get |
1089 | 1089 | */ |
1090 | 1090 | public function registerObject($name, $object) |
@@ -1160,7 +1160,7 @@ discard block |
||
1160 | 1160 | * A component with explicit ID on a template will be registered to |
1161 | 1161 | * the template owner. This method allows you to obtain this component |
1162 | 1162 | * with the ID. |
1163 | - * @param mixed $name |
|
1163 | + * @param string $name |
|
1164 | 1164 | * @return mixed the named registered object. Null if object is not found. |
1165 | 1165 | */ |
1166 | 1166 | public function getRegisteredObject($name) |
@@ -117,7 +117,7 @@ |
||
117 | 117 | |
118 | 118 | private function generateTokenHash($token) |
119 | 119 | { |
120 | - for ($h = 0,$i = strlen($token) - 1;$i >= 0;--$i) { |
|
120 | + for ($h = 0, $i = strlen($token) - 1; $i >= 0; --$i) { |
|
121 | 121 | $h += ord($token[$i]); |
122 | 122 | } |
123 | 123 | return $h; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | /** |
84 | 84 | * @throws TConfigurationException if the CAPTCHA cannot be found according to {@link setCaptchaControl CaptchaControl} |
85 | - * @return TCaptchaControl the CAPTCHA control to be validated against |
|
85 | + * @return TCaptcha the CAPTCHA control to be validated against |
|
86 | 86 | */ |
87 | 87 | protected function findCaptchaControl() |
88 | 88 | { |
@@ -115,6 +115,9 @@ discard block |
||
115 | 115 | return $options; |
116 | 116 | } |
117 | 117 | |
118 | + /** |
|
119 | + * @param string $token |
|
120 | + */ |
|
118 | 121 | private function generateTokenHash($token) |
119 | 122 | { |
120 | 123 | for ($h = 0,$i = strlen($token) - 1;$i >= 0;--$i) { |
@@ -295,7 +295,7 @@ |
||
295 | 295 | */ |
296 | 296 | public function getValidationPropertyValue() |
297 | 297 | { |
298 | - return implode(',', array_map(function ($file) { |
|
298 | + return implode(',', array_map(function($file) { |
|
299 | 299 | return $file->getFileName(); |
300 | 300 | }, $this->_files)); |
301 | 301 | } |
@@ -291,7 +291,7 @@ |
||
291 | 291 | /** |
292 | 292 | * Returns the comma separated list of original file names as the property value to be validated. |
293 | 293 | * This method is required by \Prado\Web\UI\IValidatable property. |
294 | - * @return mixed the property value to be validated |
|
294 | + * @return string the property value to be validated |
|
295 | 295 | */ |
296 | 296 | public function getValidationPropertyValue() |
297 | 297 | { |
@@ -629,7 +629,7 @@ |
||
629 | 629 | $items = $this->getItems(); |
630 | 630 | $hasSeparator = $this->_separatorTemplate !== null || $this->getSeparatorRenderer() !== ''; |
631 | 631 | $this->_header = $this->createItemInternal(-1, TListItemType::Header); |
632 | - for ($i = 0;$i < $itemCount;++$i) { |
|
632 | + for ($i = 0; $i < $itemCount; ++$i) { |
|
633 | 633 | if ($hasSeparator && $i > 0) { |
634 | 634 | $this->createItemInternal($i - 1, TListItemType::Separator); |
635 | 635 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |
289 | - * @param ITemplate $value the template for repeater items |
|
289 | + * @param \Prado\Web\UI\TTemplate $value the template for repeater items |
|
290 | 290 | * @throws TInvalidDataTypeException if the input is not an {@link ITemplate} or not null. |
291 | 291 | */ |
292 | 292 | public function setItemTemplate($value) |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | * This method invokes {@link createItem} to create a new repeater item. |
464 | 464 | * @param int $itemIndex zero-based item index. |
465 | 465 | * @param TListItemType $itemType item type |
466 | - * @return TControl the created item, null if item is not created |
|
466 | + * @return \Prado\TComponent|null the created item, null if item is not created |
|
467 | 467 | */ |
468 | 468 | private function createItemInternal($itemIndex, $itemType) |
469 | 469 | { |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | * @param int $itemIndex zero-based item index. |
484 | 484 | * @param TListItemType $itemType item type |
485 | 485 | * @param mixed $dataItem data to be associated with the item |
486 | - * @return TControl the created item, null if item is not created |
|
486 | + * @return \Prado\TComponent|null the created item, null if item is not created |
|
487 | 487 | */ |
488 | 488 | private function createItemWithDataInternal($itemIndex, $itemType, $dataItem) |
489 | 489 | { |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | * Creates a repeater item instance based on the item type and index. |
507 | 507 | * @param int $itemIndex zero-based item index |
508 | 508 | * @param TListItemType $itemType item type |
509 | - * @return TControl created repeater item |
|
509 | + * @return null|\Prado\TComponent created repeater item |
|
510 | 510 | */ |
511 | 511 | protected function createItem($itemIndex, $itemType) |
512 | 512 | { |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | * as the field name, the property value will be returned. |
760 | 760 | * Otherwise, an exception will be raised. |
761 | 761 | * @param mixed $data data item |
762 | - * @param mixed $field field name |
|
762 | + * @param string $field field name |
|
763 | 763 | * @throws TInvalidDataValueException if the data is invalid |
764 | 764 | * @return mixed data value at the specified field |
765 | 765 | */ |
@@ -430,7 +430,7 @@ |
||
430 | 430 | $endLine = $errorLine + self::SOURCE_LINES <= count($lines) ? $errorLine + self::SOURCE_LINES : count($lines); |
431 | 431 | |
432 | 432 | $source = ''; |
433 | - for ($i = $beginLine;$i < $endLine;++$i) { |
|
433 | + for ($i = $beginLine; $i < $endLine; ++$i) { |
|
434 | 434 | if ($i === $errorLine - 1) { |
435 | 435 | $line = htmlspecialchars(sprintf("%04d: %s", $i + 1, str_replace("\t", ' ', $lines[$i]))); |
436 | 436 | $source .= "<div class=\"error\">" . $line . "</div>"; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * raised in {@link TApplication}. |
119 | 119 | * The method mainly uses appropriate template to display the error/exception. |
120 | 120 | * It terminates the application immediately after the error is displayed. |
121 | - * @param mixed $sender sender of the event |
|
121 | + * @param null|\Prado\TApplication $sender sender of the event |
|
122 | 122 | * @param mixed $param event parameter (if the event is raised by TApplication, it refers to the exception instance) |
123 | 123 | */ |
124 | 124 | public function handleError($sender, $param) |
@@ -385,6 +385,9 @@ discard block |
||
385 | 385 | return $result; |
386 | 386 | } |
387 | 387 | |
388 | + /** |
|
389 | + * @return string |
|
390 | + */ |
|
388 | 391 | private function getExactTraceAsString($exception) |
389 | 392 | { |
390 | 393 | if ($exception instanceof TPhpFatalErrorException && |
@@ -411,6 +414,9 @@ discard block |
||
411 | 414 | return $exception->getTraceAsString(); |
412 | 415 | } |
413 | 416 | |
417 | + /** |
|
418 | + * @param string $pattern |
|
419 | + */ |
|
414 | 420 | private function getPropertyAccessTrace($trace, $pattern) |
415 | 421 | { |
416 | 422 | $result = null; |
@@ -441,6 +447,9 @@ discard block |
||
441 | 447 | return $source; |
442 | 448 | } |
443 | 449 | |
450 | + /** |
|
451 | + * @param string $message |
|
452 | + */ |
|
444 | 453 | private function addLink($message) |
445 | 454 | { |
446 | 455 | if (null !== ($class = $this->getErrorClassNameSpace($message))) { |
@@ -46,7 +46,7 @@ |
||
46 | 46 | array_shift($args); |
47 | 47 | $n = count($args); |
48 | 48 | $tokens = []; |
49 | - for ($i = 0;$i < $n;++$i) { |
|
49 | + for ($i = 0; $i < $n; ++$i) { |
|
50 | 50 | $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]); |
51 | 51 | } |
52 | 52 | parent::__construct(strtr($errorMessage, $tokens)); |