@@ -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) |
@@ -244,6 +244,9 @@ discard block |
||
244 | 244 | } |
245 | 245 | } |
246 | 246 | |
247 | + /** |
|
248 | + * @return string |
|
249 | + */ |
|
247 | 250 | protected function hidePrivatePathParts($value) |
248 | 251 | { |
249 | 252 | static $aRpl; |
@@ -401,6 +404,9 @@ discard block |
||
401 | 404 | return $result; |
402 | 405 | } |
403 | 406 | |
407 | + /** |
|
408 | + * @return string |
|
409 | + */ |
|
404 | 410 | private function getExactTraceAsString($exception) |
405 | 411 | { |
406 | 412 | if ($exception instanceof TPhpFatalErrorException && |
@@ -427,6 +433,9 @@ discard block |
||
427 | 433 | return $this->hidePrivatePathParts($exception->getTraceAsString()); |
428 | 434 | } |
429 | 435 | |
436 | + /** |
|
437 | + * @param string $pattern |
|
438 | + */ |
|
430 | 439 | private function getPropertyAccessTrace($trace, $pattern) |
431 | 440 | { |
432 | 441 | $result = null; |
@@ -457,6 +466,9 @@ discard block |
||
457 | 466 | return $source; |
458 | 467 | } |
459 | 468 | |
469 | + /** |
|
470 | + * @param string $message |
|
471 | + */ |
|
460 | 472 | private function addLink($message) |
461 | 473 | { |
462 | 474 | if (null !== ($class = $this->getErrorClassNameSpace($message))) { |
@@ -247,7 +247,7 @@ |
||
247 | 247 | protected function hidePrivatePathParts($value) |
248 | 248 | { |
249 | 249 | static $aRpl; |
250 | - if($aRpl === null) |
|
250 | + if ($aRpl === null) |
|
251 | 251 | { |
252 | 252 | $aRpl[$_SERVER['DOCUMENT_ROOT']] = '${DocumentRoot}'; |
253 | 253 | $aRpl[str_replace('/', DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT'])] = '${DocumentRoot}'; |
@@ -117,7 +117,7 @@ |
||
117 | 117 | |
118 | 118 | /** |
119 | 119 | * @param string $token |
120 | - * @return string hash |
|
120 | + * @return integer hash |
|
121 | 121 | */ |
122 | 122 | private function generateTokenHash($token) |
123 | 123 | { |
@@ -109,7 +109,7 @@ |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
112 | - * @return TControl|null control to be validated. Null if no control is found. |
|
112 | + * @return \Prado\Web\UI\TControl|null control to be validated. Null if no control is found. |
|
113 | 113 | */ |
114 | 114 | public function getValidationTarget() |
115 | 115 | { |
@@ -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 | { |
@@ -78,15 +78,15 @@ |
||
78 | 78 | $data['file'] = $this->hidePrivatePathParts($exception->getFile()); |
79 | 79 | $data['line'] = $exception->getLine(); |
80 | 80 | $data['trace'] = $exception->getTrace(); |
81 | - foreach($data['trace'] as $k => $v) |
|
81 | + foreach ($data['trace'] as $k => $v) |
|
82 | 82 | { |
83 | - if(isset($v['file'])) |
|
83 | + if (isset($v['file'])) |
|
84 | 84 | $data['trace'][$k]['file'] = $this->hidePrivatePathParts($v['file']); |
85 | 85 | |
86 | - if(isset($v['args'])) |
|
86 | + if (isset($v['args'])) |
|
87 | 87 | { |
88 | 88 | $argsout = []; |
89 | - foreach($v['args'] as $kArg => $vArg) |
|
89 | + foreach ($v['args'] as $kArg => $vArg) |
|
90 | 90 | { |
91 | 91 | $data['trace'][$k]['args'][$kArg] = TVarDumper::dump($vArg, 0, false); |
92 | 92 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $first = $logs[0][3]; |
42 | 42 | $even = true; |
43 | 43 | |
44 | - $blocks = [ [ 'info', 'Tot Time', 'Time ', '[Level] [Category] [Message]' ] ]; |
|
44 | + $blocks = [['info', 'Tot Time', 'Time ', '[Level] [Category] [Message]']]; |
|
45 | 45 | for ($i = 0, $n = count($logs); $i < $n; ++$i) { |
46 | 46 | if ($i < $n - 1) { |
47 | 47 | $timing['delta'] = $logs[$i + 1][3] - $logs[$i][3]; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | console.log ("[Tot Time] [Time ] [Level] [Category] [Message]"); |
85 | 85 | |
86 | -EOD; |
|
86 | +eod; |
|
87 | 87 | |
88 | 88 | return $string; |
89 | 89 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | </script> |
124 | 124 | |
125 | -EOD; |
|
125 | +eod; |
|
126 | 126 | |
127 | 127 | return $string; |
128 | 128 | } |
@@ -125,7 +125,6 @@ discard block |
||
125 | 125 | * information. <b>N.B.</b>You should not initialize this class directly |
126 | 126 | * unless you know what you are doing. Please use use |
127 | 127 | * DateTimeFormatInfo::getInstance() to create an instance. |
128 | - * @param array $data ICU data for date time formatting. |
|
129 | 128 | * @see getInstance() |
130 | 129 | */ |
131 | 130 | public function __construct($cultureInfo) |
@@ -156,7 +155,7 @@ discard block |
||
156 | 155 | |
157 | 156 | /** |
158 | 157 | * Returns the DateTimeFormatInfo associated with the specified culture. |
159 | - * @param null|CultureInfo|string $culture the culture that gets the DateTimeFormat property. |
|
158 | + * @param string $culture the culture that gets the DateTimeFormat property. |
|
160 | 159 | * @return DateTimeFormatInfo DateTimeFormatInfo for the specified |
161 | 160 | * culture. |
162 | 161 | */ |
@@ -175,6 +174,9 @@ discard block |
||
175 | 174 | } |
176 | 175 | } |
177 | 176 | |
177 | + /** |
|
178 | + * @param string $path |
|
179 | + */ |
|
178 | 180 | public function getInfoByPath($path) |
179 | 181 | { |
180 | 182 | static $basePath = null; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | { |
133 | 133 | $this->properties = get_class_methods($this); |
134 | 134 | |
135 | - if(!($cultureInfo instanceof CultureInfo)) |
|
135 | + if (!($cultureInfo instanceof CultureInfo)) |
|
136 | 136 | throw new Exception('Please provide a CultureInfo instance.'); |
137 | 137 | |
138 | 138 | $this->cultureInfo = $cultureInfo; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | static public function getInvariantInfo() |
147 | 147 | { |
148 | 148 | static $invariant; |
149 | - if($invariant === null) |
|
149 | + if ($invariant === null) |
|
150 | 150 | { |
151 | 151 | $culture = CultureInfo::getInvariantCulture(); |
152 | 152 | $invariant = $culture->getDateTimeFormat(); |
@@ -160,13 +160,13 @@ discard block |
||
160 | 160 | * @return DateTimeFormatInfo DateTimeFormatInfo for the specified |
161 | 161 | * culture. |
162 | 162 | */ |
163 | - public static function getInstance($culture=null) |
|
163 | + public static function getInstance($culture = null) |
|
164 | 164 | { |
165 | 165 | |
166 | 166 | if ($culture instanceof CultureInfo) |
167 | 167 | { |
168 | 168 | return $culture->getDateTimeFormat(); |
169 | - } elseif(is_string($culture)) { |
|
169 | + } elseif (is_string($culture)) { |
|
170 | 170 | $cultureInfo = CultureInfo::getInstance($culture); |
171 | 171 | return $cultureInfo->getDateTimeFormat(); |
172 | 172 | } else { |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | public function getInfoByPath($path) |
179 | 179 | { |
180 | 180 | static $basePath = null; |
181 | - if($basePath === null) |
|
181 | + if ($basePath === null) |
|
182 | 182 | { |
183 | 183 | $basePath = 'calendar/' . $this->cultureInfo->getCalendar() . '/'; |
184 | 184 | } |
@@ -113,7 +113,6 @@ discard block |
||
113 | 113 | * formatting information. <b>N.B.</b>You should not initialize this |
114 | 114 | * class directly unless you know what you are doing. Please use use |
115 | 115 | * NumberFormatInfo::getInstance() to create an instance. |
116 | - * @param array $data ICU data for date time formatting. |
|
117 | 116 | * @param mixed $type |
118 | 117 | * @see getInstance() |
119 | 118 | */ |
@@ -129,6 +128,11 @@ discard block |
||
129 | 128 | $this->setPattern($type); |
130 | 129 | } |
131 | 130 | |
131 | + /** |
|
132 | + * @param string $path |
|
133 | + * |
|
134 | + * @return string |
|
135 | + */ |
|
132 | 136 | public function getInfoByPath($path) |
133 | 137 | { |
134 | 138 | static $basePath = null; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | { |
122 | 122 | $this->properties = get_class_methods($this); |
123 | 123 | |
124 | - if(!($cultureInfo instanceof CultureInfo)) |
|
124 | + if (!($cultureInfo instanceof CultureInfo)) |
|
125 | 125 | throw new Exception('Please provide a CultureInfo instance.'); |
126 | 126 | |
127 | 127 | $this->cultureInfo = $cultureInfo; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | public function getInfoByPath($path) |
133 | 133 | { |
134 | 134 | static $basePath = null; |
135 | - if($basePath === null) |
|
135 | + if ($basePath === null) |
|
136 | 136 | { |
137 | 137 | $basePath = 'NumberElements/' . $this->cultureInfo->getDefaultNumberFormat() . '/'; |
138 | 138 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function setPattern($type = NumberFormatInfo::DECIMAL) |
151 | 151 | { |
152 | - $info = $this->getInfoByPath('patterns/'.$type); |
|
152 | + $info = $this->getInfoByPath('patterns/' . $type); |
|
153 | 153 | $this->pattern = $this->parsePattern($info); |
154 | 154 | } |
155 | 155 | |
@@ -164,10 +164,10 @@ discard block |
||
164 | 164 | * @param mixed $type |
165 | 165 | * @return NumberFormatInfo default NumberFormatInfo. |
166 | 166 | */ |
167 | - public static function getInvariantInfo($type=NumberFormatInfo::DECIMAL) |
|
167 | + public static function getInvariantInfo($type = NumberFormatInfo::DECIMAL) |
|
168 | 168 | { |
169 | 169 | static $invariant; |
170 | - if($invariant === null) |
|
170 | + if ($invariant === null) |
|
171 | 171 | { |
172 | 172 | $culture = CultureInfo::getInvariantCulture(); |
173 | 173 | $invariant = $culture->NumberFormat; |
@@ -187,14 +187,14 @@ discard block |
||
187 | 187 | * @see getPercentageInstance(); |
188 | 188 | * @see getScientificInstance(); |
189 | 189 | */ |
190 | - public static function getInstance($culture=null, $type=NumberFormatInfo::DECIMAL) |
|
190 | + public static function getInstance($culture = null, $type = NumberFormatInfo::DECIMAL) |
|
191 | 191 | { |
192 | 192 | if ($culture instanceof CultureInfo) |
193 | 193 | { |
194 | 194 | $formatInfo = $culture->NumberFormat; |
195 | 195 | $formatInfo->setPattern($type); |
196 | 196 | return $formatInfo; |
197 | - } elseif(is_string($culture)) { |
|
197 | + } elseif (is_string($culture)) { |
|
198 | 198 | $cultureInfo = new CultureInfo($culture); |
199 | 199 | $formatInfo = $cultureInfo->NumberFormat; |
200 | 200 | $formatInfo->setPattern($type); |
@@ -494,9 +494,9 @@ discard block |
||
494 | 494 | * Gets the string to use as the currency symbol. |
495 | 495 | * @return string currency symbol. |
496 | 496 | */ |
497 | - public function getCurrencySymbol($currency='USD') |
|
497 | + public function getCurrencySymbol($currency = 'USD') |
|
498 | 498 | { |
499 | - $fmt = new \NumberFormatter( $this->cultureInfo->getName()."@currency=$currency", \NumberFormatter::CURRENCY ); |
|
499 | + $fmt = new \NumberFormatter($this->cultureInfo->getName() . "@currency=$currency", \NumberFormatter::CURRENCY); |
|
500 | 500 | return $fmt->getSymbol(\NumberFormatter::CURRENCY_SYMBOL); |
501 | 501 | } |
502 | 502 | } |
@@ -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 | { |
@@ -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 | { |