Completed
Push — master ( a8e8b7...373ce5 )
by Reginaldo
19:01
created
lib/Cake/Utility/Set.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
  *
929 929
  * @param array $results
930 930
  * @param string $key
931
- * @return array
931
+ * @return string
932 932
  */
933 933
 	protected static function _flatten($results, $key = null) {
934 934
 		$stack = array();
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
  * Allows the application of a callback method to elements of an
997 997
  * array extracted by a Set::extract() compatible path.
998 998
  *
999
- * @param mixed $path Set-compatible path to the array value
999
+ * @param string $path Set-compatible path to the array value
1000 1000
  * @param array $data An array of data to extract from & then process with the $callback.
1001 1001
  * @param mixed $callback Callback method to be applied to extracted data.
1002 1002
  * See http://ca2.php.net/manual/en/language.pseudo-types.php#language.types.callback for examples
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 	public static function merge($data, $merge = null) {
47 47
 		$args = func_get_args();
48 48
 		if (empty($args[1]) && count($args) <= 2) {
49
-			return (array)$args[0];
49
+			return (array) $args[0];
50 50
 		}
51
-		if (!is_array($args[0])) {
52
-			$args[0] = (array)$args[0];
51
+		if ( ! is_array($args[0])) {
52
+			$args[0] = (array) $args[0];
53 53
 		}
54 54
 		return call_user_func_array('Hash::merge', $args);
55 55
 	}
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::pushDiff
75 75
  */
76 76
 	public static function pushDiff($array, $array2) {
77
-		if (empty($array) && !empty($array2)) {
77
+		if (empty($array) && ! empty($array2)) {
78 78
 			return $array2;
79 79
 		}
80
-		if (!empty($array) && !empty($array2)) {
80
+		if ( ! empty($array) && ! empty($array2)) {
81 81
 			foreach ($array2 as $key => $value) {
82
-				if (!array_key_exists($key, $array)) {
82
+				if ( ! array_key_exists($key, $array)) {
83 83
 					$array[$key] = $value;
84 84
 				} else {
85 85
 					if (is_array($value)) {
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 					$out[$key] = Set::_map($value, $class);
145 145
 					if (is_object($out[$key])) {
146 146
 						if ($primary !== true && is_array($value) && Set::countDim($value, true) === 2) {
147
-							if (!isset($out[$key]->_name_)) {
147
+							if ( ! isset($out[$key]->_name_)) {
148 148
 								$out[$key]->_name_ = $primary;
149 149
 							}
150 150
 						}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 				} elseif (is_array($value)) {
153 153
 					if ($primary === true) {
154 154
 						// @codingStandardsIgnoreStart Legacy junk
155
-						if (!isset($out->_name_)) {
155
+						if ( ! isset($out->_name_)) {
156 156
 							$out->_name_ = $key;
157 157
 						}
158 158
 						// @codingStandardsIgnoreEnd
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 							$out->{$key2} = Set::_map($value2, true);
162 162
 						}
163 163
 					} else {
164
-						if (!is_numeric($key)) {
164
+						if ( ! is_numeric($key)) {
165 165
 							$out->{$key} = Set::_map($value, true, $key);
166
-							if (is_object($out->{$key}) && !is_numeric($key)) {
167
-								if (!isset($out->{$key}->_name_)) {
166
+							if (is_object($out->{$key}) && ! is_numeric($key)) {
167
+								if ( ! isset($out->{$key}->_name_)) {
168 168
 									$out->{$key}->_name_ = $key;
169 169
 								}
170 170
 							}
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		$extracted = array();
236 236
 		$count = count($keys);
237 237
 
238
-		if (!$count) {
238
+		if ( ! $count) {
239 239
 			return;
240 240
 		}
241 241
 
@@ -328,9 +328,9 @@  discard block
 block discarded – undo
328 328
 		}
329 329
 		$contexts = $data;
330 330
 		$options = array_merge(array('flatten' => true), $options);
331
-		if (!isset($contexts[0])) {
331
+		if ( ! isset($contexts[0])) {
332 332
 			$current = current($data);
333
-			if ((is_array($current) && count($data) < 1) || !is_array($current) || !Set::numeric(array_keys($data))) {
333
+			if ((is_array($current) && count($data) < 1) || ! is_array($current) || ! Set::numeric(array_keys($data))) {
334 334
 				$contexts = array($data);
335 335
 			}
336 336
 		}
@@ -345,19 +345,19 @@  discard block
 block discarded – undo
345 345
 			}
346 346
 			$matches = array();
347 347
 			foreach ($contexts as $key => $context) {
348
-				if (!isset($context['trace'])) {
348
+				if ( ! isset($context['trace'])) {
349 349
 					$context = array('trace' => array(null), 'item' => $context, 'key' => $key);
350 350
 				}
351 351
 				if ($token === '..') {
352 352
 					if (count($context['trace']) === 1) {
353 353
 						$context['trace'][] = $context['key'];
354 354
 					}
355
-					$parent = implode('/', $context['trace']) . '/.';
355
+					$parent = implode('/', $context['trace']).'/.';
356 356
 					$context['item'] = Set::extract($parent, $data);
357 357
 					$context['key'] = array_pop($context['trace']);
358 358
 					if (isset($context['trace'][1]) && $context['trace'][1] > 0) {
359 359
 						$context['item'] = $context['item'][0];
360
-					} elseif (!empty($context['item'][$key])) {
360
+					} elseif ( ! empty($context['item'][$key])) {
361 361
 						$context['item'] = $context['item'][$key];
362 362
 					} else {
363 363
 						$context['item'] = array_shift($context['item']);
@@ -367,27 +367,27 @@  discard block
 block discarded – undo
367 367
 				}
368 368
 				if ($token === '@*' && is_array($context['item'])) {
369 369
 					$matches[] = array(
370
-						'trace' => array_merge($context['trace'], (array)$key),
370
+						'trace' => array_merge($context['trace'], (array) $key),
371 371
 						'key' => $key,
372 372
 						'item' => array_keys($context['item']),
373 373
 					);
374 374
 				} elseif (is_array($context['item'])
375 375
 					&& array_key_exists($token, $context['item'])
376
-					&& !(strval($key) === strval($token) && count($tokens) === 1 && $tokens[0] === '.')) {
376
+					&& ! (strval($key) === strval($token) && count($tokens) === 1 && $tokens[0] === '.')) {
377 377
 					$items = $context['item'][$token];
378
-					if (!is_array($items)) {
378
+					if ( ! is_array($items)) {
379 379
 						$items = array($items);
380
-					} elseif (!isset($items[0])) {
380
+					} elseif ( ! isset($items[0])) {
381 381
 						$current = current($items);
382 382
 						$currentKey = key($items);
383
-						if (!is_array($current) || (is_array($current) && count($items) <= 1 && !is_numeric($currentKey))) {
383
+						if ( ! is_array($current) || (is_array($current) && count($items) <= 1 && ! is_numeric($currentKey))) {
384 384
 							$items = array($items);
385 385
 						}
386 386
 					}
387 387
 
388 388
 					foreach ($items as $key => $item) {
389 389
 						$ctext = array($context['key']);
390
-						if (!is_numeric($key)) {
390
+						if ( ! is_numeric($key)) {
391 391
 							$ctext[] = $token;
392 392
 							$tok = array_shift($tokens);
393 393
 							if (isset($items[$tok])) {
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 		$r = array();
444 444
 
445 445
 		foreach ($matches as $match) {
446
-			if ((!$options['flatten'] || is_array($match['item'])) && !is_int($match['key'])) {
446
+			if (( ! $options['flatten'] || is_array($match['item'])) && ! is_int($match['key'])) {
447 447
 				$r[] = array($match['key'] => $match['item']);
448 448
 			} else {
449 449
 				$r[] = $match['item'];
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 			return true;
468 468
 		}
469 469
 		if (is_string($conditions)) {
470
-			return (bool)Set::extract($conditions, $data);
470
+			return (bool) Set::extract($conditions, $data);
471 471
 		}
472 472
 		foreach ($conditions as $condition) {
473 473
 			if ($condition === ':last') {
@@ -481,20 +481,20 @@  discard block
 block discarded – undo
481 481
 				}
482 482
 				continue;
483 483
 			}
484
-			if (!preg_match('/(.+?)([><!]?[=]|[><])(.*)/', $condition, $match)) {
484
+			if ( ! preg_match('/(.+?)([><!]?[=]|[><])(.*)/', $condition, $match)) {
485 485
 				if (ctype_digit($condition)) {
486 486
 					if ($i != $condition) {
487 487
 						return false;
488 488
 					}
489 489
 				} elseif (preg_match_all('/(?:^[0-9]+|(?<=,)[0-9]+)/', $condition, $matches)) {
490 490
 					return in_array($i, $matches[0]);
491
-				} elseif (!array_key_exists($condition, $data)) {
491
+				} elseif ( ! array_key_exists($condition, $data)) {
492 492
 					return false;
493 493
 				}
494 494
 				continue;
495 495
 			}
496 496
 			list(, $key, $op, $expected) = $match;
497
-			if (!(isset($data[$key]) || array_key_exists($key, $data))) {
497
+			if ( ! (isset($data[$key]) || array_key_exists($key, $data))) {
498 498
 				return false;
499 499
 			}
500 500
 
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 			return $data;
542 542
 		}
543 543
 		if (is_object($data)) {
544
-			if (!($data instanceof ArrayAccess || $data instanceof Traversable)) {
544
+			if ( ! ($data instanceof ArrayAccess || $data instanceof Traversable)) {
545 545
 				$data = get_object_vars($data);
546 546
 			}
547 547
 		}
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 				$pattern = substr($key, 1, -1);
595 595
 
596 596
 				foreach ($data as $j => $val) {
597
-					if (preg_match('/^' . $pattern . '/s', $j) !== 0) {
597
+					if (preg_match('/^'.$pattern.'/s', $j) !== 0) {
598 598
 						$tmpPath = array_slice($path, $i + 1);
599 599
 						if (empty($tmpPath)) {
600 600
 							$tmp[$j] = $val;
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 		if (empty($path)) {
653 653
 			return $data;
654 654
 		}
655
-		if (!is_array($path)) {
655
+		if ( ! is_array($path)) {
656 656
 			$path = explode('.', $path);
657 657
 		}
658 658
 
@@ -664,10 +664,10 @@  discard block
 block discarded – undo
664 664
 				return (is_array($data) && array_key_exists($key, $data));
665 665
 			}
666 666
 
667
-			if (!is_array($data) || !array_key_exists($key, $data)) {
667
+			if ( ! is_array($data) || ! array_key_exists($key, $data)) {
668 668
 				return false;
669 669
 			}
670
-			$data =& $data[$key];
670
+			$data = & $data[$key];
671 671
 		}
672 672
 		return true;
673 673
 	}
@@ -683,10 +683,10 @@  discard block
 block discarded – undo
683 683
  */
684 684
 	public static function diff($val1, $val2 = null) {
685 685
 		if (empty($val1)) {
686
-			return (array)$val2;
686
+			return (array) $val2;
687 687
 		}
688 688
 		if (empty($val2)) {
689
-			return (array)$val1;
689
+			return (array) $val1;
690 690
 		}
691 691
 		$intersection = array_intersect_key($val1, $val2);
692 692
 		while (($key = key($intersection)) !== null) {
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 			if (is_numeric($key)) {
718 718
 				Set::contains($val, $val1);
719 719
 			} else {
720
-				if (!isset($val1[$key]) || $val1[$key] != $val) {
720
+				if ( ! isset($val1[$key]) || $val1[$key] != $val) {
721 721
 					return false;
722 722
 				}
723 723
 			}
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 		}
801 801
 
802 802
 		if (is_object($data)) {
803
-			if (!($data instanceof ArrayAccess || $data instanceof Traversable)) {
803
+			if ( ! ($data instanceof ArrayAccess || $data instanceof Traversable)) {
804 804
 				$data = get_object_vars($data);
805 805
 			}
806 806
 		}
@@ -815,10 +815,10 @@  discard block
 block discarded – undo
815 815
 			return array();
816 816
 		}
817 817
 
818
-		if (!empty($path2) && is_array($path2)) {
818
+		if ( ! empty($path2) && is_array($path2)) {
819 819
 			$format = array_shift($path2);
820 820
 			$vals = Set::format($data, $format, $path2);
821
-		} elseif (!empty($path2)) {
821
+		} elseif ( ! empty($path2)) {
822 822
 			$vals = Set::extract($data, $path2);
823 823
 		} else {
824 824
 			$count = count($keys);
@@ -829,13 +829,13 @@  discard block
 block discarded – undo
829 829
 
830 830
 		if ($groupPath) {
831 831
 			$group = Set::extract($data, $groupPath);
832
-			if (!empty($group)) {
832
+			if ( ! empty($group)) {
833 833
 				$c = count($keys);
834 834
 				for ($i = 0; $i < $c; $i++) {
835
-					if (!isset($group[$i])) {
835
+					if ( ! isset($group[$i])) {
836 836
 						$group[$i] = 0;
837 837
 					}
838
-					if (!isset($out[$group[$i]])) {
838
+					if ( ! isset($out[$group[$i]])) {
839 839
 						$out[$group[$i]] = array();
840 840
 					}
841 841
 					$out[$group[$i]][$keys[$i]] = $vals[$i];
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 			$new = array();
869 869
 			foreach ($keys as $key => $value) {
870 870
 				if (is_array($value)) {
871
-					$new[$key] = (array)Set::reverse($value);
871
+					$new[$key] = (array) Set::reverse($value);
872 872
 				} else {
873 873
 					// @codingStandardsIgnoreStart Legacy junk
874 874
 					if (isset($value->_name_)) {
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
 			if ($key !== null) {
938 938
 				$id = $key;
939 939
 			}
940
-			if (is_array($r) && !empty($r)) {
940
+			if (is_array($r) && ! empty($r)) {
941 941
 				$stack = array_merge($stack, Set::_flatten($r, $id));
942 942
 			} else {
943 943
 				$stack[] = array('id' => $id, 'value' => $r);
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
  * @link
1037 1037
  */
1038 1038
 	public static function nest($data, $options = array()) {
1039
-		if (!$data) {
1039
+		if ( ! $data) {
1040 1040
 			return $data;
1041 1041
 		}
1042 1042
 
@@ -1060,14 +1060,14 @@  discard block
 block discarded – undo
1060 1060
 			$parentId = Set::get($result, $parentKeys);
1061 1061
 
1062 1062
 			if (isset($idMap[$id][$options['children']])) {
1063
-				$idMap[$id] = array_merge($result, (array)$idMap[$id]);
1063
+				$idMap[$id] = array_merge($result, (array) $idMap[$id]);
1064 1064
 			} else {
1065 1065
 				$idMap[$id] = array_merge($result, array($options['children'] => array()));
1066 1066
 			}
1067
-			if (!$parentId || !in_array($parentId, $ids)) {
1068
-				$return[] =& $idMap[$id];
1067
+			if ( ! $parentId || ! in_array($parentId, $ids)) {
1068
+				$return[] = & $idMap[$id];
1069 1069
 			} else {
1070
-				$idMap[$parentId][$options['children']][] =& $idMap[$id];
1070
+				$idMap[$parentId][$options['children']][] = & $idMap[$id];
1071 1071
 			}
1072 1072
 		}
1073 1073
 
Please login to merge, or discard this patch.
lib/Cake/Utility/String.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
  * Generate a random UUID
29 29
  *
30 30
  * @see http://www.ietf.org/rfc/rfc4122.txt
31
- * @return RFC 4122 UUID
31
+ * @return string 4122 UUID
32 32
  */
33 33
 	public static function uuid() {
34 34
 		$node = env('SERVER_ADDR');
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		if (strpos($node, ':') !== false) {
37 37
 			if (substr_count($node, '::')) {
38 38
 				$node = str_replace(
39
-					'::', str_repeat(':0000', 8 - substr_count($node, ':')) . ':', $node
39
+					'::', str_repeat(':0000', 8 - substr_count($node, ':')).':', $node
40 40
 				);
41 41
 			}
42 42
 			$node = explode(':', $node);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 				$host = env('HOST');
60 60
 			}
61 61
 
62
-			if (!empty($host)) {
62
+			if ( ! empty($host)) {
63 63
 				$ip = gethostbyname($host);
64 64
 
65 65
 				if ($ip === $host) {
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 			$pid = getmypid();
87 87
 		}
88 88
 
89
-		if (!$pid || $pid > 65535) {
89
+		if ( ! $pid || $pid > 65535) {
90 90
 			$pid = mt_rand(0, 0xfff) | 0x4000;
91 91
 		}
92 92
 
93 93
 		list($timeMid, $timeLow) = explode(' ', microtime());
94 94
 		return sprintf(
95
-			"%08x-%04x-%04x-%02x%02x-%04x%08x", (int)$timeLow, (int)substr($timeMid, 2) & 0xffff,
95
+			"%08x-%04x-%04x-%02x%02x-%04x%08x", (int) $timeLow, (int) substr($timeMid, 2) & 0xffff,
96 96
 			mt_rand(0, 0xfff) | 0x4000, mt_rand(0, 0x3f) | 0x80, mt_rand(0, 0xff), $pid, $node
97 97
 		);
98 98
 	}
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 			}
134 134
 			if ($tmpOffset !== -1) {
135 135
 				$buffer .= substr($data, $offset, ($tmpOffset - $offset));
136
-				if (!$depth && $data{$tmpOffset} == $separator) {
136
+				if ( ! $depth && $data{$tmpOffset} == $separator) {
137 137
 					$results[] = $buffer;
138 138
 					$buffer = '';
139 139
 				} else {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 					}
149 149
 				} else {
150 150
 					if ($data{$tmpOffset} == $leftBound) {
151
-						if (!$open) {
151
+						if ( ! $open) {
152 152
 							$depth++;
153 153
 							$open = true;
154 154
 						} else {
@@ -158,15 +158,15 @@  discard block
 block discarded – undo
158 158
 				}
159 159
 				$offset = ++$tmpOffset;
160 160
 			} else {
161
-				$results[] = $buffer . substr($data, $offset);
161
+				$results[] = $buffer.substr($data, $offset);
162 162
 				$offset = $length + 1;
163 163
 			}
164 164
 		}
165
-		if (empty($results) && !empty($buffer)) {
165
+		if (empty($results) && ! empty($buffer)) {
166 166
 			$results[] = $buffer;
167 167
 		}
168 168
 
169
-		if (!empty($results)) {
169
+		if ( ! empty($results)) {
170 170
 			return array_map('trim', $results);
171 171
 		}
172 172
 
@@ -200,12 +200,12 @@  discard block
 block discarded – undo
200 200
 		);
201 201
 		$options += $defaults;
202 202
 		$format = $options['format'];
203
-		$data = (array)$data;
203
+		$data = (array) $data;
204 204
 		if (empty($data)) {
205 205
 			return ($options['clean']) ? String::cleanInsert($str, $options) : $str;
206 206
 		}
207 207
 
208
-		if (!isset($format)) {
208
+		if ( ! isset($format)) {
209 209
 			$format = sprintf(
210 210
 				'/(?<!%s)%s%%s%s/',
211 211
 				preg_quote($options['escape'], '/'),
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 			$str = str_replace($tmpHash, $tmpValue, $str);
242 242
 		}
243 243
 
244
-		if (!isset($options['format']) && isset($options['before'])) {
245
-			$str = str_replace($options['escape'] . $options['before'], $options['before'], $str);
244
+		if ( ! isset($options['format']) && isset($options['before'])) {
245
+			$str = str_replace($options['escape'].$options['before'], $options['before'], $str);
246 246
 		}
247 247
 		return ($options['clean']) ? String::cleanInsert($str, $options) : $str;
248 248
 	}
@@ -260,13 +260,13 @@  discard block
 block discarded – undo
260 260
  */
261 261
 	public static function cleanInsert($str, $options) {
262 262
 		$clean = $options['clean'];
263
-		if (!$clean) {
263
+		if ( ! $clean) {
264 264
 			return $str;
265 265
 		}
266 266
 		if ($clean === true) {
267 267
 			$clean = array('method' => 'text');
268 268
 		}
269
-		if (!is_array($clean)) {
269
+		if ( ! is_array($clean)) {
270 270
 			$clean = array('method' => $options['clean']);
271 271
 		}
272 272
 		switch ($clean['method']) {
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
 		} else {
337 337
 			$wrapped = trim(chunk_split($text, $options['width'] - 1, "\n"));
338 338
 		}
339
-		if (!empty($options['indent'])) {
339
+		if ( ! empty($options['indent'])) {
340 340
 			$chunks = explode("\n", $wrapped);
341 341
 			for ($i = $options['indentAt'], $len = count($chunks); $i < $len; $i++) {
342
-				$chunks[$i] = $options['indent'] . $chunks[$i];
342
+				$chunks[$i] = $options['indent'].$chunks[$i];
343 343
 			}
344 344
 			$wrapped = implode("\n", $chunks);
345 345
 		}
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 			$with = array();
430 430
 
431 431
 			foreach ($phrase as $key => $segment) {
432
-				$segment = '(' . preg_quote($segment, '|') . ')';
432
+				$segment = '('.preg_quote($segment, '|').')';
433 433
 				if ($html) {
434 434
 					$segment = "(?![^<]+>)$segment(?![^<]+>)";
435 435
 				}
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 			return preg_replace($replace, $with, $text);
442 442
 		}
443 443
 
444
-		$phrase = '(' . preg_quote($phrase, '|') . ')';
444
+		$phrase = '('.preg_quote($phrase, '|').')';
445 445
 		if ($html) {
446 446
 			$phrase = "(?![^<]+>)$phrase(?![^<]+>)";
447 447
 		}
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 		$options = array_merge($default, $options);
484 484
 		extract($options);
485 485
 
486
-		if (!function_exists('mb_strlen')) {
486
+		if ( ! function_exists('mb_strlen')) {
487 487
 			class_exists('Multibyte');
488 488
 		}
489 489
 
@@ -492,12 +492,12 @@  discard block
 block discarded – undo
492 492
 		}
493 493
 
494 494
 		$truncate = mb_substr($text, mb_strlen($text) - $length + mb_strlen($ellipsis));
495
-		if (!$exact) {
495
+		if ( ! $exact) {
496 496
 			$spacepos = mb_strpos($truncate, ' ');
497 497
 			$truncate = $spacepos === false ? '' : trim(mb_substr($truncate, $spacepos));
498 498
 		}
499 499
 
500
-		return $ellipsis . $truncate;
500
+		return $ellipsis.$truncate;
501 501
 	}
502 502
 
503 503
 /**
@@ -524,13 +524,13 @@  discard block
 block discarded – undo
524 524
 		);
525 525
 		if (isset($options['ending'])) {
526 526
 			$default['ellipsis'] = $options['ending'];
527
-		} elseif (!empty($options['html']) && Configure::read('App.encoding') === 'UTF-8') {
527
+		} elseif ( ! empty($options['html']) && Configure::read('App.encoding') === 'UTF-8') {
528 528
 			$default['ellipsis'] = "\xe2\x80\xa6";
529 529
 		}
530 530
 		$options = array_merge($default, $options);
531 531
 		extract($options);
532 532
 
533
-		if (!function_exists('mb_strlen')) {
533
+		if ( ! function_exists('mb_strlen')) {
534 534
 			class_exists('Multibyte');
535 535
 		}
536 536
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 
545 545
 			preg_match_all('/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);
546 546
 			foreach ($tags as $tag) {
547
-				if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {
547
+				if ( ! preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {
548 548
 					if (preg_match('/<[\w]+[^>]*>/s', $tag[0])) {
549 549
 						array_unshift($openTags, $tag[2]);
550 550
 					} elseif (preg_match('/<\/([\w]+)[^>]*>/s', $tag[0], $closeTag)) {
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 			}
588 588
 			$truncate = mb_substr($text, 0, $length - mb_strlen($ellipsis));
589 589
 		}
590
-		if (!$exact) {
590
+		if ( ! $exact) {
591 591
 			$spacepos = mb_strrpos($truncate, ' ');
592 592
 			if ($html) {
593 593
 				$truncateCheck = mb_substr($truncate, 0, $spacepos);
@@ -600,10 +600,10 @@  discard block
 block discarded – undo
600 600
 				}
601 601
 				$bits = mb_substr($truncate, $spacepos);
602 602
 				preg_match_all('/<\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);
603
-				if (!empty($droppedTags)) {
604
-					if (!empty($openTags)) {
603
+				if ( ! empty($droppedTags)) {
604
+					if ( ! empty($openTags)) {
605 605
 						foreach ($droppedTags as $closingTag) {
606
-							if (!in_array($closingTag[1], $openTags)) {
606
+							if ( ! in_array($closingTag[1], $openTags)) {
607 607
 								array_unshift($openTags, $closingTag[1]);
608 608
 							}
609 609
 						}
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 
621 621
 		if ($html) {
622 622
 			foreach ($openTags as $tag) {
623
-				$truncate .= '</' . $tag . '>';
623
+				$truncate .= '</'.$tag.'>';
624 624
 			}
625 625
 		}
626 626
 
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 
651 651
 		$pos = mb_strpos(mb_strtolower($text), mb_strtolower($phrase));
652 652
 		if ($pos === false) {
653
-			return mb_substr($text, 0, $radius) . $ellipsis;
653
+			return mb_substr($text, 0, $radius).$ellipsis;
654 654
 		}
655 655
 
656 656
 		$startPos = $pos - $radius;
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 		}
667 667
 
668 668
 		$excerpt = mb_substr($text, $startPos, $endPos - $startPos);
669
-		$excerpt = $prepend . $excerpt . $append;
669
+		$excerpt = $prepend.$excerpt.$append;
670 670
 
671 671
 		return $excerpt;
672 672
 	}
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
  */
683 683
 	public static function toList($list, $and = 'and', $separator = ', ') {
684 684
 		if (count($list) > 1) {
685
-			return implode($separator, array_slice($list, null, -1)) . ' ' . $and . ' ' . array_pop($list);
685
+			return implode($separator, array_slice($list, null, -1)).' '.$and.' '.array_pop($list);
686 686
 		}
687 687
 
688 688
 		return array_pop($list);
Please login to merge, or discard this patch.
lib/Cake/Utility/Validation.php 2 patches
Doc Comments   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
  * $check can be passed as an array:
59 59
  * array('check' => 'valueToCheck');
60 60
  *
61
- * @param string|array $check Value to check
61
+ * @param string $check Value to check
62 62
  * @return boolean Success
63 63
  */
64 64
 	public static function notEmpty($check) {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
  * Validation of credit card numbers.
131 131
  * Returns true if $check is in the proper credit card format.
132 132
  *
133
- * @param string|array $check credit card number to validate
133
+ * @param string $check credit card number to validate
134 134
  * @param string|array $type 'all' may be passed as a sting, defaults to fast which checks format of most major credit cards
135 135
  *    if an array is used only the values of the array are checked.
136 136
  *    Example: array('amex', 'bankcard', 'maestro')
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
  * Check that value has a valid file extension.
486 486
  *
487 487
  * @param string|array $check Value to check
488
- * @param array $extensions file extensions to allow. By default extensions are 'gif', 'jpeg', 'png', 'jpg'
488
+ * @param string[] $extensions file extensions to allow. By default extensions are 'gif', 'jpeg', 'png', 'jpg'
489 489
  * @return boolean Success
490 490
  */
491 491
 	public static function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) {
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 /**
623 623
  * Check that a value is a valid phone number.
624 624
  *
625
- * @param string|array $check Value to check (string or array)
625
+ * @param string $check Value to check (string or array)
626 626
  * @param string $regex Regular expression to use
627 627
  * @param string $country Country code (defaults to 'all')
628 628
  * @return boolean Success
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 /**
668 668
  * Checks that a given value is a valid postal code.
669 669
  *
670
- * @param string|array $check Value to check
670
+ * @param string $check Value to check
671 671
  * @param string $regex Regular expression to use
672 672
  * @param string $country Country to use for formatting
673 673
  * @return boolean Success
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 /**
729 729
  * Checks that a value is a valid Social Security Number.
730 730
  *
731
- * @param string|array $check Value to check
731
+ * @param string $check Value to check
732 732
  * @param string $regex Regular expression to use
733 733
  * @param string $country Country
734 734
  * @return boolean Success
@@ -800,11 +800,11 @@  discard block
 block discarded – undo
800 800
 /**
801 801
  * Runs an user-defined validation.
802 802
  *
803
- * @param string|array $check value that will be validated in user-defined methods.
804
- * @param object $object class that holds validation method
803
+ * @param string $check value that will be validated in user-defined methods.
804
+ * @param CustomValidator $object class that holds validation method
805 805
  * @param string $method class method name for validation to run
806 806
  * @param array $args arguments to send to method
807
- * @return mixed user-defined class class method returns
807
+ * @return boolean user-defined class class method returns
808 808
  */
809 809
 	public static function userDefined($check, $object, $method, $args = null) {
810 810
 		return call_user_func_array(array($object, $method), array($check, $args));
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
  * Checks the mime type of a file
920 920
  *
921 921
  * @param string|array $check
922
- * @param array $mimeTypes to check for
922
+ * @param string[] $mimeTypes to check for
923 923
  * @return boolean Success
924 924
  * @throws CakeException when mime type can not be determined.
925 925
  */
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 App::uses('CakeNumber', 'Utility');
21 21
 
22 22
 // Load multibyte if the extension is missing.
23
-if (!function_exists('mb_strlen')) {
23
+if ( ! function_exists('mb_strlen')) {
24 24
 	class_exists('Multibyte');
25 25
 }
26 26
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		if (is_array($check)) {
124 124
 			extract(self::_defaults($check));
125 125
 		}
126
-		return !self::_check($check, '/[^\\s]/');
126
+		return ! self::_check($check, '/[^\\s]/');
127 127
 	}
128 128
 
129 129
 /**
@@ -308,31 +308,31 @@  discard block
 block discarded – undo
308 308
 		$separator = '([- /.])';
309 309
 		$fourDigitYear = '(([1][9][0-9][0-9])|([2][0-9][0-9][0-9]))';
310 310
 		$twoDigitYear = '([0-9]{2})';
311
-		$year = '(?:' . $fourDigitYear . '|' . $twoDigitYear . ')';
311
+		$year = '(?:'.$fourDigitYear.'|'.$twoDigitYear.')';
312 312
 
313
-		$regex['dmy'] = '%^(?:(?:31(\\/|-|\\.|\\x20)(?:0?[13578]|1[02]))\\1|(?:(?:29|30)' .
314
-			$separator . '(?:0?[1,3-9]|1[0-2])\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:29' .
315
-			$separator . '0?2\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\\d|2[0-8])' .
316
-			$separator . '(?:(?:0?[1-9])|(?:1[0-2]))\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%';
313
+		$regex['dmy'] = '%^(?:(?:31(\\/|-|\\.|\\x20)(?:0?[13578]|1[02]))\\1|(?:(?:29|30)'.
314
+			$separator.'(?:0?[1,3-9]|1[0-2])\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:29'.
315
+			$separator.'0?2\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\\d|2[0-8])'.
316
+			$separator.'(?:(?:0?[1-9])|(?:1[0-2]))\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%';
317 317
 
318
-		$regex['mdy'] = '%^(?:(?:(?:0?[13578]|1[02])(\\/|-|\\.|\\x20)31)\\1|(?:(?:0?[13-9]|1[0-2])' .
319
-			$separator . '(?:29|30)\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:0?2' . $separator . '29\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))' .
320
-			$separator . '(?:0?[1-9]|1\\d|2[0-8])\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%';
318
+		$regex['mdy'] = '%^(?:(?:(?:0?[13578]|1[02])(\\/|-|\\.|\\x20)31)\\1|(?:(?:0?[13-9]|1[0-2])'.
319
+			$separator.'(?:29|30)\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:0?2'.$separator.'29\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))'.
320
+			$separator.'(?:0?[1-9]|1\\d|2[0-8])\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%';
321 321
 
322
-		$regex['ymd'] = '%^(?:(?:(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))' .
323
-			$separator . '(?:0?2\\1(?:29)))|(?:(?:(?:1[6-9]|[2-9]\\d)?\\d{2})' .
324
-			$separator . '(?:(?:(?:0?[13578]|1[02])\\2(?:31))|(?:(?:0?[1,3-9]|1[0-2])\\2(29|30))|(?:(?:0?[1-9])|(?:1[0-2]))\\2(?:0?[1-9]|1\\d|2[0-8]))))$%';
322
+		$regex['ymd'] = '%^(?:(?:(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))'.
323
+			$separator.'(?:0?2\\1(?:29)))|(?:(?:(?:1[6-9]|[2-9]\\d)?\\d{2})'.
324
+			$separator.'(?:(?:(?:0?[13578]|1[02])\\2(?:31))|(?:(?:0?[1,3-9]|1[0-2])\\2(29|30))|(?:(?:0?[1-9])|(?:1[0-2]))\\2(?:0?[1-9]|1\\d|2[0-8]))))$%';
325 325
 
326 326
 		$regex['dMy'] = '/^((31(?!\\ (Feb(ruary)?|Apr(il)?|June?|(Sep(?=\\b|t)t?|Nov)(ember)?)))|((30|29)(?!\\ Feb(ruary)?))|(29(?=\\ Feb(ruary)?\\ (((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|1\\d|2[0-8])\\ (Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)\\ ((1[6-9]|[2-9]\\d)\\d{2})$/';
327 327
 
328 328
 		$regex['Mdy'] = '/^(?:(((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|Oct(ober)?|Dec(ember)?)\\ 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep)(tember)?|(Nov|Dec)(ember)?)\\ (0?[1-9]|([12]\\d)|30))|(Feb(ruary)?\\ (0?[1-9]|1\\d|2[0-8]|(29(?=,?\\ ((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))))\\,?\\ ((1[6-9]|[2-9]\\d)\\d{2}))$/';
329 329
 
330
-		$regex['My'] = '%^(Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)' .
331
-			$separator . '((1[6-9]|[2-9]\\d)\\d{2})$%';
330
+		$regex['My'] = '%^(Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)'.
331
+			$separator.'((1[6-9]|[2-9]\\d)\\d{2})$%';
332 332
 
333
-		$regex['my'] = '%^(' . $month . $separator . $year . ')$%';
334
-		$regex['ym'] = '%^(' . $year . $separator . $month . ')$%';
335
-		$regex['y'] = '%^(' . $fourDigitYear . ')$%';
333
+		$regex['my'] = '%^('.$month.$separator.$year.')$%';
334
+		$regex['ym'] = '%^('.$year.$separator.$month.')$%';
335
+		$regex['y'] = '%^('.$fourDigitYear.')$%';
336 336
 
337 337
 		$format = (is_array($format)) ? array_values($format) : array($format);
338 338
 		foreach ($format as $key) {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 	public static function datetime($check, $dateFormat = 'ymd', $regex = null) {
359 359
 		$valid = false;
360 360
 		$parts = explode(' ', $check);
361
-		if (!empty($parts) && count($parts) > 1) {
361
+		if ( ! empty($parts) && count($parts) > 1) {
362 362
 			$time = array_pop($parts);
363 363
 			$date = implode(' ', $parts);
364 364
 			$valid = self::date($date, $dateFormat, $regex) && self::time($time);
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 				$regex = "/^{$sign}{$dnum}{$exp}$/";
421 421
 
422 422
 			} elseif (is_numeric($places)) {
423
-				$places = '[0-9]{' . $places . '}';
423
+				$places = '[0-9]{'.$places.'}';
424 424
 				$dnum = "(?:[0-9]*[\.]{$places}|{$lnum}[\.]{$places})";
425 425
 				$regex = "/^{$sign}{$dnum}{$exp}$/";
426 426
 			}
@@ -451,14 +451,14 @@  discard block
 block discarded – undo
451 451
 		}
452 452
 
453 453
 		if ($regex === null) {
454
-			$regex = '/^[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . self::$_pattern['hostname'] . '$/ui';
454
+			$regex = '/^[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]+)*@'.self::$_pattern['hostname'].'$/ui';
455 455
 		}
456 456
 		$return = self::_check($check, $regex);
457 457
 		if ($deep === false || $deep === null) {
458 458
 			return $return;
459 459
 		}
460 460
 
461
-		if ($return === true && preg_match('/@(' . self::$_pattern['hostname'] . ')$/i', $check, $regs)) {
461
+		if ($return === true && preg_match('/@('.self::$_pattern['hostname'].')$/i', $check, $regs)) {
462 462
 			if (function_exists('getmxrr') && getmxrr($regs[1], $mxhosts)) {
463 463
 				return true;
464 464
 			}
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 		if ($type === 'ipv6') {
518 518
 			$flags = FILTER_FLAG_IPV6;
519 519
 		}
520
-		return (bool)filter_var($check, FILTER_VALIDATE_IP, array('flags' => $flags));
520
+		return (bool) filter_var($check, FILTER_VALIDATE_IP, array('flags' => $flags));
521 521
 	}
522 522
 
523 523
 /**
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 	public static function money($check, $symbolPosition = 'left') {
553 553
 		$money = '(?!0,?\d)(?:\d{1,3}(?:([, .])\d{3})?(?:\1\d{3})*|(?:\d+))((?!\1)[,.]\d{1,2})?';
554 554
 		if ($symbolPosition === 'right') {
555
-			$regex = '/^' . $money . '(?<!\x{00a2})\p{Sc}?$/u';
555
+			$regex = '/^'.$money.'(?<!\x{00a2})\p{Sc}?$/u';
556 556
 		} else {
557
-			$regex = '/^(?!\x{00a2})\p{Sc}?' . $money . '$/u';
557
+			$regex = '/^(?!\x{00a2})\p{Sc}?'.$money.'$/u';
558 558
 		}
559 559
 		return self::_check($check, $regex);
560 560
 	}
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	public static function multiple($check, $options = array(), $strict = true) {
577 577
 		$defaults = array('in' => null, 'max' => null, 'min' => null);
578 578
 		$options = array_merge($defaults, $options);
579
-		$check = array_filter((array)$check);
579
+		$check = array_filter((array) $check);
580 580
 		if (empty($check)) {
581 581
 			return false;
582 582
 		}
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 		}
589 589
 		if ($options['in'] && is_array($options['in'])) {
590 590
 			foreach ($check as $val) {
591
-				if (!in_array($val, $options['in'], $strict)) {
591
+				if ( ! in_array($val, $options['in'], $strict)) {
592 592
 					return false;
593 593
 				}
594 594
 			}
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
 
645 645
 					// Area code 555, X11 is not allowed.
646 646
 					$areaCode = '(?![2-9]11)(?!555)([2-9][0-8][0-9])';
647
-					$regex .= '(?:\(\s*' . $areaCode . '\s*\)|' . $areaCode . ')';
647
+					$regex .= '(?:\(\s*'.$areaCode.'\s*\)|'.$areaCode.')';
648 648
 					$regex .= '\s*(?:[.-]\s*)?)';
649 649
 
650 650
 					// Exchange and 555-XXXX numbers
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
  * @return boolean Success
717 717
  */
718 718
 	public static function range($check, $lower = null, $upper = null) {
719
-		if (!is_numeric($check)) {
719
+		if ( ! is_numeric($check)) {
720 720
 			return false;
721 721
 		}
722 722
 		if (isset($lower) && isset($upper)) {
@@ -776,12 +776,12 @@  discard block
 block discarded – undo
776 776
  */
777 777
 	public static function url($check, $strict = false) {
778 778
 		self::_populateIp();
779
-		$validChars = '([' . preg_quote('!"$&\'()*+,-.@_:;=~[]') . '\/0-9\p{L}\p{N}]|(%[0-9a-f]{2}))';
780
-		$regex = '/^(?:(?:https?|ftps?|sftp|file|news|gopher):\/\/)' . (!empty($strict) ? '' : '?') .
781
-			'(?:' . self::$_pattern['IPv4'] . '|\[' . self::$_pattern['IPv6'] . '\]|' . self::$_pattern['hostname'] . ')(?::[1-9][0-9]{0,4})?' .
782
-			'(?:\/?|\/' . $validChars . '*)?' .
783
-			'(?:\?' . $validChars . '*)?' .
784
-			'(?:#' . $validChars . '*)?$/iu';
779
+		$validChars = '(['.preg_quote('!"$&\'()*+,-.@_:;=~[]').'\/0-9\p{L}\p{N}]|(%[0-9a-f]{2}))';
780
+		$regex = '/^(?:(?:https?|ftps?|sftp|file|news|gopher):\/\/)'.( ! empty($strict) ? '' : '?').
781
+			'(?:'.self::$_pattern['IPv4'].'|\['.self::$_pattern['IPv6'].'\]|'.self::$_pattern['hostname'].')(?::[1-9][0-9]{0,4})?'.
782
+			'(?:\/?|\/'.$validChars.'*)?'.
783
+			'(?:\?'.$validChars.'*)?'.
784
+			'(?:#'.$validChars.'*)?$/iu';
785 785
 		return self::_check($check, $regex);
786 786
 	}
787 787
 
@@ -832,16 +832,16 @@  discard block
 block discarded – undo
832 832
  * @return mixed Return of Passed method, false on failure
833 833
  */
834 834
 	protected static function _pass($method, $check, $classPrefix) {
835
-		$className = ucwords($classPrefix) . 'Validation';
836
-		if (!class_exists($className)) {
835
+		$className = ucwords($classPrefix).'Validation';
836
+		if ( ! class_exists($className)) {
837 837
 			trigger_error(__d('cake_dev', 'Could not find %s class, unable to complete validation.', $className), E_USER_WARNING);
838 838
 			return false;
839 839
 		}
840
-		if (!method_exists($className, $method)) {
840
+		if ( ! method_exists($className, $method)) {
841 841
 			trigger_error(__d('cake_dev', 'Method %s does not exist on %s unable to complete validation.', $method, $className), E_USER_WARNING);
842 842
 			return false;
843 843
 		}
844
-		$check = (array)$check;
844
+		$check = (array) $check;
845 845
 		return call_user_func_array(array($className, $method), $check);
846 846
 	}
847 847
 
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 		if ($deep !== true) {
898 898
 			return true;
899 899
 		}
900
-		if ((int)$check === 0) {
900
+		if ((int) $check === 0) {
901 901
 			return false;
902 902
 		}
903 903
 		$sum = 0;
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 			$check = $check['error'];
971 971
 		}
972 972
 
973
-		return (int)$check === UPLOAD_ERR_OK;
973
+		return (int) $check === UPLOAD_ERR_OK;
974 974
 	}
975 975
 
976 976
 /**
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
  * @return void
980 980
  */
981 981
 	protected static function _populateIp() {
982
-		if (!isset(self::$_pattern['IPv6'])) {
982
+		if ( ! isset(self::$_pattern['IPv6'])) {
983 983
 			$pattern = '((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}';
984 984
 			$pattern .= '(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})';
985 985
 			$pattern .= '|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})';
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
 
998 998
 			self::$_pattern['IPv6'] = $pattern;
999 999
 		}
1000
-		if (!isset(self::$_pattern['IPv4'])) {
1000
+		if ( ! isset(self::$_pattern['IPv4'])) {
1001 1001
 			$pattern = '(?:(?:25[0-5]|2[0-4][0-9]|(?:(?:1[0-9])?|[1-9]?)[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|(?:(?:1[0-9])?|[1-9]?)[0-9])';
1002 1002
 			self::$_pattern['IPv4'] = $pattern;
1003 1003
 		}
Please login to merge, or discard this patch.
lib/Cake/View/Helper/FormHelper.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
  * @param boolean $lock Whether this field should be part of the validation
623 623
  *     or excluded as part of the unlockedFields.
624 624
  * @param string $field Reference to field to be secured. Should be dot separated to indicate nesting.
625
- * @param mixed $value Field value, if value should not be tampered with.
625
+ * @param string $value Field value, if value should not be tampered with.
626 626
  * @return mixed|null Not used yet
627 627
  */
628 628
 	protected function _secure($lock, $field = null, $value = null) {
@@ -1235,7 +1235,7 @@  discard block
 block discarded – undo
1235 1235
  *
1236 1236
  * @param string $fieldName
1237 1237
  * @param array $options
1238
- * @return boolean|string false or Generated label element
1238
+ * @return false|string false or Generated label element
1239 1239
  */
1240 1240
 	protected function _getLabel($fieldName, $options) {
1241 1241
 		if ($options['type'] === 'radio') {
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
  * - Other options is the same of button method.
1727 1727
  *
1728 1728
  * @param string $title The button's caption. Not automatically HTML encoded
1729
- * @param string|array $url URL as string or array
1729
+ * @param string $url URL as string or array
1730 1730
  * @param array $options Array of options and HTML attributes.
1731 1731
  * @return string A HTML button tag.
1732 1732
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::postButton
Please login to merge, or discard this patch.
Spacing   +139 added lines, -139 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
  */
134 134
 	public function __construct(View $View, $settings = array()) {
135 135
 		parent::__construct($View, $settings);
136
-		$this->validationErrors =& $View->validationErrors;
136
+		$this->validationErrors = & $View->validationErrors;
137 137
 	}
138 138
 
139 139
 /**
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
  */
146 146
 	protected function _getModel($model) {
147 147
 		$object = null;
148
-		if (!$model || $model === 'Model') {
148
+		if ( ! $model || $model === 'Model') {
149 149
 			return $object;
150 150
 		}
151 151
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 			$plugin = $this->request->params['models'][$model]['plugin'];
160 160
 			$plugin .= ($plugin) ? '.' : null;
161 161
 			$object = ClassRegistry::init(array(
162
-				'class' => $plugin . $this->request->params['models'][$model]['className'],
162
+				'class' => $plugin.$this->request->params['models'][$model]['className'],
163 163
 				'alias' => $model
164 164
 			));
165 165
 		} elseif (ClassRegistry::isKeySet($this->defaultModel)) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		}
173 173
 
174 174
 		$this->_models[$model] = $object;
175
-		if (!$object) {
175
+		if ( ! $object) {
176 176
 			return null;
177 177
 		}
178 178
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
  */
203 203
 	protected function _introspectModel($model, $key, $field = null) {
204 204
 		$object = $this->_getModel($model);
205
-		if (!$object) {
205
+		if ( ! $object) {
206 206
 			return;
207 207
 		}
208 208
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 		}
212 212
 
213 213
 		if ($key === 'fields') {
214
-			if (!isset($this->fieldset[$model]['fields'])) {
214
+			if ( ! isset($this->fieldset[$model]['fields'])) {
215 215
 				$this->fieldset[$model]['fields'] = $object->schema();
216 216
 				foreach ($object->hasAndBelongsToMany as $alias => $assocData) {
217 217
 					$this->fieldset[$object->alias]['fields'][$alias] = array('type' => 'multiple');
@@ -225,14 +225,14 @@  discard block
 block discarded – undo
225 225
 			return isset($object->hasAndBelongsToMany[$field]) ? array('type' => 'multiple') : null;
226 226
 		}
227 227
 
228
-		if ($key === 'errors' && !isset($this->validationErrors[$model])) {
229
-			$this->validationErrors[$model] =& $object->validationErrors;
228
+		if ($key === 'errors' && ! isset($this->validationErrors[$model])) {
229
+			$this->validationErrors[$model] = & $object->validationErrors;
230 230
 			return $this->validationErrors[$model];
231 231
 		} elseif ($key === 'errors' && isset($this->validationErrors[$model])) {
232 232
 			return $this->validationErrors[$model];
233 233
 		}
234 234
 
235
-		if ($key === 'validates' && !isset($this->fieldset[$model]['validates'])) {
235
+		if ($key === 'validates' && ! isset($this->fieldset[$model]['validates'])) {
236 236
 			$validates = array();
237 237
 			foreach (iterator_to_array($object->validator(), true) as $validateField => $validateProperties) {
238 238
 				if ($this->_isRequiredField($validateProperties)) {
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 				continue;
270 270
 			}
271 271
 
272
-			return !$rule->allowEmpty;
272
+			return ! $rule->allowEmpty;
273 273
 		}
274 274
 		return false;
275 275
 	}
@@ -293,10 +293,10 @@  discard block
 block discarded – undo
293 293
 		}
294 294
 
295 295
 		$errors = array();
296
-		if (!empty($entity) && isset($this->validationErrors[$model])) {
296
+		if ( ! empty($entity) && isset($this->validationErrors[$model])) {
297 297
 			$errors = $this->validationErrors[$model];
298 298
 		}
299
-		if (!empty($entity) && empty($errors)) {
299
+		if ( ! empty($entity) && empty($errors)) {
300 300
 			$errors = $this->_introspectModel($model, 'errors');
301 301
 		}
302 302
 		if (empty($errors)) {
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 			$model = null;
342 342
 		}
343 343
 
344
-		if (empty($model) && $model !== false && !empty($this->request->params['models'])) {
344
+		if (empty($model) && $model !== false && ! empty($this->request->params['models'])) {
345 345
 			$model = key($this->request->params['models']);
346 346
 		} elseif (empty($model) && empty($this->request->params['models'])) {
347 347
 			$model = false;
@@ -351,15 +351,15 @@  discard block
 block discarded – undo
351 351
 		$key = null;
352 352
 		if ($model !== false) {
353 353
 			list($plugin, $model) = pluginSplit($model, true);
354
-			$key = $this->_introspectModel($plugin . $model, 'key');
354
+			$key = $this->_introspectModel($plugin.$model, 'key');
355 355
 			$this->setEntity($model, true);
356 356
 		}
357 357
 
358 358
 		if ($model !== false && $key) {
359 359
 			$recordExists = (
360 360
 				isset($this->request->data[$model]) &&
361
-				!empty($this->request->data[$model][$key]) &&
362
-				!is_array($this->request->data[$model][$key])
361
+				! empty($this->request->data[$model][$key]) &&
362
+				! is_array($this->request->data[$model][$key])
363 363
 			);
364 364
 
365 365
 			if ($recordExists) {
@@ -379,18 +379,18 @@  discard block
 block discarded – undo
379 379
 		$this->inputDefaults($options['inputDefaults']);
380 380
 		unset($options['inputDefaults']);
381 381
 
382
-		if (!isset($options['id'])) {
382
+		if ( ! isset($options['id'])) {
383 383
 			$domId = isset($options['action']) ? $options['action'] : $this->request['action'];
384
-			$options['id'] = $this->domId($domId . 'Form');
384
+			$options['id'] = $this->domId($domId.'Form');
385 385
 		}
386 386
 
387 387
 		if ($options['action'] === null && $options['url'] === null) {
388 388
 			$options['action'] = $this->request->here(false);
389 389
 		} elseif (empty($options['url']) || is_array($options['url'])) {
390 390
 			if (empty($options['url']['controller'])) {
391
-				if (!empty($model)) {
391
+				if ( ! empty($model)) {
392 392
 					$options['url']['controller'] = Inflector::underscore(Inflector::pluralize($model));
393
-				} elseif (!empty($this->request->params['controller'])) {
393
+				} elseif ( ! empty($this->request->params['controller'])) {
394 394
 					$options['url']['controller'] = Inflector::underscore($this->request->params['controller']);
395 395
 				}
396 396
 			}
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
 				'controller' => $this->_View->viewPath,
408 408
 				'action' => $options['action'],
409 409
 			);
410
-			$options['action'] = array_merge($actionDefaults, (array)$options['url']);
411
-			if (empty($options['action'][0]) && !empty($id)) {
410
+			$options['action'] = array_merge($actionDefaults, (array) $options['url']);
411
+			if (empty($options['action'][0]) && ! empty($id)) {
412 412
 				$options['action'][0] = $id;
413 413
 			}
414 414
 		} elseif (is_string($options['url'])) {
@@ -438,15 +438,15 @@  discard block
 block discarded – undo
438 438
 		$action = $this->url($options['action']);
439 439
 		unset($options['type'], $options['action']);
440 440
 
441
-		if (!$options['default']) {
442
-			if (!isset($options['onsubmit'])) {
441
+		if ( ! $options['default']) {
442
+			if ( ! isset($options['onsubmit'])) {
443 443
 				$options['onsubmit'] = '';
444 444
 			}
445
-			$htmlAttributes['onsubmit'] = $options['onsubmit'] . 'event.returnValue = false; return false;';
445
+			$htmlAttributes['onsubmit'] = $options['onsubmit'].'event.returnValue = false; return false;';
446 446
 		}
447 447
 		unset($options['default']);
448 448
 
449
-		if (!empty($options['encoding'])) {
449
+		if ( ! empty($options['encoding'])) {
450 450
 			$htmlAttributes['accept-charset'] = $options['encoding'];
451 451
 			unset($options['encoding']);
452 452
 		}
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 			$append .= $this->_csrfField();
459 459
 		}
460 460
 
461
-		if (!empty($append)) {
461
+		if ( ! empty($append)) {
462 462
 			$append = $this->Html->useTag('hiddenblock', $append);
463 463
 		}
464 464
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 			$this->_introspectModel($model, 'fields');
468 468
 		}
469 469
 		$this->_lastAction = $action;
470
-		return $this->Html->useTag('form', $action, $htmlAttributes) . $append;
470
+		return $this->Html->useTag('form', $action, $htmlAttributes).$append;
471 471
 	}
472 472
 
473 473
 /**
@@ -480,13 +480,13 @@  discard block
 block discarded – undo
480 480
 		if (empty($this->request->params['_Token'])) {
481 481
 			return '';
482 482
 		}
483
-		if (!empty($this->request['_Token']['unlockedFields'])) {
484
-			foreach ((array)$this->request['_Token']['unlockedFields'] as $unlocked) {
483
+		if ( ! empty($this->request['_Token']['unlockedFields'])) {
484
+			foreach ((array) $this->request['_Token']['unlockedFields'] as $unlocked) {
485 485
 				$this->_unlockedFields[] = $unlocked;
486 486
 			}
487 487
 		}
488 488
 		return $this->hidden('_Token.key', array(
489
-			'value' => $this->request->params['_Token']['key'], 'id' => 'Token' . mt_rand(),
489
+			'value' => $this->request->params['_Token']['key'], 'id' => 'Token'.mt_rand(),
490 490
 			'secure' => self::SECURE_SKIP
491 491
 		));
492 492
 	}
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 		if (
532 532
 			$this->requestType !== 'get' &&
533 533
 			isset($this->request['_Token']) &&
534
-			!empty($this->request['_Token'])
534
+			! empty($this->request['_Token'])
535 535
 		) {
536 536
 			$out .= $this->secure($this->fields);
537 537
 			$this->fields = array();
@@ -552,14 +552,14 @@  discard block
 block discarded – undo
552 552
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::secure
553 553
  */
554 554
 	public function secure($fields = array()) {
555
-		if (!isset($this->request['_Token']) || empty($this->request['_Token'])) {
555
+		if ( ! isset($this->request['_Token']) || empty($this->request['_Token'])) {
556 556
 			return;
557 557
 		}
558 558
 		$locked = array();
559 559
 		$unlockedFields = $this->_unlockedFields;
560 560
 
561 561
 		foreach ($fields as $key => $value) {
562
-			if (!is_int($key)) {
562
+			if ( ! is_int($key)) {
563 563
 				$locked[$key] = $value;
564 564
 				unset($fields[$key]);
565 565
 			}
@@ -581,12 +581,12 @@  discard block
 block discarded – undo
581 581
 		$fields = Security::hash(implode('', $hashParts), 'sha1');
582 582
 
583 583
 		$out = $this->hidden('_Token.fields', array(
584
-			'value' => urlencode($fields . ':' . $locked),
585
-			'id' => 'TokenFields' . mt_rand()
584
+			'value' => urlencode($fields.':'.$locked),
585
+			'id' => 'TokenFields'.mt_rand()
586 586
 		));
587 587
 		$out .= $this->hidden('_Token.unlocked', array(
588 588
 			'value' => urlencode($unlocked),
589
-			'id' => 'TokenUnlocked' . mt_rand()
589
+			'id' => 'TokenUnlocked'.mt_rand()
590 590
 		));
591 591
 		return $this->Html->useTag('hiddenblock', $out);
592 592
 	}
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 		if ($name === null) {
606 606
 			return $this->_unlockedFields;
607 607
 		}
608
-		if (!in_array($name, $this->_unlockedFields)) {
608
+		if ( ! in_array($name, $this->_unlockedFields)) {
609 609
 			$this->_unlockedFields[] = $name;
610 610
 		}
611 611
 		$index = array_search($name, $this->fields);
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
  * @return mixed|null Not used yet
627 627
  */
628 628
 	protected function _secure($lock, $field = null, $value = null) {
629
-		if (!$field) {
629
+		if ( ! $field) {
630 630
 			$field = $this->entity();
631 631
 		} elseif (is_string($field)) {
632 632
 			$field = Hash::filter(explode('.', $field));
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 		$field = preg_replace('/(\.\d+)+$/', '', $field);
644 644
 
645 645
 		if ($lock) {
646
-			if (!in_array($field, $this->fields)) {
646
+			if ( ! in_array($field, $this->fields)) {
647 647
 				if ($value !== null) {
648 648
 					return $this->fields[$field] = $value;
649 649
 				}
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
  */
664 664
 	public function isFieldError($field) {
665 665
 		$this->setEntity($field);
666
-		return (bool)$this->tagIsInvalid();
666
+		return (bool) $this->tagIsInvalid();
667 667
 	}
668 668
 
669 669
 /**
@@ -871,21 +871,21 @@  discard block
 block discarded – undo
871 871
 		$modelFields = array();
872 872
 		$model = $this->model();
873 873
 		if ($model) {
874
-			$modelFields = array_keys((array)$this->_introspectModel($model, 'fields'));
874
+			$modelFields = array_keys((array) $this->_introspectModel($model, 'fields'));
875 875
 		}
876 876
 		if (is_array($fields)) {
877
-			if (array_key_exists('legend', $fields) && !in_array('legend', $modelFields)) {
877
+			if (array_key_exists('legend', $fields) && ! in_array('legend', $modelFields)) {
878 878
 				$legend = $fields['legend'];
879 879
 				unset($fields['legend']);
880 880
 			}
881 881
 
882
-			if (isset($fields['fieldset']) && !in_array('fieldset', $modelFields)) {
882
+			if (isset($fields['fieldset']) && ! in_array('fieldset', $modelFields)) {
883 883
 				$fieldset = $fields['fieldset'];
884 884
 				unset($fields['fieldset']);
885 885
 			}
886 886
 		} elseif ($fields !== null) {
887 887
 			$fieldset = $legend = $fields;
888
-			if (!is_bool($fieldset)) {
888
+			if ( ! is_bool($fieldset)) {
889 889
 				$fieldset = true;
890 890
 			}
891 891
 			$fields = array();
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 
918 918
 		$out = null;
919 919
 		foreach ($fields as $name => $options) {
920
-			if (is_numeric($name) && !is_array($options)) {
920
+			if (is_numeric($name) && ! is_array($options)) {
921 921
 				$name = $options;
922 922
 				$options = array();
923 923
 			}
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 
941 941
 		if ($fieldset) {
942 942
 			if ($legend) {
943
-				$out = $this->Html->useTag('legend', $legend) . $out;
943
+				$out = $this->Html->useTag('legend', $legend).$out;
944 944
 			}
945 945
 			$out = $this->Html->useTag('fieldset', $fieldsetClass, $out);
946 946
 		}
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 		unset($options['div']);
989 989
 
990 990
 		if ($options['type'] === 'radio' && isset($options['options'])) {
991
-			$radioOptions = (array)$options['options'];
991
+			$radioOptions = (array) $options['options'];
992 992
 			unset($options['options']);
993 993
 		}
994 994
 
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
 			$output .= $out[$element];
1041 1041
 		}
1042 1042
 
1043
-		if (!empty($divOptions['tag'])) {
1043
+		if ( ! empty($divOptions['tag'])) {
1044 1044
 			$tag = $divOptions['tag'];
1045 1045
 			unset($divOptions['tag']);
1046 1046
 			$output = $this->Html->tag($tag, $output, $divOptions);
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
 			$options
1102 1102
 		);
1103 1103
 
1104
-		if (!isset($options['type'])) {
1104
+		if ( ! isset($options['type'])) {
1105 1105
 			$options = $this->_magicOptions($options);
1106 1106
 		}
1107 1107
 
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
 			Inflector::pluralize(preg_replace('/_id$/', '', $this->field()))
1134 1134
 		);
1135 1135
 		$varOptions = $this->_View->get($varName);
1136
-		if (!is_array($varOptions)) {
1136
+		if ( ! is_array($varOptions)) {
1137 1137
 			return $options;
1138 1138
 		}
1139 1139
 		if ($options['type'] !== 'radio') {
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
 			if (
1186 1186
 				$options['type'] === 'number' &&
1187 1187
 				$type === 'float' &&
1188
-				!isset($options['step'])
1188
+				! isset($options['step'])
1189 1189
 			) {
1190 1190
 				$options['step'] = 'any';
1191 1191
 			}
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 
1198 1198
 		if ($modelKey === $fieldKey) {
1199 1199
 			$options['type'] = 'select';
1200
-			if (!isset($options['multiple'])) {
1200
+			if ( ! isset($options['multiple'])) {
1201 1201
 				$options['multiple'] = 'multiple';
1202 1202
 			}
1203 1203
 		}
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 	protected function _maxLength($options) {
1263 1263
 		$fieldDef = $this->_introspectModel($this->model(), 'fields', $this->field());
1264 1264
 		$autoLength = (
1265
-			!array_key_exists('maxlength', $options) &&
1265
+			! array_key_exists('maxlength', $options) &&
1266 1266
 			isset($fieldDef['length']) &&
1267 1267
 			is_scalar($fieldDef['length']) &&
1268 1268
 			$options['type'] !== 'select'
@@ -1286,7 +1286,7 @@  discard block
 block discarded – undo
1286 1286
 			return array();
1287 1287
 		}
1288 1288
 		$div = $this->_extractOption('div', $options, true);
1289
-		if (!$div) {
1289
+		if ( ! $div) {
1290 1290
 			return array();
1291 1291
 		}
1292 1292
 
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
 		) {
1304 1304
 			$divOptions = $this->addClass($divOptions, 'required');
1305 1305
 		}
1306
-		if (!isset($divOptions['tag'])) {
1306
+		if ( ! isset($divOptions['tag'])) {
1307 1307
 			$divOptions['tag'] = 'div';
1308 1308
 		}
1309 1309
 		return $divOptions;
@@ -1345,7 +1345,7 @@  discard block
 block discarded – undo
1345 1345
 				($options['dateFormat'] === null || $options['dateFormat'] === 'NONE')
1346 1346
 			) {
1347 1347
 				$firstInput = 'H';
1348
-			} elseif (!empty($options['dateFormat'])) {
1348
+			} elseif ( ! empty($options['dateFormat'])) {
1349 1349
 				$firstInput = substr($options['dateFormat'], 0, 1);
1350 1350
 			}
1351 1351
 			switch ($firstInput) {
@@ -1423,14 +1423,14 @@  discard block
 block discarded – undo
1423 1423
 		$output = '';
1424 1424
 
1425 1425
 		if (
1426
-			(!isset($options['checked']) && !empty($value) && $value == $options['value']) ||
1427
-			!empty($options['checked'])
1426
+			( ! isset($options['checked']) && ! empty($value) && $value == $options['value']) ||
1427
+			! empty($options['checked'])
1428 1428
 		) {
1429 1429
 			$options['checked'] = 'checked';
1430 1430
 		}
1431 1431
 		if ($options['hiddenField']) {
1432 1432
 			$hiddenOptions = array(
1433
-				'id' => $options['id'] . '_',
1433
+				'id' => $options['id'].'_',
1434 1434
 				'name' => $options['name'],
1435 1435
 				'value' => ($options['hiddenField'] !== true ? $options['hiddenField'] : '0'),
1436 1436
 				'form' => isset($options['form']) ? $options['form'] : null,
@@ -1443,7 +1443,7 @@  discard block
 block discarded – undo
1443 1443
 		}
1444 1444
 		unset($options['hiddenField']);
1445 1445
 
1446
-		return $output . $this->Html->useTag('checkbox', $options['name'], array_diff_key($options, array('name' => null)));
1446
+		return $output.$this->Html->useTag('checkbox', $options['name'], array_diff_key($options, array('name' => null)));
1447 1447
 	}
1448 1448
 
1449 1449
 /**
@@ -1535,10 +1535,10 @@  discard block
 block discarded – undo
1535 1535
 				$optionsHere['checked'] = 'checked';
1536 1536
 			}
1537 1537
 			$isNumeric = is_numeric($optValue);
1538
-			if ($disabled && (!is_array($disabled) || in_array((string)$optValue, $disabled, !$isNumeric))) {
1538
+			if ($disabled && ( ! is_array($disabled) || in_array((string) $optValue, $disabled, ! $isNumeric))) {
1539 1539
 				$optionsHere['disabled'] = true;
1540 1540
 			}
1541
-			$tagName = $attributes['id'] . $this->domIdSuffix($optValue);
1541
+			$tagName = $attributes['id'].$this->domIdSuffix($optValue);
1542 1542
 
1543 1543
 			if ($label) {
1544 1544
 				$labelOpts = is_array($label) ? $label : array();
@@ -1558,22 +1558,22 @@  discard block
 block discarded – undo
1558 1558
 		$hidden = null;
1559 1559
 
1560 1560
 		if ($hiddenField) {
1561
-			if (!isset($value) || $value === '') {
1561
+			if ( ! isset($value) || $value === '') {
1562 1562
 				$hidden = $this->hidden($fieldName, array(
1563 1563
 					'form' => isset($attributes['form']) ? $attributes['form'] : null,
1564
-					'id' => $attributes['id'] . '_',
1564
+					'id' => $attributes['id'].'_',
1565 1565
 					'value' => '',
1566 1566
 					'name' => $attributes['name']
1567 1567
 				));
1568 1568
 			}
1569 1569
 		}
1570
-		$out = $hidden . implode($separator, $out);
1570
+		$out = $hidden.implode($separator, $out);
1571 1571
 
1572 1572
 		if (is_array($between)) {
1573 1573
 			$between = '';
1574 1574
 		}
1575 1575
 		if ($legend) {
1576
-			$out = $this->Html->useTag('fieldset', '', $this->Html->useTag('legend', $legend) . $between . $out);
1576
+			$out = $this->Html->useTag('fieldset', '', $this->Html->useTag('legend', $legend).$between.$out);
1577 1577
 		}
1578 1578
 		return $out;
1579 1579
 	}
@@ -1607,7 +1607,7 @@  discard block
 block discarded – undo
1607 1607
 		if (isset($params[1])) {
1608 1608
 			$options = $params[1];
1609 1609
 		}
1610
-		if (!isset($options['type'])) {
1610
+		if ( ! isset($options['type'])) {
1611 1611
 			$options['type'] = $method;
1612 1612
 		}
1613 1613
 		$options = $this->_initInputField($params[0], $options);
@@ -1632,7 +1632,7 @@  discard block
 block discarded – undo
1632 1632
 
1633 1633
 		if (array_key_exists('value', $options)) {
1634 1634
 			$value = $options['value'];
1635
-			if (!array_key_exists('escape', $options) || $options['escape'] !== false) {
1635
+			if ( ! array_key_exists('escape', $options) || $options['escape'] !== false) {
1636 1636
 				$value = h($value);
1637 1637
 			}
1638 1638
 			unset($options['value']);
@@ -1659,7 +1659,7 @@  discard block
 block discarded – undo
1659 1659
 		));
1660 1660
 
1661 1661
 		if ($secure === true) {
1662
-			$this->_secure(true, null, '' . $options['value']);
1662
+			$this->_secure(true, null, ''.$options['value']);
1663 1663
 		}
1664 1664
 
1665 1665
 		return $this->Html->useTag('hidden', $options['name'], array_diff_key($options, array('name' => null)));
@@ -1768,11 +1768,11 @@  discard block
 block discarded – undo
1768 1768
  */
1769 1769
 	public function postLink($title, $url = null, $options = array(), $confirmMessage = false) {
1770 1770
 		$requestMethod = 'POST';
1771
-		if (!empty($options['method'])) {
1771
+		if ( ! empty($options['method'])) {
1772 1772
 			$requestMethod = strtoupper($options['method']);
1773 1773
 			unset($options['method']);
1774 1774
 		}
1775
-		if (!empty($options['confirm'])) {
1775
+		if ( ! empty($options['confirm'])) {
1776 1776
 			$confirmMessage = $options['confirm'];
1777 1777
 			unset($options['confirm']);
1778 1778
 		}
@@ -1810,11 +1810,11 @@  discard block
 block discarded – undo
1810 1810
 		$out .= $this->Html->useTag('formend');
1811 1811
 
1812 1812
 		$url = '#';
1813
-		$onClick = 'document.' . $formName . '.submit();';
1813
+		$onClick = 'document.'.$formName.'.submit();';
1814 1814
 		if ($confirmMessage) {
1815 1815
 			$options['onclick'] = $this->_confirm($confirmMessage, $onClick, '', $options);
1816 1816
 		} else {
1817
-			$options['onclick'] = $onClick . ' ';
1817
+			$options['onclick'] = $onClick.' ';
1818 1818
 		}
1819 1819
 		$options['onclick'] .= 'event.returnValue = false; return false;';
1820 1820
 
@@ -1851,7 +1851,7 @@  discard block
 block discarded – undo
1851 1851
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::submit
1852 1852
  */
1853 1853
 	public function submit($caption = null, $options = array()) {
1854
-		if (!is_string($caption) && empty($caption)) {
1854
+		if ( ! is_string($caption) && empty($caption)) {
1855 1855
 			$caption = __d('cake', 'Submit');
1856 1856
 		}
1857 1857
 		$out = null;
@@ -1891,7 +1891,7 @@  discard block
 block discarded – undo
1891 1891
 			$unlockFields = array('x', 'y');
1892 1892
 			if (isset($options['name'])) {
1893 1893
 				$unlockFields = array(
1894
-					$options['name'] . '_x', $options['name'] . '_y'
1894
+					$options['name'].'_x', $options['name'].'_y'
1895 1895
 				);
1896 1896
 			}
1897 1897
 			foreach ($unlockFields as $ignore) {
@@ -1905,7 +1905,7 @@  discard block
 block discarded – undo
1905 1905
 		} elseif ($isImage) {
1906 1906
 			unset($options['type']);
1907 1907
 			if ($caption{0} !== '/') {
1908
-				$url = $this->webroot(Configure::read('App.imageBaseUrl') . $caption);
1908
+				$url = $this->webroot(Configure::read('App.imageBaseUrl').$caption);
1909 1909
 			} else {
1910 1910
 				$url = $this->webroot(trim($caption, '/'));
1911 1911
 			}
@@ -1915,7 +1915,7 @@  discard block
 block discarded – undo
1915 1915
 			$options['value'] = $caption;
1916 1916
 			$tag = $this->Html->useTag('submit', $options);
1917 1917
 		}
1918
-		$out = $before . $tag . $after;
1918
+		$out = $before.$tag.$after;
1919 1919
 
1920 1920
 		if (isset($divOptions)) {
1921 1921
 			$tag = $divOptions['tag'];
@@ -2008,26 +2008,26 @@  discard block
 block discarded – undo
2008 2008
 		$id = $this->_extractOption('id', $attributes);
2009 2009
 
2010 2010
 		$attributes = $this->_initInputField($fieldName, array_merge(
2011
-			(array)$attributes, array('secure' => self::SECURE_SKIP)
2011
+			(array) $attributes, array('secure' => self::SECURE_SKIP)
2012 2012
 		));
2013 2013
 
2014 2014
 		if (is_string($options) && isset($this->_options[$options])) {
2015 2015
 			$options = $this->_generateOptions($options);
2016
-		} elseif (!is_array($options)) {
2016
+		} elseif ( ! is_array($options)) {
2017 2017
 			$options = array();
2018 2018
 		}
2019 2019
 		if (isset($attributes['type'])) {
2020 2020
 			unset($attributes['type']);
2021 2021
 		}
2022 2022
 
2023
-		if (!empty($attributes['multiple'])) {
2023
+		if ( ! empty($attributes['multiple'])) {
2024 2024
 			$style = ($attributes['multiple'] === 'checkbox') ? 'checkbox' : null;
2025 2025
 			$template = ($style) ? 'checkboxmultiplestart' : 'selectmultiplestart';
2026 2026
 			$tag = $template;
2027 2027
 			if ($hiddenField) {
2028 2028
 				$hiddenAttributes = array(
2029 2029
 					'value' => '',
2030
-					'id' => $attributes['id'] . ($style ? '' : '_'),
2030
+					'id' => $attributes['id'].($style ? '' : '_'),
2031 2031
 					'secure' => false,
2032 2032
 					'form' => isset($attributes['form']) ? $attributes['form'] : null,
2033 2033
 					'name' => $attributes['name']
@@ -2042,21 +2042,21 @@  discard block
 block discarded – undo
2042 2042
 			unset($attributes['required']);
2043 2043
 		}
2044 2044
 
2045
-		if (!empty($tag) || isset($template)) {
2045
+		if ( ! empty($tag) || isset($template)) {
2046 2046
 			$hasOptions = (count($options) > 0 || $showEmpty);
2047 2047
 			// Secure the field if there are options, or its a multi select.
2048 2048
 			// Single selects with no options don't submit, but multiselects do.
2049 2049
 			if (
2050
-				(!isset($secure) || $secure) &&
2050
+				( ! isset($secure) || $secure) &&
2051 2051
 				empty($attributes['disabled']) &&
2052
-				(!empty($attributes['multiple']) || $hasOptions)
2052
+				( ! empty($attributes['multiple']) || $hasOptions)
2053 2053
 			) {
2054 2054
 				$this->_secure(true, $this->_secureFieldName($attributes));
2055 2055
 			}
2056 2056
 			$select[] = $this->Html->useTag($tag, $attributes['name'], array_diff_key($attributes, array('name' => null, 'value' => null)));
2057 2057
 		}
2058 2058
 		$emptyMulti = (
2059
-			$showEmpty !== null && $showEmpty !== false && !(
2059
+			$showEmpty !== null && $showEmpty !== false && ! (
2060 2060
 				empty($showEmpty) && (isset($attributes) &&
2061 2061
 				array_key_exists('multiple', $attributes))
2062 2062
 			)
@@ -2067,7 +2067,7 @@  discard block
 block discarded – undo
2067 2067
 			$options = array('' => $showEmpty) + $options;
2068 2068
 		}
2069 2069
 
2070
-		if (!$id) {
2070
+		if ( ! $id) {
2071 2071
 			$attributes['id'] = Inflector::camelize($attributes['id']);
2072 2072
 		}
2073 2073
 
@@ -2113,7 +2113,7 @@  discard block
 block discarded – undo
2113 2113
 		$count = 1;
2114 2114
 		$suffix = $value;
2115 2115
 		while (in_array($suffix, $this->_domIdSuffixes)) {
2116
-			$suffix = $value . $count++;
2116
+			$suffix = $value.$count++;
2117 2117
 		}
2118 2118
 		$this->_domIdSuffixes[] = $suffix;
2119 2119
 		return $suffix;
@@ -2146,7 +2146,7 @@  discard block
 block discarded – undo
2146 2146
 		} elseif ($attributes['value'] === false) {
2147 2147
 			$attributes['value'] = null;
2148 2148
 		}
2149
-		return $this->select($fieldName . ".day", $this->_generateOptions('day'), $attributes);
2149
+		return $this->select($fieldName.".day", $this->_generateOptions('day'), $attributes);
2150 2150
 	}
2151 2151
 
2152 2152
 /**
@@ -2176,10 +2176,10 @@  discard block
 block discarded – undo
2176 2176
 				$attributes['value'] = $year;
2177 2177
 			} else {
2178 2178
 				if (empty($value)) {
2179
-					if (!$attributes['empty'] && !$maxYear) {
2179
+					if ( ! $attributes['empty'] && ! $maxYear) {
2180 2180
 						$attributes['value'] = 'now';
2181 2181
 
2182
-					} elseif (!$attributes['empty'] && $maxYear && !$attributes['value']) {
2182
+					} elseif ( ! $attributes['empty'] && $maxYear && ! $attributes['value']) {
2183 2183
 						$attributes['value'] = $maxYear;
2184 2184
 					}
2185 2185
 				} else {
@@ -2203,7 +2203,7 @@  discard block
 block discarded – undo
2203 2203
 			unset($attributes['orderYear']);
2204 2204
 		}
2205 2205
 		return $this->select(
2206
-			$fieldName . '.year', $this->_generateOptions('year', $yearOptions),
2206
+			$fieldName.'.year', $this->_generateOptions('year', $yearOptions),
2207 2207
 			$attributes
2208 2208
 		);
2209 2209
 	}
@@ -2238,12 +2238,12 @@  discard block
 block discarded – undo
2238 2238
 			$attributes['value'] = null;
2239 2239
 		}
2240 2240
 		$defaults = array('monthNames' => true);
2241
-		$attributes = array_merge($defaults, (array)$attributes);
2241
+		$attributes = array_merge($defaults, (array) $attributes);
2242 2242
 		$monthNames = $attributes['monthNames'];
2243 2243
 		unset($attributes['monthNames']);
2244 2244
 
2245 2245
 		return $this->select(
2246
-			$fieldName . ".month",
2246
+			$fieldName.".month",
2247 2247
 			$this->_generateOptions('month', array('monthNames' => $monthNames)),
2248 2248
 			$attributes
2249 2249
 		);
@@ -2283,15 +2283,15 @@  discard block
 block discarded – undo
2283 2283
 			$attributes['value'] = null;
2284 2284
 		}
2285 2285
 
2286
-		if ($attributes['value'] > 12 && !$format24Hours) {
2286
+		if ($attributes['value'] > 12 && ! $format24Hours) {
2287 2287
 			$attributes['value'] -= 12;
2288 2288
 		}
2289
-		if (($attributes['value'] === 0 || $attributes['value'] === '00') && !$format24Hours) {
2289
+		if (($attributes['value'] === 0 || $attributes['value'] === '00') && ! $format24Hours) {
2290 2290
 			$attributes['value'] = 12;
2291 2291
 		}
2292 2292
 
2293 2293
 		return $this->select(
2294
-			$fieldName . ".hour",
2294
+			$fieldName.".hour",
2295 2295
 			$this->_generateOptions($format24Hours ? 'hour24' : 'hour'),
2296 2296
 			$attributes
2297 2297
 		);
@@ -2331,7 +2331,7 @@  discard block
 block discarded – undo
2331 2331
 			unset($attributes['interval']);
2332 2332
 		}
2333 2333
 		return $this->select(
2334
-			$fieldName . ".min", $this->_generateOptions('minute', $minuteOptions),
2334
+			$fieldName.".min", $this->_generateOptions('minute', $minuteOptions),
2335 2335
 			$attributes
2336 2336
 		);
2337 2337
 	}
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
 				$attributes['value'] = isset($value[$select]) ? $value[$select] : null;
2351 2351
 			} else {
2352 2352
 				if (empty($value)) {
2353
-					if (!$attributes['empty']) {
2353
+					if ( ! $attributes['empty']) {
2354 2354
 						$attributes['value'] = 'now';
2355 2355
 					}
2356 2356
 				} else {
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
 				$attributes['value'] = $meridian;
2385 2385
 			} else {
2386 2386
 				if (empty($value)) {
2387
-					if (!$attributes['empty']) {
2387
+					if ( ! $attributes['empty']) {
2388 2388
 						$attributes['value'] = date('a');
2389 2389
 					}
2390 2390
 				} else {
@@ -2401,7 +2401,7 @@  discard block
 block discarded – undo
2401 2401
 			$attributes['value'] = null;
2402 2402
 		}
2403 2403
 		return $this->select(
2404
-			$fieldName . ".meridian", $this->_generateOptions('meridian'),
2404
+			$fieldName.".meridian", $this->_generateOptions('meridian'),
2405 2405
 			$attributes
2406 2406
 		);
2407 2407
 	}
@@ -2440,12 +2440,12 @@  discard block
 block discarded – undo
2440 2440
 
2441 2441
 		if ($attributes['value'] === null && $attributes['empty'] != true) {
2442 2442
 			$attributes['value'] = time();
2443
-			if (!empty($attributes['maxYear']) && $attributes['maxYear'] < date('Y')) {
2444
-				$attributes['value'] = strtotime(date($attributes['maxYear'] . '-m-d'));
2443
+			if ( ! empty($attributes['maxYear']) && $attributes['maxYear'] < date('Y')) {
2444
+				$attributes['value'] = strtotime(date($attributes['maxYear'].'-m-d'));
2445 2445
 			}
2446 2446
 		}
2447 2447
 
2448
-		if (!empty($attributes['value'])) {
2448
+		if ( ! empty($attributes['value'])) {
2449 2449
 			list($year, $month, $day, $hour, $min, $meridian) = $this->_getDateTimeValue(
2450 2450
 				$attributes['value'],
2451 2451
 				$timeFormat
@@ -2456,7 +2456,7 @@  discard block
 block discarded – undo
2456 2456
 			'minYear' => null, 'maxYear' => null, 'separator' => '-',
2457 2457
 			'interval' => 1, 'monthNames' => true, 'round' => null
2458 2458
 		);
2459
-		$attributes = array_merge($defaults, (array)$attributes);
2459
+		$attributes = array_merge($defaults, (array) $attributes);
2460 2460
 		if (isset($attributes['minuteInterval'])) {
2461 2461
 			$attributes['interval'] = $attributes['minuteInterval'];
2462 2462
 			unset($attributes['minuteInterval']);
@@ -2469,7 +2469,7 @@  discard block
 block discarded – undo
2469 2469
 		$round = $attributes['round'];
2470 2470
 		$attributes = array_diff_key($attributes, $defaults);
2471 2471
 
2472
-		if (!empty($interval) && $interval > 1 && !empty($min)) {
2472
+		if ( ! empty($interval) && $interval > 1 && ! empty($min)) {
2473 2473
 			$current = new DateTime();
2474 2474
 			if ($year !== null) {
2475 2475
 				$current->setDate($year, $month, $day);
@@ -2516,7 +2516,7 @@  discard block
 block discarded – undo
2516 2516
 		if ($hasId && is_string($attributes['id'])) {
2517 2517
 			// build out an array version
2518 2518
 			foreach ($keys as $key) {
2519
-				$attrs[$key]['id'] = $attributes['id'] . $key;
2519
+				$attrs[$key]['id'] = $attributes['id'].$key;
2520 2520
 			}
2521 2521
 		}
2522 2522
 
@@ -2561,15 +2561,15 @@  discard block
 block discarded – undo
2561 2561
 			case '24':
2562 2562
 				$attrs['Hour']['value'] = $hour;
2563 2563
 				$attrs['Minute']['value'] = $min;
2564
-				$opt .= $this->hour($fieldName, true, $attrs['Hour']) . ':' .
2564
+				$opt .= $this->hour($fieldName, true, $attrs['Hour']).':'.
2565 2565
 				$this->minute($fieldName, $attrs['Minute']);
2566 2566
 				break;
2567 2567
 			case '12':
2568 2568
 				$attrs['Hour']['value'] = $hour;
2569 2569
 				$attrs['Minute']['value'] = $min;
2570 2570
 				$attrs['Meridian']['value'] = $meridian;
2571
-				$opt .= $this->hour($fieldName, false, $attrs['Hour']) . ':' .
2572
-				$this->minute($fieldName, $attrs['Minute']) . ' ' .
2571
+				$opt .= $this->hour($fieldName, false, $attrs['Hour']).':'.
2572
+				$this->minute($fieldName, $attrs['Minute']).' '.
2573 2573
 				$this->meridian($fieldName, $attrs['Meridian']);
2574 2574
 				break;
2575 2575
 		}
@@ -2608,7 +2608,7 @@  discard block
 block discarded – undo
2608 2608
 			$days[1] = $value;
2609 2609
 		}
2610 2610
 
2611
-		if (!empty($timeFormat)) {
2611
+		if ( ! empty($timeFormat)) {
2612 2612
 			$time = explode(':', $days[1]);
2613 2613
 
2614 2614
 			if ($time[0] >= 12) {
@@ -2640,7 +2640,7 @@  discard block
 block discarded – undo
2640 2640
 				$options = 0;
2641 2641
 			}
2642 2642
 
2643
-			if (!empty($field)) {
2643
+			if ( ! empty($field)) {
2644 2644
 				$this->setEntity($field);
2645 2645
 			}
2646 2646
 
@@ -2653,7 +2653,7 @@  discard block
 block discarded – undo
2653 2653
 			$name = $model === $entity[0] && isset($entity[1]) ? $entity[1] : $entity[0];
2654 2654
 			$last = $entity[count($entity) - 1];
2655 2655
 			if (in_array($last, $this->_fieldSuffixes)) {
2656
-				$name .= '[' . $last . ']';
2656
+				$name .= '['.$last.']';
2657 2657
 			}
2658 2658
 
2659 2659
 			if (is_array($options)) {
@@ -2686,8 +2686,8 @@  discard block
 block discarded – undo
2686 2686
 		$this->_domIdSuffixes = array();
2687 2687
 		foreach ($elements as $name => $title) {
2688 2688
 			$htmlOptions = array();
2689
-			if (is_array($title) && (!isset($title['name']) || !isset($title['value']))) {
2690
-				if (!empty($name)) {
2689
+			if (is_array($title) && ( ! isset($title['name']) || ! isset($title['value']))) {
2690
+				if ( ! empty($name)) {
2691 2691
 					if ($attributes['style'] === 'checkbox') {
2692 2692
 						$select[] = $this->Html->useTag('fieldsetend');
2693 2693
 					} else {
@@ -2699,7 +2699,7 @@  discard block
 block discarded – undo
2699 2699
 					$title, $parents, $showParents, $attributes
2700 2700
 				));
2701 2701
 
2702
-				if (!empty($name)) {
2702
+				if ( ! empty($name)) {
2703 2703
 					$name = $attributes['escape'] ? h($name) : $name;
2704 2704
 					if ($attributes['style'] === 'checkbox') {
2705 2705
 						$select[] = $this->Html->useTag('fieldsetstart', $name);
@@ -2718,8 +2718,8 @@  discard block
 block discarded – undo
2718 2718
 			if ($name !== null) {
2719 2719
 				$isNumeric = is_numeric($name);
2720 2720
 				if (
2721
-					(!$selectedIsArray && !$selectedIsEmpty && (string)$attributes['value'] == (string)$name) ||
2722
-					($selectedIsArray && in_array((string)$name, $attributes['value'], !$isNumeric))
2721
+					( ! $selectedIsArray && ! $selectedIsEmpty && (string) $attributes['value'] == (string) $name) ||
2722
+					($selectedIsArray && in_array((string) $name, $attributes['value'], ! $isNumeric))
2723 2723
 				) {
2724 2724
 					if ($attributes['style'] === 'checkbox') {
2725 2725
 						$htmlOptions['checked'] = true;
@@ -2728,10 +2728,10 @@  discard block
 block discarded – undo
2728 2728
 					}
2729 2729
 				}
2730 2730
 
2731
-				if ($showParents || (!in_array($title, $parents))) {
2731
+				if ($showParents || ( ! in_array($title, $parents))) {
2732 2732
 					$title = ($attributes['escape']) ? h($title) : $title;
2733 2733
 
2734
-					$hasDisabled = !empty($attributes['disabled']);
2734
+					$hasDisabled = ! empty($attributes['disabled']);
2735 2735
 					if ($hasDisabled) {
2736 2736
 						$disabledIsArray = is_array($attributes['disabled']);
2737 2737
 						if ($disabledIsArray) {
@@ -2741,18 +2741,18 @@  discard block
 block discarded – undo
2741 2741
 					if (
2742 2742
 						$hasDisabled &&
2743 2743
 						$disabledIsArray &&
2744
-						in_array((string)$name, $attributes['disabled'], !$disabledIsNumeric)
2744
+						in_array((string) $name, $attributes['disabled'], ! $disabledIsNumeric)
2745 2745
 					) {
2746 2746
 						$htmlOptions['disabled'] = 'disabled';
2747 2747
 					}
2748
-					if ($hasDisabled && !$disabledIsArray && $attributes['style'] === 'checkbox') {
2748
+					if ($hasDisabled && ! $disabledIsArray && $attributes['style'] === 'checkbox') {
2749 2749
 						$htmlOptions['disabled'] = $attributes['disabled'] === true ? 'disabled' : $attributes['disabled'];
2750 2750
 					}
2751 2751
 
2752 2752
 					if ($attributes['style'] === 'checkbox') {
2753 2753
 						$htmlOptions['value'] = $name;
2754 2754
 
2755
-						$tagName = $attributes['id'] . $this->domIdSuffix($name);
2755
+						$tagName = $attributes['id'].$this->domIdSuffix($name);
2756 2756
 						$htmlOptions['id'] = $tagName;
2757 2757
 						$label = array('for' => $tagName);
2758 2758
 
@@ -2765,11 +2765,11 @@  discard block
 block discarded – undo
2765 2765
 						if (empty($attributes['class'])) {
2766 2766
 							$attributes['class'] = 'checkbox';
2767 2767
 						} elseif ($attributes['class'] === 'form-error') {
2768
-							$attributes['class'] = 'checkbox ' . $attributes['class'];
2768
+							$attributes['class'] = 'checkbox '.$attributes['class'];
2769 2769
 						}
2770 2770
 						$label = $this->label(null, $title, $label);
2771 2771
 						$item = $this->Html->useTag('checkboxmultiple', $name, $htmlOptions);
2772
-						$select[] = $this->Html->div($attributes['class'], $item . $label);
2772
+						$select[] = $this->Html->div($attributes['class'], $item.$label);
2773 2773
 					} else {
2774 2774
 						if ($attributes['escape']) {
2775 2775
 							$name = h($name);
@@ -2791,7 +2791,7 @@  discard block
 block discarded – undo
2791 2791
  * @return array
2792 2792
  */
2793 2793
 	protected function _generateOptions($name, $options = array()) {
2794
-		if (!empty($this->options[$name])) {
2794
+		if ( ! empty($this->options[$name])) {
2795 2795
 			return $this->options[$name];
2796 2796
 		}
2797 2797
 		$data = array();
@@ -2862,20 +2862,20 @@  discard block
 block discarded – undo
2862 2862
 			case 'year':
2863 2863
 				$current = intval(date('Y'));
2864 2864
 
2865
-				$min = !isset($options['min']) ? $current - 20 : (int)$options['min'];
2866
-				$max = !isset($options['max']) ? $current + 20 : (int)$options['max'];
2865
+				$min = ! isset($options['min']) ? $current - 20 : (int) $options['min'];
2866
+				$max = ! isset($options['max']) ? $current + 20 : (int) $options['max'];
2867 2867
 
2868 2868
 				if ($min > $max) {
2869 2869
 					list($min, $max) = array($max, $min);
2870 2870
 				}
2871 2871
 				if (
2872
-					!empty($options['value']) &&
2873
-					(int)$options['value'] < $min &&
2874
-					(int)$options['value'] > 0
2872
+					! empty($options['value']) &&
2873
+					(int) $options['value'] < $min &&
2874
+					(int) $options['value'] > 0
2875 2875
 				) {
2876
-					$min = (int)$options['value'];
2877
-				} elseif (!empty($options['value']) && (int)$options['value'] > $max) {
2878
-					$max = (int)$options['value'];
2876
+					$min = (int) $options['value'];
2877
+				} elseif ( ! empty($options['value']) && (int) $options['value'] > $max) {
2878
+					$max = (int) $options['value'];
2879 2879
 				}
2880 2880
 
2881 2881
 				for ($i = $min; $i <= $max; $i++) {
@@ -2912,7 +2912,7 @@  discard block
 block discarded – undo
2912 2912
 			$secure = $options['secure'];
2913 2913
 			unset($options['secure']);
2914 2914
 		} else {
2915
-			$secure = (isset($this->request['_Token']) && !empty($this->request['_Token']));
2915
+			$secure = (isset($this->request['_Token']) && ! empty($this->request['_Token']));
2916 2916
 		}
2917 2917
 
2918 2918
 		$disabledIndex = array_search('disabled', $options, true);
@@ -2926,11 +2926,11 @@  discard block
 block discarded – undo
2926 2926
 			$result = $this->addClass($result, 'form-error');
2927 2927
 		}
2928 2928
 
2929
-		if (!empty($result['disabled'])) {
2929
+		if ( ! empty($result['disabled'])) {
2930 2930
 			return $result;
2931 2931
 		}
2932 2932
 
2933
-		if (!isset($result['required']) &&
2933
+		if ( ! isset($result['required']) &&
2934 2934
 			$this->_introspectModel($this->model(), 'validates', $this->field())
2935 2935
 		) {
2936 2936
 			$result['required'] = true;
@@ -2973,9 +2973,9 @@  discard block
 block discarded – undo
2973 2973
 	public function inputDefaults($defaults = null, $merge = false) {
2974 2974
 		if ($defaults !== null) {
2975 2975
 			if ($merge) {
2976
-				$this->_inputDefaults = array_merge($this->_inputDefaults, (array)$defaults);
2976
+				$this->_inputDefaults = array_merge($this->_inputDefaults, (array) $defaults);
2977 2977
 			} else {
2978
-				$this->_inputDefaults = (array)$defaults;
2978
+				$this->_inputDefaults = (array) $defaults;
2979 2979
 			}
2980 2980
 		}
2981 2981
 		return $this->_inputDefaults;
Please login to merge, or discard this patch.
lib/Cake/View/Helper/HtmlHelper.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
  * - `plugin` False value will prevent parsing path as a plugin
511 511
  * - `fullBase` If true the url will get a full address for the script file.
512 512
  *
513
- * @param string|array $url String or array of javascript files to include
513
+ * @param string $url String or array of javascript files to include
514 514
  * @param array|boolean $options Array of options, and html attributes see above. If boolean sets $options['inline'] = value
515
- * @return mixed String of `<script />` tags or null if $inline is false or if $once is true and the file has been
515
+ * @return string|null String of `<script />` tags or null if $inline is false or if $once is true and the file has been
516 516
  *   included before.
517 517
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::script
518 518
  */
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
  * @param string $script The script to wrap
574 574
  * @param array $options The options to use. Options not listed above will be
575 575
  *    treated as HTML attributes.
576
- * @return mixed string or null depending on the value of `$options['block']`
576
+ * @return string|null string or null depending on the value of `$options['block']`
577 577
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::scriptBlock
578 578
  */
579 579
 	public function scriptBlock($script, $options = array()) {
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
  * Generates a script tag inline or in `$scripts_for_layout` depending on the settings
622 622
  * used when the scriptBlock was started
623 623
  *
624
- * @return mixed depending on the settings of scriptStart() either a script tag or null
624
+ * @return string|null depending on the settings of scriptStart() either a script tag or null
625 625
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::scriptEnd
626 626
  */
627 627
 	public function scriptEnd() {
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		} else {
164 164
 			$this->response = new CakeResponse();
165 165
 		}
166
-		if (!empty($settings['configFile'])) {
166
+		if ( ! empty($settings['configFile'])) {
167 167
 			$this->loadConfig($settings['configFile']);
168 168
 		}
169 169
 	}
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
  */
239 239
 	public function meta($type, $url = null, $options = array()) {
240 240
 		$options += array('inline' => true, 'block' => null);
241
-		if (!$options['inline'] && empty($options['block'])) {
241
+		if ( ! $options['inline'] && empty($options['block'])) {
242 242
 			$options['block'] = __FUNCTION__;
243 243
 		}
244 244
 		unset($options['inline']);
245 245
 
246
-		if (!is_array($type)) {
246
+		if ( ! is_array($type)) {
247 247
 			$types = array(
248 248
 				'rss' => array('type' => 'application/rss+xml', 'rel' => 'alternate', 'title' => $type, 'link' => $url),
249 249
 				'atom' => array('type' => 'application/atom+xml', 'title' => $type, 'link' => $url),
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 			if (isset($types[$type])) {
260 260
 				$type = $types[$type];
261
-			} elseif (!isset($options['type']) && $url !== null) {
261
+			} elseif ( ! isset($options['type']) && $url !== null) {
262 262
 				if (is_array($url) && isset($url['ext'])) {
263 263
 					$type = $types[$url['ext']];
264 264
 				} else {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 		if (empty($charset)) {
305 305
 			$charset = strtolower(Configure::read('App.encoding'));
306 306
 		}
307
-		return sprintf($this->_tags['charset'], (!empty($charset) ? $charset : 'utf-8'));
307
+		return sprintf($this->_tags['charset'], ( ! empty($charset) ? $charset : 'utf-8'));
308 308
 	}
309 309
 
310 310
 /**
@@ -353,13 +353,13 @@  discard block
 block discarded – undo
353 353
 			$title = htmlentities($title, ENT_QUOTES, $escapeTitle);
354 354
 		}
355 355
 
356
-		if (!empty($options['confirm'])) {
356
+		if ( ! empty($options['confirm'])) {
357 357
 			$confirmMessage = $options['confirm'];
358 358
 			unset($options['confirm']);
359 359
 		}
360 360
 		if ($confirmMessage) {
361 361
 			$options['onclick'] = $this->_confirm($confirmMessage, 'return true;', 'return false;', $options);
362
-		} elseif (isset($options['default']) && !$options['default']) {
362
+		} elseif (isset($options['default']) && ! $options['default']) {
363 363
 			if (isset($options['onclick'])) {
364 364
 				$options['onclick'] .= ' ';
365 365
 			} else {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::css
411 411
  */
412 412
 	public function css($path, $options = array()) {
413
-		if (!is_array($options)) {
413
+		if ( ! is_array($options)) {
414 414
 			$rel = $options;
415 415
 			$options = array();
416 416
 			if ($rel) {
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 		}
424 424
 
425 425
 		$options += array('block' => null, 'inline' => true, 'rel' => 'stylesheet');
426
-		if (!$options['inline'] && empty($options['block'])) {
426
+		if ( ! $options['inline'] && empty($options['block'])) {
427 427
 			$options['block'] = __FUNCTION__;
428 428
 		}
429 429
 		unset($options['inline']);
@@ -431,10 +431,10 @@  discard block
 block discarded – undo
431 431
 		if (is_array($path)) {
432 432
 			$out = '';
433 433
 			foreach ($path as $i) {
434
-				$out .= "\n\t" . $this->css($i, $options);
434
+				$out .= "\n\t".$this->css($i, $options);
435 435
 			}
436 436
 			if (empty($options['block'])) {
437
-				return $out . "\n";
437
+				return $out."\n";
438 438
 			}
439 439
 			return;
440 440
 		}
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 			if (Configure::read('Asset.filter.css')) {
449 449
 				$pos = strpos($url, Configure::read('App.cssBaseUrl'));
450 450
 				if ($pos !== false) {
451
-					$url = substr($url, 0, $pos) . 'ccss/' . substr($url, $pos + strlen(Configure::read('App.cssBaseUrl')));
451
+					$url = substr($url, 0, $pos).'ccss/'.substr($url, $pos + strlen(Configure::read('App.cssBaseUrl')));
452 452
 				}
453 453
 			}
454 454
 		}
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 			$out = sprintf(
458 458
 				$this->_tags['style'],
459 459
 				$this->_parseAttributes($options, array('rel', 'block'), '', ' '),
460
-				'@import url(' . $url . ');'
460
+				'@import url('.$url.');'
461 461
 			);
462 462
 		} else {
463 463
 			$out = sprintf(
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 			$options['inline'] = $inline;
523 523
 		}
524 524
 		$options = array_merge(array('block' => null, 'inline' => true, 'once' => true), $options);
525
-		if (!$options['inline'] && empty($options['block'])) {
525
+		if ( ! $options['inline'] && empty($options['block'])) {
526 526
 			$options['block'] = __FUNCTION__;
527 527
 		}
528 528
 		unset($options['inline']);
@@ -530,10 +530,10 @@  discard block
 block discarded – undo
530 530
 		if (is_array($url)) {
531 531
 			$out = '';
532 532
 			foreach ($url as $i) {
533
-				$out .= "\n\t" . $this->script($i, $options);
533
+				$out .= "\n\t".$this->script($i, $options);
534 534
 			}
535 535
 			if (empty($options['block'])) {
536
-				return $out . "\n";
536
+				return $out."\n";
537 537
 			}
538 538
 			return null;
539 539
 		}
@@ -579,9 +579,9 @@  discard block
 block discarded – undo
579 579
 	public function scriptBlock($script, $options = array()) {
580 580
 		$options += array('type' => 'text/javascript', 'safe' => true, 'inline' => true);
581 581
 		if ($options['safe']) {
582
-			$script = "\n" . '//<![CDATA[' . "\n" . $script . "\n" . '//]]>' . "\n";
582
+			$script = "\n".'//<![CDATA['."\n".$script."\n".'//]]>'."\n";
583 583
 		}
584
-		if (!$options['inline'] && empty($options['block'])) {
584
+		if ( ! $options['inline'] && empty($options['block'])) {
585 585
 			$options['block'] = 'script';
586 586
 		}
587 587
 		unset($options['inline'], $options['safe']);
@@ -649,12 +649,12 @@  discard block
 block discarded – undo
649 649
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::style
650 650
  */
651 651
 	public function style($data, $oneline = true) {
652
-		if (!is_array($data)) {
652
+		if ( ! is_array($data)) {
653 653
 			return $data;
654 654
 		}
655 655
 		$out = array();
656 656
 		foreach ($data as $key => $value) {
657
-			$out[] = $key . ':' . $value . ';';
657
+			$out[] = $key.':'.$value.';';
658 658
 		}
659 659
 		if ($oneline) {
660 660
 			return implode(' ', $out);
@@ -680,10 +680,10 @@  discard block
 block discarded – undo
680 680
  */
681 681
 	public function getCrumbs($separator = '&raquo;', $startText = false) {
682 682
 		$crumbs = $this->_prepareCrumbs($startText);
683
-		if (!empty($crumbs)) {
683
+		if ( ! empty($crumbs)) {
684 684
 			$out = array();
685 685
 			foreach ($crumbs as $crumb) {
686
-				if (!empty($crumb[1])) {
686
+				if ( ! empty($crumb[1])) {
687 687
 					$out[] = $this->link($crumb[0], $crumb[1], $crumb[2]);
688 688
 				} else {
689 689
 					$out[] = $crumb[0];
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
  */
715 715
 	public function getCrumbList($options = array(), $startText = false) {
716 716
 		$defaults = array('firstClass' => 'first', 'lastClass' => 'last', 'separator' => '', 'escape' => true);
717
-		$options = array_merge($defaults, (array)$options);
717
+		$options = array_merge($defaults, (array) $options);
718 718
 		$firstClass = $options['firstClass'];
719 719
 		$lastClass = $options['lastClass'];
720 720
 		$separator = $options['separator'];
@@ -736,12 +736,12 @@  discard block
 block discarded – undo
736 736
 			} else {
737 737
 				$elementContent = $this->link($crumb[0], $crumb[1], $crumb[2]);
738 738
 			}
739
-			if (!$which && $firstClass !== false) {
739
+			if ( ! $which && $firstClass !== false) {
740 740
 				$options['class'] = $firstClass;
741 741
 			} elseif ($which == $crumbCount - 1 && $lastClass !== false) {
742 742
 				$options['class'] = $lastClass;
743 743
 			}
744
-			if (!empty($separator) && ($crumbCount - $which >= 2)) {
744
+			if ( ! empty($separator) && ($crumbCount - $which >= 2)) {
745 745
 				$elementContent .= $separator;
746 746
 			}
747 747
 			$result .= $this->tag('li', $elementContent, $options);
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 	protected function _prepareCrumbs($startText, $escape = true) {
760 760
 		$crumbs = $this->_crumbs;
761 761
 		if ($startText) {
762
-			if (!is_array($startText)) {
762
+			if ( ! is_array($startText)) {
763 763
 				$startText = array(
764 764
 					'url' => '/',
765 765
 					'text' => $startText
@@ -804,12 +804,12 @@  discard block
 block discarded – undo
804 804
 		$path = $this->assetUrl($path, $options + array('pathPrefix' => Configure::read('App.imageBaseUrl')));
805 805
 		$options = array_diff_key($options, array('fullBase' => null, 'pathPrefix' => null));
806 806
 
807
-		if (!isset($options['alt'])) {
807
+		if ( ! isset($options['alt'])) {
808 808
 			$options['alt'] = '';
809 809
 		}
810 810
 
811 811
 		$url = false;
812
-		if (!empty($options['url'])) {
812
+		if ( ! empty($options['url'])) {
813 813
 			$url = $options['url'];
814 814
 			unset($options['url']);
815 815
 		}
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
 	public function tableHeaders($names, $trOptions = null, $thOptions = null) {
836 836
 		$out = array();
837 837
 		foreach ($names as $arg) {
838
-			if (!is_array($arg)) {
838
+			if ( ! is_array($arg)) {
839 839
 				$out[] = sprintf($this->_tags['tableheader'], $this->_parseAttributes($thOptions), $arg);
840 840
 			} else {
841 841
 				$out[] = sprintf($this->_tags['tableheader'], $this->_parseAttributes(current($arg)), key($arg));
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::tableCells
858 858
  */
859 859
 	public function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $useCount = false, $continueOddEven = true) {
860
-		if (empty($data[0]) || !is_array($data[0])) {
860
+		if (empty($data[0]) || ! is_array($data[0])) {
861 861
 			$data = array($data);
862 862
 		}
863 863
 
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 					$cellOptions = $cell[1];
889 889
 					$cell = $cell[0];
890 890
 				} elseif ($useCount) {
891
-					$cellOptions['class'] = 'column-' . ++$i;
891
+					$cellOptions['class'] = 'column-'.++$i;
892 892
 				}
893 893
 				$cellsOut[] = sprintf($this->_tags['tablecell'], $this->_parseAttributes($cellOptions), $cell);
894 894
 			}
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::useTag
937 937
  */
938 938
 	public function useTag($tag) {
939
-		if (!isset($this->_tags[$tag])) {
939
+		if ( ! isset($this->_tags[$tag])) {
940 940
 			return '';
941 941
 		}
942 942
 		$args = func_get_args();
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::div
965 965
  */
966 966
 	public function div($class = null, $text = null, $options = array()) {
967
-		if (!empty($class)) {
967
+		if ( ! empty($class)) {
968 968
 			$options['class'] = $class;
969 969
 		}
970 970
 		return $this->tag('div', $text, $options);
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 		if (isset($options['escape'])) {
988 988
 			$text = h($text);
989 989
 		}
990
-		if ($class && !empty($class)) {
990
+		if ($class && ! empty($class)) {
991 991
 			$options['class'] = $class;
992 992
 		}
993 993
 		$tag = 'para';
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
 			'text' => ''
1057 1057
 		);
1058 1058
 
1059
-		if (!empty($options['tag'])) {
1059
+		if ( ! empty($options['tag'])) {
1060 1060
 			$tag = $options['tag'];
1061 1061
 		} else {
1062 1062
 			$tag = null;
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
 						'src' => $source,
1071 1071
 					);
1072 1072
 				}
1073
-				if (!isset($source['type'])) {
1073
+				if ( ! isset($source['type'])) {
1074 1074
 					$ext = pathinfo($source['src'], PATHINFO_EXTENSION);
1075 1075
 					$source['type'] = $this->response->getMimeType($ext);
1076 1076
 				}
@@ -1078,10 +1078,10 @@  discard block
 block discarded – undo
1078 1078
 				$sourceTags .= $this->useTag('tagselfclosing', 'source', $source);
1079 1079
 			}
1080 1080
 			unset($source);
1081
-			$options['text'] = $sourceTags . $options['text'];
1081
+			$options['text'] = $sourceTags.$options['text'];
1082 1082
 			unset($options['fullBase']);
1083 1083
 		} else {
1084
-			if (empty($path) && !empty($options['src'])) {
1084
+			if (empty($path) && ! empty($options['src'])) {
1085 1085
 				$path = $options['src'];
1086 1086
 			}
1087 1087
 			$options['src'] = $this->assetUrl($path, $options);
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
 		$index = 1;
1150 1150
 		foreach ($items as $key => $item) {
1151 1151
 			if (is_array($item)) {
1152
-				$item = $key . $this->nestedList($item, $options, $itemOptions, $tag);
1152
+				$item = $key.$this->nestedList($item, $options, $itemOptions, $tag);
1153 1153
 			}
1154 1154
 			if (isset($itemOptions['even']) && $index % 2 === 0) {
1155 1155
 				$itemOptions['class'] = $itemOptions['even'];
@@ -1204,13 +1204,13 @@  discard block
 block discarded – undo
1204 1204
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#changing-the-tags-output-by-htmlhelper
1205 1205
  */
1206 1206
 	public function loadConfig($configFile, $path = null) {
1207
-		if (!$path) {
1208
-			$path = APP . 'Config' . DS;
1207
+		if ( ! $path) {
1208
+			$path = APP.'Config'.DS;
1209 1209
 		}
1210 1210
 		$file = null;
1211 1211
 		$reader = 'php';
1212 1212
 
1213
-		if (!is_array($configFile)) {
1213
+		if ( ! is_array($configFile)) {
1214 1214
 			$file = $configFile;
1215 1215
 		} elseif (isset($configFile[0])) {
1216 1216
 			$file = $configFile[0];
@@ -1221,9 +1221,9 @@  discard block
 block discarded – undo
1221 1221
 			throw new ConfigureException(__d('cake_dev', 'Cannot load the configuration file. Wrong "configFile" configuration.'));
1222 1222
 		}
1223 1223
 
1224
-		$readerClass = Inflector::camelize($reader) . 'Reader';
1224
+		$readerClass = Inflector::camelize($reader).'Reader';
1225 1225
 		App::uses($readerClass, 'Configure');
1226
-		if (!class_exists($readerClass)) {
1226
+		if ( ! class_exists($readerClass)) {
1227 1227
 			throw new ConfigureException(__d('cake_dev', 'Cannot load the configuration file. Unknown reader.'));
1228 1228
 		}
1229 1229
 
Please login to merge, or discard this patch.
lib/Cake/View/Helper/JqueryEngineHelper.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
127 127
  * @param string $method The method name being generated.
128 128
  * @param string $template The method template
129 129
  * @param array $options Array of options for method
130
- * @param array $extraSafeKeys Extra safe keys
130
+ * @param string[] $extraSafeKeys Extra safe keys
131 131
  * @return string Composed method string
132 132
  */
133 133
 	protected function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) {
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$options = $this->_mapOptions($method, $options);
135 135
 		$options = $this->_prepareCallbacks($method, $options);
136 136
 		$callbacks = array_keys($this->_callbackArguments[$method]);
137
-		if (!empty($extraSafeKeys)) {
137
+		if ( ! empty($extraSafeKeys)) {
138 138
 			$callbacks = array_merge($callbacks, $extraSafeKeys);
139 139
 		}
140 140
 		$options = $this->_parseOptions($options, $callbacks);
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
  */
150 150
 	public function get($selector) {
151 151
 		if ($selector === 'window' || $selector === 'document') {
152
-			$this->selection = $this->jQueryObject . '(' . $selector . ')';
152
+			$this->selection = $this->jQueryObject.'('.$selector.')';
153 153
 		} else {
154
-			$this->selection = $this->jQueryObject . '("' . $selector . '")';
154
+			$this->selection = $this->jQueryObject.'("'.$selector.'")';
155 155
 		}
156 156
 		return $this;
157 157
 	}
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
  * @return string completed domReady method
196 196
  */
197 197
 	public function domReady($functionBody) {
198
-		return $this->jQueryObject . '(document).ready(function () {' . $functionBody . '});';
198
+		return $this->jQueryObject.'(document).ready(function () {'.$functionBody.'});';
199 199
 	}
200 200
 
201 201
 /**
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
  * @return string completed iteration
206 206
  */
207 207
 	public function each($callback) {
208
-		return $this->selection . '.each(function () {' . $callback . '});';
208
+		return $this->selection.'.each(function () {'.$callback.'});';
209 209
 	}
210 210
 
211 211
 /**
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 				$effect = ".$name($speed);";
236 236
 				break;
237 237
 		}
238
-		return $this->selection . $effect;
238
+		return $this->selection.$effect;
239 239
 	}
240 240
 
241 241
 /**
@@ -258,25 +258,25 @@  discard block
 block discarded – undo
258 258
 		if (isset($options['update'])) {
259 259
 			$wrapCallbacks = isset($options['wrapCallbacks']) ? $options['wrapCallbacks'] : true;
260 260
 			$success = '';
261
-			if (isset($options['success']) && !empty($options['success'])) {
261
+			if (isset($options['success']) && ! empty($options['success'])) {
262 262
 				$success .= $options['success'];
263 263
 			}
264
-			$success .= $this->jQueryObject . '("' . $options['update'] . '").html(data);';
265
-			if (!$wrapCallbacks) {
266
-				$success = 'function (data, textStatus) {' . $success . '}';
264
+			$success .= $this->jQueryObject.'("'.$options['update'].'").html(data);';
265
+			if ( ! $wrapCallbacks) {
266
+				$success = 'function (data, textStatus) {'.$success.'}';
267 267
 			}
268 268
 			$options['dataType'] = 'html';
269 269
 			$options['success'] = $success;
270 270
 			unset($options['update']);
271 271
 		}
272 272
 		$callbacks = array('success', 'error', 'beforeSend', 'complete', 'xhr');
273
-		if (!empty($options['dataExpression'])) {
273
+		if ( ! empty($options['dataExpression'])) {
274 274
 			$callbacks[] = 'data';
275 275
 			unset($options['dataExpression']);
276 276
 		}
277 277
 		$options = $this->_prepareCallbacks('request', $options);
278 278
 		$options = $this->_parseOptions($options, $callbacks);
279
-		return $this->jQueryObject . '.ajax({' . $options . '});';
279
+		return $this->jQueryObject.'.ajax({'.$options.'});';
280 280
 	}
281 281
 
282 282
 /**
@@ -347,14 +347,14 @@  discard block
 block discarded – undo
347 347
 	public function serializeForm($options = array()) {
348 348
 		$options = array_merge(array('isForm' => false, 'inline' => false), $options);
349 349
 		$selector = $this->selection;
350
-		if (!$options['isForm']) {
351
-			$selector = $this->selection . '.closest("form")';
350
+		if ( ! $options['isForm']) {
351
+			$selector = $this->selection.'.closest("form")';
352 352
 		}
353 353
 		$method = '.serialize()';
354
-		if (!$options['inline']) {
354
+		if ( ! $options['inline']) {
355 355
 			$method .= ';';
356 356
 		}
357
-		return $selector . $method;
357
+		return $selector.$method;
358 358
 	}
359 359
 
360 360
 }
Please login to merge, or discard this patch.
lib/Cake/View/Helper/JsBaseEngineHelper.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
  * Encode a string into JSON. Converts and escapes necessary characters.
190 190
  *
191 191
  * @param string $string The string that needs to be utf8->hex encoded
192
- * @return void
192
+ * @return string
193 193
  */
194 194
 	protected function _utf8ToHex($string) {
195 195
 		$length = strlen($string);
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  * @return string completed alert()
64 64
  */
65 65
 	public function alert($message) {
66
-		return 'alert("' . $this->escape($message) . '");';
66
+		return 'alert("'.$this->escape($message).'");';
67 67
 	}
68 68
 
69 69
 /**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
  * @return string completed redirect in javascript
75 75
  */
76 76
 	public function redirect($url = null) {
77
-		return 'window.location = "' . Router::url($url) . '";';
77
+		return 'window.location = "'.Router::url($url).'";';
78 78
 	}
79 79
 
80 80
 /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
  * @return string completed confirm()
85 85
  */
86 86
 	public function confirm($message) {
87
-		return 'confirm("' . $this->escape($message) . '");';
87
+		return 'confirm("'.$this->escape($message).'");';
88 88
 	}
89 89
 
90 90
 /**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
  * @return string completed confirm with return script
96 96
  */
97 97
 	public function confirmReturn($message) {
98
-		$out = 'var _confirm = ' . $this->confirm($message);
98
+		$out = 'var _confirm = '.$this->confirm($message);
99 99
 		$out .= "if (!_confirm) {\n\treturn false;\n}";
100 100
 		return $out;
101 101
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
  * @return string completed prompt()
109 109
  */
110 110
 	public function prompt($message, $default = '') {
111
-		return 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '");';
111
+		return 'prompt("'.$this->escape($message).'", "'.$this->escape($default).'");';
112 112
 	}
113 113
 
114 114
 /**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		);
131 131
 		$options = array_merge($defaultOptions, $options);
132 132
 
133
-		return $options['prefix'] . json_encode($data) . $options['postfix'];
133
+		return $options['prefix'].json_encode($data).$options['postfix'];
134 134
 	}
135 135
 
136 136
 /**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			default:
164 164
 				$val = $this->escape($val);
165 165
 				if ($quoteString) {
166
-					$val = '"' . $val . '"';
166
+					$val = '"'.$val.'"';
167 167
 				}
168 168
 		}
169 169
 		return $val;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 				case $ord == 0x22:
216 216
 				case $ord == 0x2F:
217 217
 				case $ord == 0x5C:
218
-					$return .= '\\' . $string{$i};
218
+					$return .= '\\'.$string{$i};
219 219
 					break;
220 220
 				case (($ord >= 0x20) && ($ord <= 0x7F)):
221 221
 					$return .= $string{$i};
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 						$return .= '?';
227 227
 						break;
228 228
 					}
229
-					$charbits = $string{$i} . $string{$i + 1};
229
+					$charbits = $string{$i}.$string{$i + 1};
230 230
 					$char = Multibyte::utf8($charbits);
231 231
 					$return .= sprintf('\u%04s', dechex($char[0]));
232 232
 					$i += 1;
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 						$return .= '?';
238 238
 						break;
239 239
 					}
240
-					$charbits = $string{$i} . $string{$i + 1} . $string{$i + 2};
240
+					$charbits = $string{$i}.$string{$i + 1}.$string{$i + 2};
241 241
 					$char = Multibyte::utf8($charbits);
242 242
 					$return .= sprintf('\u%04s', dechex($char[0]));
243 243
 					$i += 2;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 						$return .= '?';
249 249
 						break;
250 250
 					}
251
-					$charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3};
251
+					$charbits = $string{$i}.$string{$i + 1}.$string{$i + 2}.$string{$i + 3};
252 252
 					$char = Multibyte::utf8($charbits);
253 253
 					$return .= sprintf('\u%04s', dechex($char[0]));
254 254
 					$i += 3;
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 						$return .= '?';
260 260
 						break;
261 261
 					}
262
-					$charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3} . $string{$i + 4};
262
+					$charbits = $string{$i}.$string{$i + 1}.$string{$i + 2}.$string{$i + 3}.$string{$i + 4};
263 263
 					$char = Multibyte::utf8($charbits);
264 264
 					$return .= sprintf('\u%04s', dechex($char[0]));
265 265
 					$i += 4;
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 						$return .= '?';
271 271
 						break;
272 272
 					}
273
-					$charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3} . $string{$i + 4} . $string{$i + 5};
273
+					$charbits = $string{$i}.$string{$i + 1}.$string{$i + 2}.$string{$i + 3}.$string{$i + 4}.$string{$i + 5};
274 274
 					$char = Multibyte::utf8($charbits);
275 275
 					$return .= sprintf('\u%04s', dechex($char[0]));
276 276
 					$i += 5;
@@ -487,10 +487,10 @@  discard block
 block discarded – undo
487 487
 		$out = array();
488 488
 		$safeKeys = array_flip($safeKeys);
489 489
 		foreach ($options as $key => $value) {
490
-			if (!is_int($value) && !isset($safeKeys[$key])) {
490
+			if ( ! is_int($value) && ! isset($safeKeys[$key])) {
491 491
 				$value = $this->value($value);
492 492
 			}
493
-			$out[] = $key . ':' . $value;
493
+			$out[] = $key.':'.$value;
494 494
 		}
495 495
 		sort($out);
496 496
 		return implode(', ', $out);
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
  * @return array Array of mapped options.
506 506
  */
507 507
 	protected function _mapOptions($method, $options) {
508
-		if (!isset($this->_optionMap[$method])) {
508
+		if ( ! isset($this->_optionMap[$method])) {
509 509
 			return $options;
510 510
 		}
511 511
 		foreach ($this->_optionMap[$method] as $abstract => $concrete) {
@@ -532,24 +532,24 @@  discard block
 block discarded – undo
532 532
 			$wrapCallbacks = $options['wrapCallbacks'];
533 533
 		}
534 534
 		unset($options['wrapCallbacks']);
535
-		if (!$wrapCallbacks) {
535
+		if ( ! $wrapCallbacks) {
536 536
 			return $options;
537 537
 		}
538 538
 		$callbackOptions = array();
539 539
 		if (isset($this->_callbackArguments[$method])) {
540 540
 			$callbackOptions = $this->_callbackArguments[$method];
541 541
 		}
542
-		$callbacks = array_unique(array_merge(array_keys($callbackOptions), (array)$callbacks));
542
+		$callbacks = array_unique(array_merge(array_keys($callbackOptions), (array) $callbacks));
543 543
 
544 544
 		foreach ($callbacks as $callback) {
545 545
 			if (empty($options[$callback])) {
546 546
 				continue;
547 547
 			}
548 548
 			$args = null;
549
-			if (!empty($callbackOptions[$callback])) {
549
+			if ( ! empty($callbackOptions[$callback])) {
550 550
 				$args = $callbackOptions[$callback];
551 551
 			}
552
-			$options[$callback] = 'function (' . $args . ') {' . $options[$callback] . '}';
552
+			$options[$callback] = 'function ('.$args.') {'.$options[$callback].'}';
553 553
 		}
554 554
 		return $options;
555 555
 	}
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 		$keys = array_keys($parameters);
581 581
 		$count = count($parameters);
582 582
 		for ($i = 0; $i < $count; $i++) {
583
-			$out .= $keys[$i] . '=' . $parameters[$keys[$i]];
583
+			$out .= $keys[$i].'='.$parameters[$keys[$i]];
584 584
 			if ($i < $count - 1) {
585 585
 				$out .= '&';
586 586
 			}
Please login to merge, or discard this patch.
lib/Cake/View/Helper/JsHelper.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
  * - `safe` - if an inline block is generated should it be wrapped in <![CDATA[ ... ]]> (default true)
185 185
  *
186 186
  * @param array $options options for the code block
187
- * @return mixed Completed javascript tag if there are scripts, if there are no buffered
187
+ * @return null|string Completed javascript tag if there are scripts, if there are no buffered
188 188
  *   scripts null will be returned.
189 189
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#JsHelper::writeBuffer
190 190
  */
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
  *
325 325
  * @param string|array $one Either an array of variables to set, or the name of the variable to set.
326 326
  * @param string|array $two If $one is a string, $two is the value for that key.
327
- * @return void
327
+ * @return false|null
328 328
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#JsHelper::set
329 329
  */
330 330
 	public function set($one, $two = null) {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
  * Extracted Html Options are removed from the $options param.
411 411
  *
412 412
  * @param array $options Options to filter.
413
- * @param array $additional Array of additional keys to extract and include in the return options array.
413
+ * @param string[] $additional Array of additional keys to extract and include in the return options array.
414 414
  * @return array Array of js options and Htmloptions
415 415
  */
416 416
 	protected function _getHtmlOptions($options, $additional = array()) {
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 		$engineName = $className;
93 93
 		list(, $className) = pluginSplit($className);
94 94
 
95
-		$this->_engineName = $className . 'Engine';
96
-		$engineClass = $engineName . 'Engine';
95
+		$this->_engineName = $className.'Engine';
96
+		$engineClass = $engineName.'Engine';
97 97
 		$this->helpers[] = $engineClass;
98 98
 		parent::__construct($View, $settings);
99 99
 	}
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
 			}
147 147
 			return $out;
148 148
 		}
149
-		if (method_exists($this, $method . '_')) {
150
-			return call_user_func(array(&$this, $method . '_'), $params);
149
+		if (method_exists($this, $method.'_')) {
150
+			return call_user_func(array(&$this, $method.'_'), $params);
151 151
 		}
152 152
 		trigger_error(__d('cake_dev', 'JsHelper:: Missing Method %s is undefined', $method), E_USER_WARNING);
153 153
 	}
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#JsHelper::writeBuffer
190 190
  */
191 191
 	public function writeBuffer($options = array()) {
192
-		$domReady = !$this->request->is('ajax');
192
+		$domReady = ! $this->request->is('ajax');
193 193
 		$defaults = array(
194 194
 			'onDomReady' => $domReady, 'inline' => true,
195 195
 			'cache' => false, 'clear' => true, 'safe' => true
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
 
210 210
 		if ($options['cache'] && $options['inline']) {
211 211
 			$filename = md5($script);
212
-			$path = WWW_ROOT . Configure::read('App.jsBaseUrl');
213
-			if (file_exists($path . $filename . '.js')
214
-				|| cache(str_replace(WWW_ROOT, '', $path) . $filename . '.js', $script, '+999 days', 'public')
212
+			$path = WWW_ROOT.Configure::read('App.jsBaseUrl');
213
+			if (file_exists($path.$filename.'.js')
214
+				|| cache(str_replace(WWW_ROOT, '', $path).$filename.'.js', $script, '+999 days', 'public')
215 215
 				) {
216 216
 				return $this->Html->script($filename);
217 217
 			}
@@ -264,9 +264,9 @@  discard block
 block discarded – undo
264 264
  * @return void
265 265
  */
266 266
 	protected function _createVars() {
267
-		if (!empty($this->_jsVars)) {
268
-			$setVar = (strpos($this->setVariable, '.')) ? $this->setVariable : 'window.' . $this->setVariable;
269
-			$this->buffer($setVar . ' = ' . $this->object($this->_jsVars) . ';', true);
267
+		if ( ! empty($this->_jsVars)) {
268
+			$setVar = (strpos($this->setVariable, '.')) ? $this->setVariable : 'window.'.$this->setVariable;
269
+			$this->buffer($setVar.' = '.$this->object($this->_jsVars).';', true);
270 270
 		}
271 271
 	}
272 272
 
@@ -290,12 +290,12 @@  discard block
 block discarded – undo
290 290
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#JsHelper::link
291 291
  */
292 292
 	public function link($title, $url = null, $options = array()) {
293
-		if (!isset($options['id'])) {
294
-			$options['id'] = 'link-' . intval(mt_rand());
293
+		if ( ! isset($options['id'])) {
294
+			$options['id'] = 'link-'.intval(mt_rand());
295 295
 		}
296 296
 		list($options, $htmlOptions) = $this->_getHtmlOptions($options);
297 297
 		$out = $this->Html->link($title, $url, $htmlOptions);
298
-		$this->get('#' . $htmlOptions['id']);
298
+		$this->get('#'.$htmlOptions['id']);
299 299
 		$requestString = $event = '';
300 300
 		if (isset($options['confirm'])) {
301 301
 			$requestString = $this->confirmReturn($options['confirm']);
@@ -307,10 +307,10 @@  discard block
 block discarded – undo
307 307
 
308 308
 		$requestString .= $this->request($url, $options);
309 309
 
310
-		if (!empty($requestString)) {
310
+		if ( ! empty($requestString)) {
311 311
 			$event = $this->event('click', $requestString, $options + array('buffer' => $buffer));
312 312
 		}
313
-		if (isset($buffer) && !$buffer) {
313
+		if (isset($buffer) && ! $buffer) {
314 314
 			$opts = array('safe' => $safe);
315 315
 			$out .= $this->Html->scriptBlock($event, $opts);
316 316
 		}
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 		} else {
339 339
 			$data = array($one => $two);
340 340
 		}
341
-		if (!$data) {
341
+		if ( ! $data) {
342 342
 			return false;
343 343
 		}
344 344
 		$this->_jsVars = array_merge($this->_jsVars, $data);
@@ -366,14 +366,14 @@  discard block
 block discarded – undo
366 366
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#JsHelper::submit
367 367
  */
368 368
 	public function submit($caption = null, $options = array()) {
369
-		if (!isset($options['id'])) {
370
-			$options['id'] = 'submit-' . intval(mt_rand());
369
+		if ( ! isset($options['id'])) {
370
+			$options['id'] = 'submit-'.intval(mt_rand());
371 371
 		}
372 372
 		$formOptions = array('div');
373 373
 		list($options, $htmlOptions) = $this->_getHtmlOptions($options, $formOptions);
374 374
 		$out = $this->Form->submit($caption, $htmlOptions);
375 375
 
376
-		$this->get('#' . $htmlOptions['id']);
376
+		$this->get('#'.$htmlOptions['id']);
377 377
 
378 378
 		$options['data'] = $this->serializeForm(array('isForm' => false, 'inline' => true));
379 379
 		$requestString = $url = '';
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 			$url = $options['url'];
386 386
 			unset($options['url']);
387 387
 		}
388
-		if (!isset($options['method'])) {
388
+		if ( ! isset($options['method'])) {
389 389
 			$options['method'] = 'post';
390 390
 		}
391 391
 		$options['dataExpression'] = true;
@@ -395,10 +395,10 @@  discard block
 block discarded – undo
395 395
 		unset($options['buffer'], $options['safe']);
396 396
 
397 397
 		$requestString .= $this->request($url, $options);
398
-		if (!empty($requestString)) {
398
+		if ( ! empty($requestString)) {
399 399
 			$event = $this->event('click', $requestString, $options + array('buffer' => $buffer));
400 400
 		}
401
-		if (isset($buffer) && !$buffer) {
401
+		if (isset($buffer) && ! $buffer) {
402 402
 			$opts = array('safe' => $safe);
403 403
 			$out .= $this->Html->scriptBlock($event, $opts);
404 404
 		}
Please login to merge, or discard this patch.
lib/Cake/View/Helper/TimeHelper.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
  * Magic isset check for deprecated attributes.
84 84
  *
85 85
  * @param string $name Name of the attribute to check.
86
- * @return boolean
86
+ * @return boolean|null
87 87
  */
88 88
 	public function __isset($name) {
89 89
 		if (isset($this->{$name})) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$settings = Hash::merge(array('engine' => 'CakeTime'), $settings);
55 55
 		parent::__construct($View, $settings);
56 56
 		list($plugin, $engineClass) = pluginSplit($settings['engine'], true);
57
-		App::uses($engineClass, $plugin . 'Utility');
57
+		App::uses($engineClass, $plugin.'Utility');
58 58
 		if (class_exists($engineClass)) {
59 59
 			$this->_engine = new $engineClass($settings);
60 60
 		} else {
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 	public function timeAgoInWords($dateTime, $options = array()) {
401 401
 		$element = null;
402 402
 
403
-		if (!empty($options['element'])) {
403
+		if ( ! empty($options['element'])) {
404 404
 			$element = array(
405 405
 				'tag' => 'span',
406 406
 				'class' => 'time-ago-in-words',
Please login to merge, or discard this patch.