Completed
Push — intl ( bc3116...d7f4cb )
by Fabio
06:33
created
framework/Web/UI/WebControls/TCustomValidator.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
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
 	{
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TRepeater.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	{
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TCallbackErrorHandler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -78,15 +78,15 @@
 block discarded – undo
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
 				}
Please login to merge, or discard this patch.
framework/Util/TFirebugLogRoute.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
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];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
122 122
 }
123 123
 </script>
124 124
 
125
-EOD;
125
+eod;
126 126
 
127 127
 		return $string;
128 128
 	}
Please login to merge, or discard this patch.
framework/I18N/TDateFormat.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	protected function getFormatter($culture, $datetype, $timetype)
192 192
 	{
193
-		if(!isset(self::$formatters[$culture]))
193
+		if (!isset(self::$formatters[$culture]))
194 194
 			self::$formatters[$culture] = [];
195
-		if(!isset(self::$formatters[$culture][$datetype]))
195
+		if (!isset(self::$formatters[$culture][$datetype]))
196 196
 			self::$formatters[$culture][$datetype] = [];
197
-		if(!isset(self::$formatters[$culture][$datetype][$timetype]))
197
+		if (!isset(self::$formatters[$culture][$datetype][$timetype]))
198 198
 			self::$formatters[$culture][$datetype][$timetype] = new \IntlDateFormatter($culture, $datetype, $timetype);
199 199
 
200 200
 		return self::$formatters[$culture][$datetype][$timetype];
@@ -230,14 +230,14 @@  discard block
 block discarded – undo
230 230
 		$timetype = \IntlDateFormatter::LONG;
231 231
 
232 232
 		// try the "date time" pattern format
233
-		if(!empty($pattern))
233
+		if (!empty($pattern))
234 234
 		{
235 235
 			$subs = explode(' ', $pattern, 2);
236 236
 			if (count($subs) == 2) {
237 237
 				$sub0 = $this->getPreset($subs[0]);
238 238
 				$sub1 = $this->getPreset($subs[1]);
239 239
 
240
-				if($sub0 !== null && $sub1 !== null)
240
+				if ($sub0 !== null && $sub1 !== null)
241 241
 				{
242 242
 					$datetype = $sub0;
243 243
 					$timetype = $sub1;
@@ -247,10 +247,10 @@  discard block
 block discarded – undo
247 247
 		}
248 248
 
249 249
 		// try the "date" pattern format
250
-		if(!empty($pattern))
250
+		if (!empty($pattern))
251 251
 		{
252 252
 			$sub = $this->getPreset($pattern);
253
-			if($sub !== null)
253
+			if ($sub !== null)
254 254
 			{
255 255
 				$datetype = $sub;
256 256
 				$timetype = $sub;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			}
259 259
 		}
260 260
 
261
-		if(empty($pattern))
261
+		if (empty($pattern))
262 262
 		{
263 263
 			$formatter = $this->getFormatter($culture, $datetype, $timetype);
264 264
 		} else {
Please login to merge, or discard this patch.
framework/I18N/TGlobalizationAutoDetect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 	protected function getIsValidLocale($locale)
80 80
 	{
81 81
 		static $allLocales;
82
-		if($allLocales === null)
82
+		if ($allLocales === null)
83 83
 		{
84 84
 			$all = \ResourceBundle::getLocales('');
85 85
 		}
Please login to merge, or discard this patch.
framework/I18N/TNumberFormat.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	protected function getFormatter($culture, $type)
197 197
 	{
198
-		if(!isset(self::$formatters[$culture]))
198
+		if (!isset(self::$formatters[$culture]))
199 199
 			self::$formatters[$culture] = [];
200
-		if(!isset(self::$formatters[$culture][$type]))
200
+		if (!isset(self::$formatters[$culture][$type]))
201 201
 			self::$formatters[$culture][$type] = new \NumberFormatter($culture, $type);
202 202
 
203 203
 		return self::$formatters[$culture][$type];
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		$type = $this->getType();
222 222
 		$pattern = $this->getPattern();
223 223
 
224
-		if(empty($pattern))
224
+		if (empty($pattern))
225 225
 		{
226 226
 			$formatter = $this->getFormatter($culture, $type);
227 227
 		} else {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			$formatter->setPattern($pattern);
230 230
 		}
231 231
 
232
-		if($type === \NumberFormatter::CURRENCY)
232
+		if ($type === \NumberFormatter::CURRENCY)
233 233
 		{
234 234
 			$result = $formatter->formatCurrency($value, $this->getCurrency());
235 235
 		} else {
Please login to merge, or discard this patch.
framework/I18N/core/CultureInfo.php 3 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -477,8 +477,9 @@  discard block
 block discarded – undo
477 477
 			return $obj;
478 478
 		} elseif($obj instanceof \ResourceBundle) {
479 479
 			$array = array();
480
-			foreach($obj as $k => $v)
481
-				$array[$k] = $v;
480
+			foreach($obj as $k => $v) {
481
+							$array[$k] = $v;
482
+			}
482 483
 		} else {
483 484
 			$array = $obj;
484 485
 		}
@@ -515,8 +516,9 @@  discard block
 block discarded – undo
515 516
 		if($arr === null)
516 517
 		{
517 518
 			$arr = $this->findInfo('Currencies', false, 'Currencies');
518
-			foreach($arr as $k => $v)
519
-				$arr[$k] = $this->simplify($v);
519
+			foreach($arr as $k => $v) {
520
+							$arr[$k] = $this->simplify($v);
521
+			}
520 522
 		}
521 523
 		return $arr;
522 524
 	}
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
 	/**
218 218
 	 * Load the ICU culture data for the specific culture identifier.
219
-	 * @param string $culture the culture identifier.
219
+	 * @param string $cultureName the culture identifier.
220 220
 	 */
221 221
 	protected function loadCultureData($cultureName)
222 222
 	{
@@ -468,7 +468,6 @@  discard block
 block discarded – undo
468 468
 	 * Simplify a single element array into its own value.
469 469
 	 * E.g. <code>array(0 => array('hello'), 1 => 'world');</code>
470 470
 	 * becomes <code>array(0 => 'hello', 1 => 'world');</code>
471
-	 * @param array $array with single elements arrays
472 471
 	 * @return array simplified array.
473 472
 	 */
474 473
 	protected function simplify($obj)
@@ -541,7 +540,7 @@  discard block
 block discarded – undo
541 540
 
542 541
 	/**
543 542
 	 * Get a list of timezones in the language of the localized version.
544
-	 * @return array list of localized timezones.
543
+	 * @return string[] list of localized timezones.
545 544
 	 */
546 545
 	public function getTimeZones()
547 546
 	{
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -224,24 +224,24 @@  discard block
 block discarded – undo
224 224
 		$current_part = $culture_parts[0];
225 225
 
226 226
 		$culturesToLoad = [$current_part];
227
-		for($i = 1, $k = count($culture_parts); $i < $k; ++$i)
227
+		for ($i = 1, $k = count($culture_parts); $i < $k; ++$i)
228 228
 		{
229
-			$current_part .= '_'.$culture_parts[$i];
229
+			$current_part .= '_' . $culture_parts[$i];
230 230
 			$culturesToLoad[] = $current_part;
231 231
 		}
232 232
 
233
-		foreach(self::$bundleNames as $key => $bundleName)
233
+		foreach (self::$bundleNames as $key => $bundleName)
234 234
 		{
235
-			if(!array_key_exists($key, $this->data))
235
+			if (!array_key_exists($key, $this->data))
236 236
 				$this->data[$key] = [];
237 237
 		}
238
-		foreach($culturesToLoad as $culture)
238
+		foreach ($culturesToLoad as $culture)
239 239
 		{
240
-			if(in_array($culture, $this->resourceBundles))
240
+			if (in_array($culture, $this->resourceBundles))
241 241
 				continue;
242 242
 
243 243
 			array_unshift($this->resourceBundles, $culture);
244
-			foreach(self::$bundleNames as $key => $bundleName)
244
+			foreach (self::$bundleNames as $key => $bundleName)
245 245
 			{
246 246
 				$this->data[$key][$culture] = \ResourceBundle::create($culture, $bundleName, false);
247 247
 			}
@@ -263,17 +263,17 @@  discard block
 block discarded – undo
263 263
 	 * @param string $key bundle name.
264 264
 	 * @return mixed the specific ICU data.
265 265
 	 */
266
-	public function findInfo($path='/', $merge=false, $key = null)
266
+	public function findInfo($path = '/', $merge = false, $key = null)
267 267
 	{
268 268
 		$result = [];
269 269
 
270
-		if($key === null)
270
+		if ($key === null)
271 271
 		{
272 272
 			// try to guess the bundle from the path. Always defaults to "Core".
273 273
 			$key = 'Core';
274
-			foreach(self::$bundleNames as $bundleName => $icuBundleName)
274
+			foreach (self::$bundleNames as $bundleName => $icuBundleName)
275 275
 			{
276
-				if(strpos($path, $bundleName) === 0)
276
+				if (strpos($path, $bundleName) === 0)
277 277
 				{
278 278
 					$key = $bundleName;
279 279
 					break;
@@ -281,17 +281,17 @@  discard block
 block discarded – undo
281 281
 			}
282 282
 		}
283 283
 
284
-		if(!array_key_exists($key, $this->data))
284
+		if (!array_key_exists($key, $this->data))
285 285
 			return $result;
286
-		foreach($this->resourceBundles as $culture)
286
+		foreach ($this->resourceBundles as $culture)
287 287
 		{
288 288
 			$res = $this->data[$key][$culture];
289
-			if($res === null)
289
+			if ($res === null)
290 290
 				continue;
291 291
 			$info = $this->searchResources($res, $path);
292
-			if($info)
292
+			if ($info)
293 293
 			{
294
-				if($merge)
294
+				if ($merge)
295 295
 					$result = array_merge($result, $info);
296 296
 				else
297 297
 					return $info;
@@ -309,18 +309,18 @@  discard block
 block discarded – undo
309 309
 	 * @param string $path slash "/" separated array path.
310 310
 	 * @return mixed the value array using the path
311 311
 	 */
312
-	private function searchResources($info, $path='/')
312
+	private function searchResources($info, $path = '/')
313 313
 	{
314 314
 		$index = explode('/', $path);
315 315
 
316 316
 		$resource = $info;
317
-		for($i = 0, $k = count($index); $i < $k; ++$i)
317
+		for ($i = 0, $k = count($index); $i < $k; ++$i)
318 318
 		{
319
-			if($resource === null)
319
+			if ($resource === null)
320 320
 				return null;
321
-			elseif(is_string($resource))
321
+			elseif (is_string($resource))
322 322
 				return [$resource];
323
-			elseif(is_object($resource))
323
+			elseif (is_object($resource))
324 324
 				$resource = $resource->get($index[$i], false);
325 325
 		}
326 326
 
@@ -358,8 +358,8 @@  discard block
 block discarded – undo
358 358
 		$reg = substr($this->culture, 3, 2);
359 359
 		$language = $this->findInfo("Languages/{$lang}");
360 360
 		$region = $this->findInfo("Countries/{$reg}");
361
-		if($region)
362
-			return $language.' ('.$region.')';
361
+		if ($region)
362
+			return $language . ' (' . $region . ')';
363 363
 		else
364 364
 			return $language;
365 365
 	}
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
 		}
383 383
 
384 384
 		$region = $culture->findInfo("Countries/{$reg}");
385
-		if($region)
386
-			return $language.' ('.$region.')';
385
+		if ($region)
386
+			return $language . ' (' . $region . ')';
387 387
 		else
388 388
 			return $language;
389 389
 	}
@@ -439,25 +439,25 @@  discard block
 block discarded – undo
439 439
 	 * or CultureInfo::SPECIFIC.
440 440
 	 * @return array list of culture information available.
441 441
 	 */
442
-	public static function getCultures($type=CultureInfo::ALL)
442
+	public static function getCultures($type = CultureInfo::ALL)
443 443
 	{
444 444
 		$all = \ResourceBundle::getLocales('');
445 445
 
446
-		switch($type)
446
+		switch ($type)
447 447
 		{
448 448
 			case CultureInfo::ALL :
449 449
 				return $all;
450 450
 			case CultureInfo::NEUTRAL :
451
-				foreach($all as $key => $culture)
451
+				foreach ($all as $key => $culture)
452 452
 				{
453
-					if(strlen($culture) != 2)
453
+					if (strlen($culture) != 2)
454 454
 						unset($all[$key]);
455 455
 				}
456 456
 				return $all;
457 457
 			case CultureInfo::SPECIFIC :
458
-				foreach($all as $key => $culture)
458
+				foreach ($all as $key => $culture)
459 459
 				{
460
-					if(strlen($culture) == 2)
460
+					if (strlen($culture) == 2)
461 461
 						unset($all[$key]);
462 462
 				}
463 463
 				return $all;
@@ -473,17 +473,17 @@  discard block
 block discarded – undo
473 473
 	 */
474 474
 	protected function simplify($obj)
475 475
 	{
476
-		if(is_scalar($obj)) {
476
+		if (is_scalar($obj)) {
477 477
 			return $obj;
478
-		} elseif($obj instanceof \ResourceBundle) {
478
+		} elseif ($obj instanceof \ResourceBundle) {
479 479
 			$array = array();
480
-			foreach($obj as $k => $v)
480
+			foreach ($obj as $k => $v)
481 481
 				$array[$k] = $v;
482 482
 		} else {
483 483
 			$array = $obj;
484 484
 		}
485 485
 
486
-		for($i = 0, $k = count($array); $i<$k; ++$i)
486
+		for ($i = 0, $k = count($array); $i < $k; ++$i)
487 487
 		{
488 488
 			$key = key($array);
489 489
 			if ($key !== null
@@ -512,10 +512,10 @@  discard block
 block discarded – undo
512 512
 	public function getCurrencies()
513 513
 	{
514 514
 		static $arr;
515
-		if($arr === null)
515
+		if ($arr === null)
516 516
 		{
517 517
 			$arr = $this->findInfo('Currencies', false, 'Currencies');
518
-			foreach($arr as $k => $v)
518
+			foreach ($arr as $k => $v)
519 519
 				$arr[$k] = $this->simplify($v);
520 520
 		}
521 521
 		return $arr;
@@ -546,15 +546,15 @@  discard block
 block discarded – undo
546 546
 	public function getTimeZones()
547 547
 	{
548 548
 		static $arr;
549
-		if($arr === null)
549
+		if ($arr === null)
550 550
 		{
551 551
 			$validPrefixes = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Etc', 'Europe', 'Indian', 'Pacific');
552 552
 			$tmp = $this->findInfo('zoneStrings', false, 'zoneStrings');
553
-			foreach($tmp as $k => $v)
553
+			foreach ($tmp as $k => $v)
554 554
 			{
555
-				foreach($validPrefixes as $prefix)
555
+				foreach ($validPrefixes as $prefix)
556 556
 				{
557
-					if(strpos($k, $prefix) === 0)
557
+					if (strpos($k, $prefix) === 0)
558 558
 					{
559 559
 						$arr[] = str_replace(':', '/', $k);
560 560
 						break;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDatePicker.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
595 595
 	}
596 596
 
597 597
 	/**
598
-	 * @return DateTimeFormatInfo date time format information for the current culture.
598
+	 * @return CultureInfo date time format information for the current culture.
599 599
 	 */
600 600
 	protected function getLocalizedCalendarInfo()
601 601
 	{
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 CultureInfo $info localized date format information.
759 759
 	 * @return array localized month names.
760 760
 	 */
761 761
 	protected function getLocalizedMonthNames($info)
Please login to merge, or discard this patch.