Skip to content
This repository
Browse code

converting $foo == / $foo == 0 to !$foo (and a few $foo === 0)

  • Loading branch information...
commit 22a2e1b51e6b5cbbfadd0b44365826053b8d6f4f 1 parent cf8fcca
Carl Sutton authored September 14, 2012

Showing 29 changed files with 57 additions and 62 deletions. Show diff stats Hide diff stats

  1. 5  lib/Cake/Cache/Engine/ApcEngine.php
  2. 4  lib/Cake/Console/Command/Task/ControllerTask.php
  3. 20  lib/Cake/Console/Command/Task/DbConfigTask.php
  4. 4  lib/Cake/Console/Command/Task/ExtractTask.php
  5. 13  lib/Cake/Console/Command/Task/ModelTask.php
  6. 7  lib/Cake/Console/Command/Task/ProjectTask.php
  7. 4  lib/Cake/Console/Command/Task/ViewTask.php
  8. 2  lib/Cake/Console/ConsoleErrorHandler.php
  9. 4  lib/Cake/Controller/Component/Acl/PhpAcl.php
  10. 2  lib/Cake/Controller/Component/CookieComponent.php
  11. 6  lib/Cake/Error/ExceptionRenderer.php
  12. 2  lib/Cake/I18n/I18n.php
  13. 2  lib/Cake/Model/Behavior/TreeBehavior.php
  14. 2  lib/Cake/Model/Datasource/Database/Mysql.php
  15. 2  lib/Cake/Model/Datasource/Database/Sqlserver.php
  16. 2  lib/Cake/Model/Datasource/DboSource.php
  17. 2  lib/Cake/Model/Model.php
  18. 2  lib/Cake/Network/Http/HttpResponse.php
  19. 2  lib/Cake/Routing/Dispatcher.php
  20. 2  lib/Cake/TestSuite/CakeTestSuiteCommand.php
  21. 6  lib/Cake/TestSuite/Reporter/CakeTextReporter.php
  22. 2  lib/Cake/Utility/CakeNumber.php
  23. 4  lib/Cake/Utility/CakeTime.php
  24. 2  lib/Cake/Utility/Debugger.php
  25. 2  lib/Cake/Utility/String.php
  26. 4  lib/Cake/Utility/Validation.php
  27. 2  lib/Cake/View/Helper/FormHelper.php
  28. 6  lib/Cake/View/Helper/HtmlHelper.php
  29. 2  lib/Cake/View/Helper/PaginatorHelper.php
