@@ -410,7 +410,7 @@ |
||
410 | 410 | public function onPreRender($param) |
411 | 411 | { |
412 | 412 | parent::onPreRender($param); |
413 | - $this->getActiveView(); // determine the active view |
|
413 | + $this->getActiveView(); // determine the active view |
|
414 | 414 | $this->registerStyleSheet(); |
415 | 415 | } |
416 | 416 |
@@ -367,7 +367,7 @@ |
||
367 | 367 | $this->_repeatedControl->setValidationGroup($this->getValidationGroup()); |
368 | 368 | $page = $this->getPage(); |
369 | 369 | $n = $this->getItemCount(); |
370 | - for ($i = 0;$i < $n;++$i) { |
|
370 | + for ($i = 0; $i < $n; ++$i) { |
|
371 | 371 | $this->_repeatedControl->setID("c$i"); |
372 | 372 | $page->registerRequiresPostData($this->_repeatedControl); |
373 | 373 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | /** |
62 | 62 | * Creates a control used for repetition (used as a template). |
63 | - * @return TControl the control to be repeated |
|
63 | + * @return TCheckBoxItem the control to be repeated |
|
64 | 64 | */ |
65 | 65 | protected function createRepeatedControl() |
66 | 66 | { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * the checkbox list itself (because the checkbox list does not have child controls.) |
74 | 74 | * @param string $id control ID |
75 | 75 | * @param mixed $real |
76 | - * @return TControl control being found |
|
76 | + * @return null|\Prado\Web\UI\TControl control being found |
|
77 | 77 | */ |
78 | 78 | public function findControl($id, $real = false) |
79 | 79 | { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
150 | - * @return string the direction of traversing the list, defaults to 'Vertical' |
|
150 | + * @return TRepeatDirection the direction of traversing the list, defaults to 'Vertical' |
|
151 | 151 | */ |
152 | 152 | public function getRepeatDirection() |
153 | 153 | { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
166 | - * @return string how the list should be displayed, using table or using line breaks. Defaults to 'Table'. |
|
166 | + * @return TRepeatLayout how the list should be displayed, using table or using line breaks. Defaults to 'Table'. |
|
167 | 167 | */ |
168 | 168 | public function getRepeatLayout() |
169 | 169 | { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | /** |
437 | 437 | * Returns the value to be validated. |
438 | 438 | * This methid is required by \Prado\Web\UI\IValidatable interface. |
439 | - * @return mixed the value of the property to be validated. |
|
439 | + * @return string the value of the property to be validated. |
|
440 | 440 | */ |
441 | 441 | public function getValidationPropertyValue() |
442 | 442 | { |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | $c = 0; |
477 | 477 | $this->_directive = null; |
478 | 478 | try { |
479 | - for ($i = 0;$i < $n;++$i) { |
|
479 | + for ($i = 0; $i < $n; ++$i) { |
|
480 | 480 | $match = &$matches[$i]; |
481 | 481 | $str = $match[0][0]; |
482 | 482 | $matchStart = $match[0][1]; |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | $pattern = '/([\w\.\-]+)\s*=\s*(\'.*?\'|".*?"|<%.*?%>)/msS'; |
705 | 705 | $attributes = []; |
706 | 706 | $n = preg_match_all($pattern, $str, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); |
707 | - for ($i = 0;$i < $n;++$i) { |
|
707 | + for ($i = 0; $i < $n; ++$i) { |
|
708 | 708 | $match = &$matches[$i]; |
709 | 709 | $name = strtolower($match[1][0]); |
710 | 710 | if (isset($attributes[$name])) { |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | $isDataBind = false; |
746 | 746 | $textStart = 0; |
747 | 747 | $expr = ''; |
748 | - for ($i = 0;$i < $n;++$i) { |
|
748 | + for ($i = 0; $i < $n; ++$i) { |
|
749 | 749 | $match = $matches[0][$i]; |
750 | 750 | $token = $match[0]; |
751 | 751 | $offset = $match[1]; |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | } |
812 | 812 | } else { |
813 | 813 | // a simple property |
814 | - if (! ($class->hasMethod('set' . $name) || $class->hasMethod('setjs' . $name) || $this->isClassBehaviorMethod($class, 'set' . $name))) { |
|
814 | + if (!($class->hasMethod('set' . $name) || $class->hasMethod('setjs' . $name) || $this->isClassBehaviorMethod($class, 'set' . $name))) { |
|
815 | 815 | if ($class->hasMethod('get' . $name) || $class->hasMethod('getjs' . $name)) { |
816 | 816 | throw new TConfigurationException('template_property_readonly', $type, $name); |
817 | 817 | } else { |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | $srcFile = $this->_tplFile; |
878 | 878 | |
879 | 879 | if (($n = count($this->_includedFiles)) > 0) { // need to adjust error row number and file name |
880 | - for ($i = $n - 1;$i >= 0;--$i) { |
|
880 | + for ($i = $n - 1; $i >= 0; --$i) { |
|
881 | 881 | if ($this->_includeAtLine[$i] <= $line) { |
882 | 882 | if ($line < $this->_includeAtLine[$i] + $this->_includeLines[$i]) { |
883 | 883 | $line = $line - $this->_includeAtLine[$i] + 1; |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | protected function preprocess($input) |
908 | 908 | { |
909 | 909 | if ($n = preg_match_all('/<%include(.*?)%>/', $input, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { |
910 | - for ($i = 0;$i < $n;++$i) { |
|
910 | + for ($i = 0; $i < $n; ++$i) { |
|
911 | 911 | $filePath = Prado::getPathOfNamespace(trim($matches[$i][1][0]), TTemplateManager::TEMPLATE_FILE_EXT); |
912 | 912 | if ($filePath !== null && is_file($filePath)) { |
913 | 913 | $this->_includedFiles[] = $filePath; |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | } |
918 | 918 | } |
919 | 919 | $base = 0; |
920 | - for ($i = 0;$i < $n;++$i) { |
|
920 | + for ($i = 0; $i < $n; ++$i) { |
|
921 | 921 | $ext = file_get_contents($this->_includedFiles[$i]); |
922 | 922 | $length = strlen($matches[$i][0][0]); |
923 | 923 | $offset = $base + $matches[$i][0][1]; |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | * Handles template parsing exception. |
870 | 870 | * This method rethrows the exception caught during template parsing. |
871 | 871 | * It adjusts the error location by giving out correct error line number and source file. |
872 | - * @param Exception $e template exception |
|
872 | + * @param \Exception $e template exception |
|
873 | 873 | * @param int $line line number |
874 | 874 | * @param null|string $input template string if no source file is used |
875 | 875 | */ |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | |
935 | 935 | /** |
936 | 936 | * Checks if the given method belongs to a previously attached class behavior. |
937 | - * @param ReflectionClass $class |
|
937 | + * @param \ReflectionClass $class |
|
938 | 938 | * @param string $method |
939 | 939 | * @return bool |
940 | 940 | */ |
@@ -894,7 +894,7 @@ |
||
894 | 894 | } |
895 | 895 | } elseif ($control instanceof IPostBackEventHandler && |
896 | 896 | empty($this->_postData[self::FIELD_POSTBACK_TARGET])) { |
897 | - $this->_postData->add(self::FIELD_POSTBACK_TARGET, $key); // not calling setPostBackEventTarget() because the control may be removed later |
|
897 | + $this->_postData->add(self::FIELD_POSTBACK_TARGET, $key); // not calling setPostBackEventTarget() because the control may be removed later |
|
898 | 898 | } |
899 | 899 | unset($this->_controlsRequiringPostData[$key]); |
900 | 900 | } elseif ($beforeLoad) { |
@@ -290,6 +290,9 @@ discard block |
||
290 | 290 | $this->unloadRecursive(); |
291 | 291 | } |
292 | 292 | |
293 | + /** |
|
294 | + * @param string $enc |
|
295 | + */ |
|
293 | 296 | protected static function decodeUTF8($data, $enc) |
294 | 297 | { |
295 | 298 | if (is_array($data)) { |
@@ -970,7 +973,7 @@ discard block |
||
970 | 973 | |
971 | 974 | /** |
972 | 975 | * @internal This method is invoked by TForm at the beginning of its rendering |
973 | - * @param mixed $writer |
|
976 | + * @param THtmlWriter $writer |
|
974 | 977 | */ |
975 | 978 | public function beginFormRender($writer) |
976 | 979 | { |
@@ -984,7 +987,7 @@ discard block |
||
984 | 987 | |
985 | 988 | /** |
986 | 989 | * @internal This method is invoked by TForm at the end of its rendering |
987 | - * @param mixed $writer |
|
990 | + * @param THtmlWriter $writer |
|
988 | 991 | */ |
989 | 992 | public function endFormRender($writer) |
990 | 993 | { |
@@ -1003,7 +1006,7 @@ discard block |
||
1003 | 1006 | |
1004 | 1007 | /** |
1005 | 1008 | * Sets input focus on a control after the page is rendered to users. |
1006 | - * @param string|TControl $value control to receive focus, or the ID of the element on the page to receive focus |
|
1009 | + * @param TControl $value control to receive focus, or the ID of the element on the page to receive focus |
|
1007 | 1010 | */ |
1008 | 1011 | public function setFocus($value) |
1009 | 1012 | { |
@@ -542,7 +542,7 @@ |
||
542 | 542 | public function getStyleSheetUrls() |
543 | 543 | { |
544 | 544 | $stylesheets = array_values( |
545 | - array_map(function ($e) { |
|
545 | + array_map(function($e) { |
|
546 | 546 | return is_array($e) ? $e[0] : $e; |
547 | 547 | }, $this->_styleSheetFiles) |
548 | 548 | ); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
224 | - * @param mixed $script |
|
224 | + * @param string $script |
|
225 | 225 | * @return string Prado javascript library base asset url. |
226 | 226 | */ |
227 | 227 | public function getPradoScriptAssetUrl($script = 'prado') |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
239 | - * @param mixed $script |
|
239 | + * @param string $script |
|
240 | 240 | * @return string Prado javascript library base asset path in local filesystem. |
241 | 241 | */ |
242 | 242 | public function getPradoScriptAssetPath($script = 'prado') |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | |
266 | 266 | /** |
267 | 267 | * @param string $base javascript or css package path. |
268 | - * @return array tuple($path,$url). |
|
268 | + * @return string[] tuple($path,$url). |
|
269 | 269 | */ |
270 | 270 | protected function getPackagePathUrl($base) |
271 | 271 | { |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | |
447 | 447 | /** |
448 | 448 | * Registers a Prado style library to be loaded. |
449 | - * @param mixed $name |
|
449 | + * @param string $name |
|
450 | 450 | */ |
451 | 451 | protected function registerPradoStyleInternal($name) |
452 | 452 | { |
@@ -784,11 +784,17 @@ discard block |
||
784 | 784 | $writer->write(TJavaScript::renderScriptBlocks($this->_headScripts)); |
785 | 785 | } |
786 | 786 | |
787 | + /** |
|
788 | + * @param THtmlWriter $writer |
|
789 | + */ |
|
787 | 790 | public function renderScriptFilesBegin($writer) |
788 | 791 | { |
789 | 792 | $this->renderAllPendingScriptFiles($writer); |
790 | 793 | } |
791 | 794 | |
795 | + /** |
|
796 | + * @param THtmlWriter $writer |
|
797 | + */ |
|
792 | 798 | public function renderScriptFilesEnd($writer) |
793 | 799 | { |
794 | 800 | $this->renderAllPendingScriptFiles($writer); |
@@ -801,6 +807,9 @@ discard block |
||
801 | 807 | $this->_page->registerCachingAction('Page.ClientScript', 'markScriptFileAsRendered', $params); |
802 | 808 | } |
803 | 809 | |
810 | + /** |
|
811 | + * @param THtmlWriter $writer |
|
812 | + */ |
|
804 | 813 | protected function renderScriptFiles($writer, array $scripts) |
805 | 814 | { |
806 | 815 | foreach ($scripts as $script) { |
@@ -857,11 +866,17 @@ discard block |
||
857 | 866 | $writer->write(TJavaScript::renderScriptBlocksCallback($this->_endScripts)); |
858 | 867 | } |
859 | 868 | |
869 | + /** |
|
870 | + * @param THtmlWriter $writer |
|
871 | + */ |
|
860 | 872 | public function renderHiddenFieldsBegin($writer) |
861 | 873 | { |
862 | 874 | $this->renderHiddenFieldsInt($writer, true); |
863 | 875 | } |
864 | 876 | |
877 | + /** |
|
878 | + * @param THtmlWriter $writer |
|
879 | + */ |
|
865 | 880 | public function renderHiddenFieldsEnd($writer) |
866 | 881 | { |
867 | 882 | $this->renderHiddenFieldsInt($writer, false); |
@@ -886,7 +901,7 @@ discard block |
||
886 | 901 | * Unfortunately this attribute is invalid for hidden fields, so text fields are |
887 | 902 | * rendered instead (#642). |
888 | 903 | * @param THtmlWriter $writer writer for the rendering purpose |
889 | - * @param mixed $initial |
|
904 | + * @param boolean $initial |
|
890 | 905 | */ |
891 | 906 | |
892 | 907 | protected function renderHiddenFieldsInt($writer, $initial) |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | /** |
113 | 113 | * @param string $key a key identifying a value to be cached |
114 | - * @return sring a key generated from the provided key which ensures the uniqueness across applications |
|
114 | + * @return string a key generated from the provided key which ensures the uniqueness across applications |
|
115 | 115 | */ |
116 | 116 | protected function generateUniqueKey($key) |
117 | 117 | { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param mixed $value the value to be cached |
147 | 147 | * @param int $expire the number of seconds in which the cached value will expire. 0 means never expire. |
148 | 148 | * @param ICacheDependency $dependency dependency of the cached item. If the dependency changes, the item is labeled invalid. |
149 | - * @return bool true if the value is successfully stored into cache, false otherwise |
|
149 | + * @return null|boolean true if the value is successfully stored into cache, false otherwise |
|
150 | 150 | */ |
151 | 151 | public function set($id, $value, $expire = 0, $dependency = null) |
152 | 152 | { |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * Deletes the value with the specified key from cache |
284 | 284 | * This method is required by the interface \ArrayAccess. |
285 | 285 | * @param string $id the key of the value to be deleted |
286 | - * @return bool if no error happens during deletion |
|
286 | + * @return boolean|null if no error happens during deletion |
|
287 | 287 | */ |
288 | 288 | public function offsetUnset($id) |
289 | 289 | { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * Returns the item with the specified key. |
105 | 105 | * This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. |
106 | - * @param mixed $key the key |
|
106 | + * @param string $key the key |
|
107 | 107 | * @return mixed the element at the offset, null if no element is found at the offset |
108 | 108 | */ |
109 | 109 | public function itemAt($key) |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | /** |
116 | 116 | * Adds an item into the map. |
117 | 117 | * This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. |
118 | - * @param mixed $key |
|
118 | + * @param string $key |
|
119 | 119 | * @param mixed $value |
120 | 120 | */ |
121 | 121 | public function add($key, $value) |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | /** |
127 | 127 | * Removes an item from the map by its key. |
128 | 128 | * This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. |
129 | - * @param mixed $key the key of the item to be removed |
|
129 | + * @param string $key the key of the item to be removed |
|
130 | 130 | * @return mixed the removed value, null if no such key exists. |
131 | 131 | */ |
132 | 132 | public function remove($key) |
@@ -68,7 +68,7 @@ |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * @param mixed $value original data source |
|
71 | + * @param \Traversable $value original data source |
|
72 | 72 | */ |
73 | 73 | public function setDataSource($value) |
74 | 74 | { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | - * @return TActiveRecord current Active Record instance |
|
107 | + * @return \Prado\Data\ActiveRecord\TActiveRecord current Active Record instance |
|
108 | 108 | */ |
109 | 109 | protected function getCurrentRecord() |
110 | 110 | { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | /** |
135 | 135 | * Instantiate the external edit renderer. |
136 | - * @param TActiveRecord $record record to be edited |
|
136 | + * @param \Prado\Data\ActiveRecord\TActiveRecord $record record to be edited |
|
137 | 137 | * @param string $classPath external edit renderer class name. |
138 | 138 | * @throws TConfigurationException raised when renderer is not an |
139 | 139 | * instance of IScaffoldEditRenderer. |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | /** |
263 | 263 | * Create the default scaffold editor control factory. |
264 | - * @param TActiveRecord $record record instance. |
|
264 | + * @param \Prado\Data\ActiveRecord\TActiveRecord $record record instance. |
|
265 | 265 | * @return TScaffoldInputBase scaffold editor control factory. |
266 | 266 | */ |
267 | 267 | protected function getScaffoldInputBuilder($record) |