5  lib/Cake/Cache/Engine/ApcEngine.php
@@ -61,9 +61,8 @@ public function init($settings = array()) {
61 61
  * @return boolean True if the data was successfully cached, false on failure
62 62
  */
63 63
 	public function write($key, $value, $duration) {
64  
-		if ($duration == 0) {
65  
-			$expires = 0;
66  
-		} else {
  64
+		$expires = 0;
  65
+		if ($duration) {
67 66
 			$expires = time() + $duration;
68 67
 		}
69 68
 		apc_store($key . '_expires', $expires, $duration);
4  lib/Cake/Console/Command/Task/ControllerTask.php
@@ -419,14 +419,14 @@ public function getName($useDbConfig = null) {
419 419
 		$controllers = $this->listAll($useDbConfig);
420 420
 		$enteredController = '';
421 421
 
422  
-		while ($enteredController == '') {
  422
+		while (!$enteredController) {
423 423
 			$enteredController = $this->in(__d('cake_console', "Enter a number from the list above,\ntype in the name of another controller, or 'q' to exit"), null, 'q');
424 424
 			if ($enteredController === 'q') {
425 425
 				$this->out(__d('cake_console', 'Exit'));
426 426
 				return $this->_stop();
427 427
 			}
428 428
 
429  
-			if ($enteredController == '' || intval($enteredController) > count($controllers)) {
  429
+			if (!$enteredController || intval($enteredController) > count($controllers)) {
430 430
 				$this->err(__d('cake_console', "The Controller name you supplied was empty,\nor the number you selected was not an option. Please try again."));
431 431
 				$enteredController = '';
432 432
 			}
20  lib/Cake/Console/Command/Task/DbConfigTask.php
@@ -95,7 +95,7 @@ protected function _interactive() {
95 95
 		while (!$done) {
96 96
 			$name = '';
97 97
 
98  
-			while ($name == '') {
  98
+			while (!$name) {
99 99
 				$name = $this->in(__d('cake_console', "Name:"), null, 'default');
100 100
 				if (preg_match('/[^a-z0-9_]/i', $name)) {
101 101
 					$name = '';
@@ -116,12 +116,12 @@ protected function _interactive() {
116 116
 			}
117 117
 
118 118
 			$host = '';
119  
-			while ($host == '') {
  119
+			while (!$host) {
120 120
 				$host = $this->in(__d('cake_console', 'Database Host:'), null, 'localhost');
121 121
 			}
122 122
 
123 123
 			$port = '';
124  
-			while ($port == '') {
  124
+			while (!$port) {
125 125
 				$port = $this->in(__d('cake_console', 'Port?'), null, 'n');
126 126
 			}
127 127
 
@@ -130,16 +130,16 @@ protected function _interactive() {
130 130
 			}
131 131
 
132 132
 			$login = '';
133  
-			while ($login == '') {
  133
+			while (!$login) {
134 134
 				$login = $this->in(__d('cake_console', 'User:'), null, 'root');
135 135
 			}
136 136
 			$password = '';
137 137
 			$blankPassword = false;
138 138
 
139  
-			while ($password == '' && !$blankPassword) {
  139
+			while (!$password && !$blankPassword) {
140 140
 				$password = $this->in(__d('cake_console', 'Password:'));
141 141
 
142  
-				if ($password == '') {
  142
+				if (!$password) {
143 143
 					$blank = $this->in(__d('cake_console', 'The password you supplied was empty. Use an empty password?'), array('y', 'n'), 'n');
144 144
 					if ($blank == 'y') {
145 145
 						$blankPassword = true;
@@ -148,12 +148,12 @@ protected function _interactive() {
148 148
 			}
149 149
 
150 150
 			$database = '';
151  
-			while ($database == '') {
  151
+			while (!$database) {
152 152
 				$database = $this->in(__d('cake_console', 'Database Name:'), null, 'cake');
153 153
 			}
154 154
 
155 155
 			$prefix = '';
156  
-			while ($prefix == '') {
  156
+			while (!$prefix) {
157 157
 				$prefix = $this->in(__d('cake_console', 'Table Prefix?'), null, 'n');
158 158
 			}
159 159
 			if (strtolower($prefix) == 'n') {
@@ -161,7 +161,7 @@ protected function _interactive() {
161 161
 			}
162 162
 
163 163
 			$encoding = '';
164  
-			while ($encoding == '') {
  164
+			while (!$encoding) {
165 165
 				$encoding = $this->in(__d('cake_console', 'Table encoding?'), null, 'n');
166 166
 			}
167 167
 			if (strtolower($encoding) == 'n') {
@@ -170,7 +170,7 @@ protected function _interactive() {
170 170
 
171 171
 			$schema = '';
172 172
 			if ($datasource == 'postgres') {
173  
-				while ($schema == '') {
  173
+				while (!$schema) {
174 174
 					$schema = $this->in(__d('cake_console', 'Table schema?'), null, 'n');
175 175
 				}
176 176
 			}
4  lib/Cake/Console/Command/Task/ExtractTask.php
@@ -391,7 +391,7 @@ protected function _parse($functionName, $map) {
391 391
 				$position = $count;
392 392
 				$depth = 0;
393 393
 
394  
-				while ($depth == 0) {
  394
+				while (!$depth) {
395 395
 					if ($this->_tokens[$position] == '(') {
396 396
 						$depth++;
397 397
 					} elseif ($this->_tokens[$position] == ')') {
@@ -591,7 +591,7 @@ protected function _writeFiles() {
591 591
 				);
592 592
 				if (strtoupper($response) === 'N') {
593 593
 					$response = '';
594  
-					while ($response == '') {
  594
+					while (!$response) {
595 595
 						$response = $this->in(__d('cake_console', "What would you like to name this file?"), null, 'new_' . $filename);
596 596
 						$File = new File($this->_output . $response);
597 597
 						$filename = $response;
13  lib/Cake/Console/Command/Task/ModelTask.php
@@ -700,7 +700,7 @@ public function doMoreAssociations(Model $model, $associations) {
700 700
 			$alias = $this->in(__d('cake_console', 'What is the alias for this association?'));
701 701
 			$className = $this->in(__d('cake_console', 'What className will %s use?', $alias), null, $alias );
702 702
 
703  
-			if ($assocType == 0) {
  703
+			if (!$assocType) {
704 704
 				if (!empty($possibleKeys[$model->table])) {
705 705
 					$showKeys = $possibleKeys[$model->table];
706 706
 				} else {
@@ -935,7 +935,7 @@ public function getName($useDbConfig = null) {
935 935
 
936 936
 		$enteredModel = '';
937 937
 
938  
-		while ($enteredModel == '') {
  938
+		while (!$enteredModel) {
939 939
 			$enteredModel = $this->in(__d('cake_console', "Enter a number from the list above,\n" .
940 940
 				"type in the name of another model, or 'q' to exit"), null, 'q');
941 941
 
@@ -944,18 +944,17 @@ public function getName($useDbConfig = null) {
944 944
 				$this->_stop();
945 945
 			}
946 946
 
947  
-			if ($enteredModel == '' || intval($enteredModel) > count($this->_modelNames)) {
  947
+			if (!$enteredModel || intval($enteredModel) > count($this->_modelNames)) {
948 948
 				$this->err(__d('cake_console', "The model name you supplied was empty,\n" .
949 949
 					"or the number you selected was not an option. Please try again."));
950 950
 				$enteredModel = '';
951 951
 			}
952 952
 		}
953 953
 		if (intval($enteredModel) > 0 && intval($enteredModel) <= count($this->_modelNames)) {
954  
-			$currentModelName = $this->_modelNames[intval($enteredModel) - 1];
955  
-		} else {
956  
-			$currentModelName = $enteredModel;
  954
+			return $this->_modelNames[intval($enteredModel) - 1];
957 955
 		}
958  
-		return $currentModelName;
  956
+
  957
+		return $enteredModel;
959 958
 	}
960 959
 
961 960
 /**
7  lib/Cake/Console/Command/Task/ProjectTask.php
@@ -349,10 +349,7 @@ protected function _replaceCorePath($filename, $hardCode) {
349 349
 		if (!file_put_contents($filename, $result)) {
350 350
 			return false;
351 351
 		}
352  
-		if ($count == 0) {
353  
-			return false;
354  
-		}
355  
-		return true;
  352
+		return (bool)$count;
356 353
 	}
357 354
 
358 355
 /**
@@ -409,7 +406,7 @@ public function getPrefix() {
409 406
 			$this->out(__d('cake_console', 'You need to enable Configure::write(\'Routing.prefixes\',array(\'admin\')) in /app/Config/core.php to use prefix routing.'));
410 407
 			$this->out(__d('cake_console', 'What would you like the prefix route to be?'));
411 408
 			$this->out(__d('cake_console', 'Example: www.example.com/admin/controller'));
412  
-			while ($admin == '') {
  409
+			while (!$admin) {
413 410
 				$admin = $this->in(__d('cake_console', 'Enter a routing prefix:'), null, 'admin');
414 411
 			}
415 412
 			if ($this->cakeAdmin($admin) !== true) {
4  lib/Cake/Console/Command/Task/ViewTask.php
@@ -316,9 +316,9 @@ public function bakeActions($actions, $vars) {
316 316
  */
317 317
 	public function customAction() {
318 318
 		$action = '';
319  
-		while ($action == '') {
  319
+		while (!$action) {
320 320
 			$action = $this->in(__d('cake_console', 'Action Name? (use lowercase_underscored function name)'));
321  
-			if ($action == '') {
  321
+			if (!$action) {
322 322
 				$this->out(__d('cake_console', 'The action name you supplied was empty. Please try again.'));
323 323
 			}
324 324
 		}
2  lib/Cake/Console/ConsoleErrorHandler.php
@@ -81,7 +81,7 @@ public function handleError($code, $description, $file = null, $line = null, $co
81 81
 		$message = __d('cake_console', '%s in [%s, line %s]', $description, $file, $line);
82 82
 		$stderr->write(__d('cake_console', "<error>%s Error:</error> %s\n", $name, $message));
83 83
 
84  
-		if (Configure::read('debug') == 0) {
  84
+		if (!Configure::read('debug')) {
85 85
 			CakeLog::write($log, $message);
86 86
 		}
87 87
 	}
4  lib/Cake/Controller/Component/Acl/PhpAcl.php
@@ -170,11 +170,11 @@ public function check($aro, $aco, $action = "*") {
170 170
 		foreach ($path as $depth => $node) {
171 171
 			foreach ($prioritizedAros as $aros) {
172 172
 				if (!empty($node['allow'])) {
173  
-					$allow = $allow || count(array_intersect($node['allow'], $aros)) > 0;
  173
+					$allow = $allow || count(array_intersect($node['allow'], $aros));
174 174
 				}
175 175
 
176 176
 				if (!empty($node['deny'])) {
177  
-					$allow = $allow && count(array_intersect($node['deny'], $aros)) == 0;
  177
+					$allow = $allow && !count(array_intersect($node['deny'], $aros));
178 178
 				}
179 179
 			}
180 180
 		}
2  lib/Cake/Controller/Component/CookieComponent.php
@@ -381,7 +381,7 @@ protected function _expire($expires = null) {
381 381
 		}
382 382
 		$this->_reset = $this->_expires;
383 383
 
384  
-		if ($expires == 0) {
  384
+		if (!$expires) {
385 385
 			return $this->_expires = 0;
386 386
 		}
387 387
 
6  lib/Cake/Error/ExceptionRenderer.php
@@ -119,7 +119,7 @@ public function __construct(Exception $exception) {
119 119
 			}
120 120
 		}
121 121
 
122  
-		if (Configure::read('debug') == 0) {
  122
+		if (!Configure::read('debug')) {
123 123
 			if ($method == '_cakeError') {
124 124
 				$method = 'error400';
125 125
 			}
@@ -205,7 +205,7 @@ protected function _cakeError(CakeException $error) {
205 205
  */
206 206
 	public function error400($error) {
207 207
 		$message = $error->getMessage();
208  
-		if (Configure::read('debug') == 0 && $error instanceof CakeException) {
  208
+		if (!Configure::read('debug') && $error instanceof CakeException) {
209 209
 			$message = __d('cake', 'Not Found');
210 210
 		}
211 211
 		$url = $this->controller->request->here();
@@ -227,7 +227,7 @@ public function error400($error) {
227 227
  */
228 228
 	public function error500($error) {
229 229
 		$message = $error->getMessage();
230  
-		if (Configure::read('debug') == 0) {
  230
+		if (!Configure::read('debug')) {
231 231
 			$message = __d('cake', 'An Internal Error Has Occurred.');
232 232
 		}
233 233
 		$url = $this->controller->request->here();
2  lib/Cake/I18n/I18n.php
@@ -412,7 +412,7 @@ public static function loadMo($filename) {
412 412
 			$header = unpack("L1magic/L1version/L1count/L1o_msg/L1o_trn", $header);
413 413
 			extract($header);
414 414
 
415  
-			if ((dechex($magic) == '950412de' || dechex($magic) == 'ffffffff950412de') && $version == 0) {
  415
+			if ((dechex($magic) == '950412de' || dechex($magic) == 'ffffffff950412de') && !$version) {
416 416
 				for ($n = 0; $n < $count; $n++) {
417 417
 					$r = unpack("L1len/L1offs", substr($data, $o_msg + $n * 8, 8));
418 418
 					$msgid = substr($data, $r["offs"], $r["len"]);
2  lib/Cake/Model/Behavior/TreeBehavior.php
@@ -798,7 +798,7 @@ public function verify(Model $Model) {
798 798
 				$scope, 'OR' => array($Model->escapeField($left) => $i, $Model->escapeField($right) => $i)
799 799
 			)));
800 800
 			if ($count != 1) {
801  
-				if ($count == 0) {
  801
+				if (!$count) {
802 802
 					$errors[] = array('index', $i, 'missing');
803 803
 				} else {
804 804
 					$errors[] = array('index', $i, 'duplicate');
2  lib/Cake/Model/Datasource/Database/Mysql.php
@@ -433,7 +433,7 @@ public function index($model) {
433 433
 				if (!isset($index[$idx->Key_name]['column'])) {
434 434
 					$col = array();
435 435
 					$index[$idx->Key_name]['column'] = $idx->Column_name;
436  
-					$index[$idx->Key_name]['unique'] = intval($idx->Non_unique == 0);
  436
+					$index[$idx->Key_name]['unique'] = intval(!$idx->Non_unique);
437 437
 				} else {
438 438
 					if (!empty($index[$idx->Key_name]['column']) && !is_array($index[$idx->Key_name]['column'])) {
439 439
 						$col[] = $index[$idx->Key_name]['column'];
2  lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -732,7 +732,7 @@ public function lastAffected($source = null) {
732 732
  */
733 733
 	protected function _execute($sql, $params = array(), $prepareOptions = array()) {
734 734
 		$this->_lastAffected = false;
735  
-		if (strncasecmp($sql, 'SELECT', 6) == 0 || preg_match('/^EXEC(?:UTE)?\s/mi', $sql) > 0) {
  735
+		if (strncasecmp($sql, 'SELECT', 6) === 0 || preg_match('/^EXEC(?:UTE)?\s/mi', $sql) > 0) {
736 736
 			$prepareOptions += array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL);
737 737
 			return parent::_execute($sql, $params, $prepareOptions);
738 738
 		}
2  lib/Cake/Model/Datasource/DboSource.php
@@ -1053,7 +1053,7 @@ public function read(Model $model, $queryData = array(), $recursive = null) {
1053 1053
 
1054 1054
 		if ($model->recursive == -1) {
1055 1055
 			$_associations = array();
1056  
-		} elseif ($model->recursive == 0) {
  1056
+		} elseif (!$model->recursive) {
1057 1057
 			unset($_associations[2], $_associations[3]);
1058 1058
 		}
1059 1059
 
2  lib/Cake/Model/Model.php
@@ -2980,7 +2980,7 @@ public function isUnique($fields, $or = true) {
2980 2980
 		if (!empty($this->id)) {
2981 2981
 			$fields[$this->alias . '.' . $this->primaryKey . ' !='] = $this->id;
2982 2982
 		}
2983  
-		return ($this->find('count', array('conditions' => $fields, 'recursive' => -1)) == 0);
  2983
+		return !$this->find('count', array('conditions' => $fields, 'recursive' => -1));
2984 2984
 	}
2985 2985
 
2986 2986
 /**
2  lib/Cake/Network/Http/HttpResponse.php
@@ -108,7 +108,7 @@ public function getHeader($name, $headers = null) {
108 108
 			return $headers[$name];
109 109
 		}
110 110
 		foreach ($headers as $key => $value) {
111  
-			if (strcasecmp($key, $name) == 0) {
  111
+			if (strcasecmp($key, $name) === 0) {
112 112
 				return $value;
113 113
 			}
114 114
 		}
2  lib/Cake/Routing/Dispatcher.php
@@ -209,7 +209,7 @@ protected function _invoke(Controller $controller, CakeRequest $request, CakeRes
209 209
 	public function parseParams($event) {
210 210
 		$request = $event->data['request'];
211 211
 		Router::setRequestInfo($request);
212  
-		if (count(Router::$routes) == 0) {
  212
+		if (!count(Router::$routes)) {
213 213
 			$namedExpressions = Router::getNamedExpressions();
214 214
 			extract($namedExpressions);
215 215
 			$this->_loadRoutes();
2  lib/Cake/TestSuite/CakeTestSuiteCommand.php
@@ -73,7 +73,7 @@ public function run(array $argv, $exit = true) {
73 73
 			);
74 74
 		}
75 75
 
76  
-		if (count($suite) == 0) {
  76
+		if (!count($suite)) {
77 77
 			$skeleton = new PHPUnit_Util_Skeleton_Test(
78 78
 				$suite->getName(),
79 79
 				$this->arguments['testFile']
6  lib/Cake/TestSuite/Reporter/CakeTextReporter.php
@@ -71,10 +71,10 @@ public function paintFail($message) {
71 71
  * @return void
72 72
  */
73 73
 	public function paintFooter($result) {
74  
-		if ($result->failureCount() + $result->errorCount() == 0) {
75  
-			echo "\nOK\n";
76  
-		} else {
  74
+		if ($result->failureCount() + $result->errorCount()) {
77 75
 			echo "FAILURES!!!\n";
  76
+		} else {
  77
+			echo "\nOK\n";
78 78
 		}
79 79
 
80 80
 		echo "Test cases run: " . $result->count() .
2  lib/Cake/Utility/CakeNumber.php
@@ -241,7 +241,7 @@ public static function currency($number, $currency = 'USD', $options = array())
241 241
 		$result = $options['before'] = $options['after'] = null;
242 242
 
243 243
 		$symbolKey = 'whole';
244  
-		if ($number == 0 ) {
  244
+		if (!$number) {
245 245
 			if ($options['zero'] !== 0 ) {
246 246
 				return $options['zero'];
247 247
 			}
4  lib/Cake/Utility/CakeTime.php
@@ -766,7 +766,7 @@ public static function timeAgoInWords($dateTime, $options = array()) {
766 766
 				}
767 767
 			}
768 768
 
769  
-			if ($months == 0 && $years >= 1 && $diff < ($years * 31536000)) {
  769
+			if (!$months && $years >= 1 && $diff < ($years * 31536000)) {
770 770
 				$months = 11;
771 771
 				$years--;
772 772
 			}
@@ -795,7 +795,7 @@ public static function timeAgoInWords($dateTime, $options = array()) {
795 795
 		}
796 796
 		$diff = $futureTime - $pastTime;
797 797
 
798  
-		if ($diff == 0) {
  798
+		if (!$diff) {
799 799
 			return __d('cake', 'just now', 'just now');
800 800
 		}
801 801
 
2  lib/Cake/Utility/Debugger.php
@@ -475,7 +475,7 @@ protected static function _export($var, $depth, $indent) {
475 475
 			case 'float':
476 476
 				return '(float) ' . $var;
477 477
 			case 'string':
478  
-				if (trim($var) == '') {
  478
+				if (!trim($var)) {
479 479
 					return "''";
480 480
 				}
481 481
 				return "'" . $var . "'";
2  lib/Cake/Utility/String.php
@@ -134,7 +134,7 @@ public static function tokenize($data, $separator = ',', $leftBound = '(', $righ
134 134
 			}
135 135
 			if ($tmpOffset !== -1) {
136 136
 				$buffer .= substr($data, $offset, ($tmpOffset - $offset));
137  
-				if ($data{$tmpOffset} == $separator && $depth == 0) {
  137
+				if (!$depth && $data{$tmpOffset} == $separator) {
138 138
 					$results[] = $buffer;
139 139
 					$buffer = '';
140 140
 				} else {
4  lib/Cake/Utility/Validation.php
@@ -859,7 +859,7 @@ public static function luhn($check, $deep = false) {
859 859
 		if ($deep !== true) {
860 860
 			return true;
861 861
 		}
862  
-		if ($check == 0) {
  862
+		if (!$check) {
863 863
 			return false;
864 864
 		}
865 865
 		$sum = 0;
@@ -874,7 +874,7 @@ public static function luhn($check, $deep = false) {
874 874
 			$sum += ($number < 10) ? $number : $number - 9;
875 875
 		}
876 876
 
877  
-		return ($sum % 10 == 0);
  877
+		return ($sum % 10 === 0);
878 878
 	}
879 879
 
880 880
 /**
2  lib/Cake/View/Helper/FormHelper.php
@@ -2228,7 +2228,7 @@ public function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $a
2228 2228
 					} elseif ($time[0] >= 12) {
2229 2229
 						$meridian = 'pm';
2230 2230
 					}
2231  
-					if ($time[0] == 0 && $timeFormat == '12') {
  2231
+					if (!$time[0] && $timeFormat == '12') {
2232 2232
 						$time[0] = 12;
2233 2233
 					}
2234 2234
 					$hour = $min = null;
6  lib/Cake/View/Helper/HtmlHelper.php
@@ -701,7 +701,7 @@ public function getCrumbList($options = array(), $startText = false) {
701 701
 				} else {
702 702
 					$elementContent = $this->link($crumb[0], $crumb[1], $crumb[2]);
703 703
 				}
704  
-				if ($which == 0) {
  704
+				if (!$which) {
705 705
 					$options['class'] = 'first';
706 706
 				} elseif ($which == $crumbCount - 1) {
707 707
 					$options['class'] = 'last';
@@ -1116,9 +1116,9 @@ protected function _nestedListItem($items, $options, $itemOptions, $tag) {
1116 1116
 			if (is_array($item)) {
1117 1117
 				$item = $key . $this->nestedList($item, $options, $itemOptions, $tag);
1118 1118
 			}
1119  
-			if (isset($itemOptions['even']) && $index % 2 == 0) {
  1119
+			if (isset($itemOptions['even']) && $index % 2 === 0) {
1120 1120
 				$itemOptions['class'] = $itemOptions['even'];
1121  
-			} elseif (isset($itemOptions['odd']) && $index % 2 != 0) {
  1121
+			} elseif (isset($itemOptions['odd']) && $index % 2 !== 0) {
1122 1122
 				$itemOptions['class'] = $itemOptions['odd'];
1123 1123
 			}
1124 1124
 			$out .= sprintf($this->_tags['li'], $this->_parseAttributes($itemOptions, array('even', 'odd'), ' ', ''), $item);
2  lib/Cake/View/Helper/PaginatorHelper.php
@@ -583,7 +583,7 @@ public function counter($options = array()) {
583 583
 		$options);
584 584
 
585 585
 		$paging = $this->params($options['model']);
586  
-		if ($paging['pageCount'] == 0) {
  586
+		if (!$paging['pageCount']) {
587 587
 			$paging['pageCount'] = 1;
588 588
 		}
589 589
 		$start = 0;

0 notes on commit 22a2e1b

Please sign in to comment.
Something went wrong with that request. Please try again.