Completed
Push — master ( a8e8b7...373ce5 )
by Reginaldo
19:01
created
lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php 2 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,6 +108,7 @@  discard block
 block discarded – undo
108 108
  * Guess the class name the test was for based on the test case filename.
109 109
  *
110 110
  * @param ReflectionClass $testReflection.
111
+ * @param ReflectionClass $testReflection
111 112
  * @return string Possible test subject name.
112 113
  */
113 114
 	protected function _guessSubjectName($testReflection) {
@@ -127,7 +128,7 @@  discard block
 block discarded – undo
127 128
  * @param integer $linenumber
128 129
  * @param string $class
129 130
  * @param array $coveringTests
130
- * @return void
131
+ * @return string
131 132
  */
132 133
 	protected function _paintLine($line, $linenumber, $class, $coveringTests) {
133 134
 		$coveredBy = '';
@@ -150,7 +151,7 @@  discard block
 block discarded – undo
150 151
 /**
151 152
  * generate some javascript for the coverage report.
152 153
  *
153
- * @return void
154
+ * @return string
154 155
  */
155 156
 	public function coverageScript() {
156 157
 		return <<<HTML
@@ -199,7 +200,7 @@  discard block
 block discarded – undo
199 200
 /**
200 201
  * Generate an HTML snippet for coverage footers
201 202
  *
202
- * @return void
203
+ * @return string
203 204
  */
204 205
 	public function coverageFooter() {
205 206
 		return "</pre></div></div>";
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		foreach ($fileLines as $lineno => $line) {
78 78
 			$class = 'ignored';
79 79
 			$coveringTests = array();
80
-			if (!empty($coverageData[$lineno]) && is_array($coverageData[$lineno])) {
80
+			if ( ! empty($coverageData[$lineno]) && is_array($coverageData[$lineno])) {
81 81
 				$coveringTests = array();
82 82
 				foreach ($coverageData[$lineno] as $test) {
83 83
 					$class = (is_array($test) && isset($test['id'])) ? $test['id'] : $test;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	protected function _guessSubjectName($testReflection) {
114 114
 		$basename = basename($testReflection->getFilename());
115 115
 		if (strpos($basename, '.test') !== false) {
116
-			list($subject, ) = explode('.', $basename, 2);
116
+			list($subject,) = explode('.', $basename, 2);
117 117
 			return $subject;
118 118
 		}
119 119
 		$subject = str_replace('Test.php', '', $basename);
@@ -131,10 +131,10 @@  discard block
 block discarded – undo
131 131
  */
132 132
 	protected function _paintLine($line, $linenumber, $class, $coveringTests) {
133 133
 		$coveredBy = '';
134
-		if (!empty($coveringTests)) {
134
+		if ( ! empty($coveringTests)) {
135 135
 			$coveredBy = "Covered by:\n";
136 136
 			foreach ($coveringTests as $test) {
137
-				$coveredBy .= $test . "\n";
137
+				$coveredBy .= $test."\n";
138 138
 			}
139 139
 		}
140 140
 
Please login to merge, or discard this patch.
lib/Cake/TestSuite/Fixture/CakeTestFixture.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@
 block discarded – undo
264 264
  * of this fixture could be executed successfully.
265 265
  *
266 266
  * @param DboSource $db An instance of the database into which the records will be inserted
267
- * @return boolean on success or if there are no records to insert, or false on failure
267
+ * @return boolean|null on success or if there are no records to insert, or false on failure
268 268
  * @throws CakeException if counts of values and fields do not match.
269 269
  */
270 270
 	public function insert($db) {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			}
96 96
 		}
97 97
 		$connection = 'test';
98
-		if (!empty($this->useDbConfig)) {
98
+		if ( ! empty($this->useDbConfig)) {
99 99
 			$connection = $this->useDbConfig;
100 100
 			if (strpos($connection, 'test') !== 0) {
101 101
 				$message = __d(
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 			$this->Schema->connection = $import['connection'];
128 128
 			if (isset($import['model'])) {
129 129
 				list($plugin, $modelClass) = pluginSplit($import['model'], true);
130
-				App::uses($modelClass, $plugin . 'Model');
131
-				if (!class_exists($modelClass)) {
130
+				App::uses($modelClass, $plugin.'Model');
131
+				if ( ! class_exists($modelClass)) {
132 132
 					throw new MissingModelException(array('class' => $modelClass));
133 133
 				}
134 134
 				$model = new $modelClass(null, null, $import['connection']);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 				ClassRegistry::flush();
156 156
 			}
157 157
 
158
-			if (!empty($db->config['prefix']) && strpos($this->table, $db->config['prefix']) === 0) {
158
+			if ( ! empty($db->config['prefix']) && strpos($this->table, $db->config['prefix']) === 0) {
159 159
 				$this->table = str_replace($db->config['prefix'], '', $this->table);
160 160
 			}
161 161
 
@@ -172,17 +172,17 @@  discard block
 block discarded – undo
172 172
 				);
173 173
 				$records = $db->fetchAll($db->buildStatement($query, $model), false, $model->alias);
174 174
 
175
-				if ($records !== false && !empty($records)) {
176
-					$this->records = Hash::extract($records, '{n}.' . $model->alias);
175
+				if ($records !== false && ! empty($records)) {
176
+					$this->records = Hash::extract($records, '{n}.'.$model->alias);
177 177
 				}
178 178
 			}
179 179
 		}
180 180
 
181
-		if (!isset($this->table)) {
181
+		if ( ! isset($this->table)) {
182 182
 			$this->table = Inflector::underscore(Inflector::pluralize($this->name));
183 183
 		}
184 184
 
185
-		if (!isset($this->primaryKey) && isset($this->fields['id'])) {
185
+		if ( ! isset($this->primaryKey) && isset($this->fields['id'])) {
186 186
 			$this->primaryKey = 'id';
187 187
 		}
188 188
 	}
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
  * @return boolean True on success, false on failure
195 195
  */
196 196
 	public function create($db) {
197
-		if (!isset($this->fields) || empty($this->fields)) {
197
+		if ( ! isset($this->fields) || empty($this->fields)) {
198 198
 			return false;
199 199
 		}
200 200
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
 				if (is_string($args)) {
206 206
 					$type = $args;
207
-				} elseif (!empty($args['type'])) {
207
+				} elseif ( ! empty($args['type'])) {
208 208
 					$type = $args['type'];
209 209
 				} else {
210 210
 					continue;
@@ -268,9 +268,9 @@  discard block
 block discarded – undo
268 268
  * @throws CakeException if counts of values and fields do not match.
269 269
  */
270 270
 	public function insert($db) {
271
-		if (!isset($this->_insert)) {
271
+		if ( ! isset($this->_insert)) {
272 272
 			$values = array();
273
-			if (isset($this->records) && !empty($this->records)) {
273
+			if (isset($this->records) && ! empty($this->records)) {
274 274
 				$fields = array();
275 275
 				foreach ($this->records as $record) {
276 276
 					$fields = array_merge($fields, array_keys(array_intersect_key($record, $this->fields)));
Please login to merge, or discard this patch.
lib/Cake/TestSuite/Fixture/CakeTestModel.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
  *
47 47
  * @param array $data
48 48
  * @param boolean|array $validate
49
- * @param array $fieldList
49
+ * @param string[] $fieldList
50 50
  * @return void
51 51
  */
52 52
 	public function save($data = null, $validate = true, $fieldList = array()) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
  */
39 39
 	public function __construct($id = false, $table = null, $ds = null) {
40 40
 		parent::__construct($id, $table, $ds);
41
-		$this->order = array($this->alias . '.' . $this->primaryKey => 'ASC');
41
+		$this->order = array($this->alias.'.'.$this->primaryKey => 'ASC');
42 42
 	}
43 43
 
44 44
 /**
Please login to merge, or discard this patch.
lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -295,7 +295,6 @@
 block discarded – undo
295 295
 /**
296 296
  * Paints a PHP exception.
297 297
  *
298
- * @param Exception $exception Exception to display.
299 298
  * @param mixed $test
300 299
  * @return void
301 300
  */
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
  * @return void
47 47
  */
48 48
 	public function sendContentType() {
49
-		if (!headers_sent()) {
50
-			header('Content-Type: text/html; charset=' . Configure::read('App.encoding'));
49
+		if ( ! headers_sent()) {
50
+			header('Content-Type: text/html; charset='.Configure::read('App.encoding'));
51 51
 		}
52 52
 	}
53 53
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	public function paintDocumentStart() {
60 60
 		ob_start();
61 61
 		$baseDir = $this->params['baseDir'];
62
-		include CAKE . 'TestSuite' . DS . 'templates' . DS . 'header.php';
62
+		include CAKE.'TestSuite'.DS.'templates'.DS.'header.php';
63 63
 	}
64 64
 
65 65
 /**
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
  * @return void
70 70
  */
71 71
 	public function paintTestMenu() {
72
-		$cases = $this->baseUrl() . '?show=cases';
72
+		$cases = $this->baseUrl().'?show=cases';
73 73
 		$plugins = App::objects('plugin', null, false);
74 74
 		sort($plugins);
75
-		include CAKE . 'TestSuite' . DS . 'templates' . DS . 'menu.php';
75
+		include CAKE.'TestSuite'.DS.'templates'.DS.'menu.php';
76 76
 	}
77 77
 
78 78
 /**
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 			$buffer = "<h3>Core Test Cases:</h3>\n<ul>";
92 92
 			$urlExtra = '&core=true';
93 93
 		} elseif ($plugin) {
94
-			$buffer = "<h3>" . Inflector::humanize($plugin) . " Test Cases:</h3>\n<ul>";
95
-			$urlExtra = '&plugin=' . $plugin;
94
+			$buffer = "<h3>".Inflector::humanize($plugin)." Test Cases:</h3>\n<ul>";
95
+			$urlExtra = '&plugin='.$plugin;
96 96
 		}
97 97
 
98 98
 		if (count($testCases) < 1) {
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			$title = explode(DS, str_replace('.test.php', '', $testCase));
104 104
 			$title[count($title) - 1] = Inflector::camelize($title[count($title) - 1]);
105 105
 			$title = implode(' / ', $title);
106
-				$buffer .= "<li><a href='" . $this->baseUrl() . "?case=" . urlencode($testCase) . $urlExtra . "'>" . $title . "</a></li>\n";
106
+				$buffer .= "<li><a href='".$this->baseUrl()."?case=".urlencode($testCase).$urlExtra."'>".$title."</a></li>\n";
107 107
 		}
108 108
 		$buffer .= "</ul>\n";
109 109
 		echo $buffer;
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
  * @return void
118 118
  */
119 119
 	public function sendNoCacheHeaders() {
120
-		if (!headers_sent()) {
120
+		if ( ! headers_sent()) {
121 121
 			header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
122
-			header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
122
+			header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
123 123
 			header("Cache-Control: no-store, no-cache, must-revalidate");
124 124
 			header("Cache-Control: post-check=0, pre-check=0", false);
125 125
 			header("Pragma: no-cache");
@@ -140,16 +140,16 @@  discard block
 block discarded – undo
140 140
 		echo "<div style=\"";
141 141
 		echo "padding: 8px; margin: 1em 0; background-color: $colour; color: white;";
142 142
 		echo "\">";
143
-		echo ($result->count() - $result->skippedCount()) . "/" . $result->count();
143
+		echo ($result->count() - $result->skippedCount())."/".$result->count();
144 144
 		echo " test methods complete:\n";
145
-		echo "<strong>" . count($result->passed()) . "</strong> passes, ";
146
-		echo "<strong>" . $result->failureCount() . "</strong> fails, ";
147
-		echo "<strong>" . $this->numAssertions . "</strong> assertions and ";
148
-		echo "<strong>" . $result->errorCount() . "</strong> exceptions.";
145
+		echo "<strong>".count($result->passed())."</strong> passes, ";
146
+		echo "<strong>".$result->failureCount()."</strong> fails, ";
147
+		echo "<strong>".$this->numAssertions."</strong> assertions and ";
148
+		echo "<strong>".$result->errorCount()."</strong> exceptions.";
149 149
 		echo "</div>\n";
150 150
 		echo '<div style="padding:0 0 5px;">';
151
-		echo '<p><strong>Time:</strong> ' . $result->time() . ' seconds</p>';
152
-		echo '<p><strong>Peak memory:</strong> ' . number_format(memory_get_peak_usage()) . ' bytes</p>';
151
+		echo '<p><strong>Time:</strong> '.$result->time().' seconds</p>';
152
+		echo '<p><strong>Peak memory:</strong> '.number_format(memory_get_peak_usage()).' bytes</p>';
153 153
 		echo $this->_paintLinks();
154 154
 		echo '</div>';
155 155
 		if (isset($this->params['codeCoverage']) && $this->params['codeCoverage']) {
@@ -186,25 +186,25 @@  discard block
 block discarded – undo
186 186
  */
187 187
 	protected function _paintLinks() {
188 188
 		$show = $query = array();
189
-		if (!empty($this->params['case'])) {
189
+		if ( ! empty($this->params['case'])) {
190 190
 			$show['show'] = 'cases';
191 191
 		}
192 192
 
193
-		if (!empty($this->params['core'])) {
193
+		if ( ! empty($this->params['core'])) {
194 194
 			$show['core'] = $query['core'] = 'true';
195 195
 		}
196
-		if (!empty($this->params['plugin'])) {
196
+		if ( ! empty($this->params['plugin'])) {
197 197
 			$show['plugin'] = $query['plugin'] = $this->params['plugin'];
198 198
 		}
199
-		if (!empty($this->params['case'])) {
199
+		if ( ! empty($this->params['case'])) {
200 200
 			$query['case'] = $this->params['case'];
201 201
 		}
202 202
 		$show = $this->_queryString($show);
203 203
 		$query = $this->_queryString($query);
204 204
 
205
-		echo "<p><a href='" . $this->baseUrl() . $show . "'>Run more tests</a> | <a href='" . $this->baseUrl() . $query . "&amp;show_passes=1'>Show Passes</a> | \n";
206
-		echo "<a href='" . $this->baseUrl() . $query . "&amp;debug=1'>Enable Debug Output</a> | \n";
207
-		echo "<a href='" . $this->baseUrl() . $query . "&amp;code_coverage=true'>Analyze Code Coverage</a></p>\n";
205
+		echo "<p><a href='".$this->baseUrl().$show."'>Run more tests</a> | <a href='".$this->baseUrl().$query."&amp;show_passes=1'>Show Passes</a> | \n";
206
+		echo "<a href='".$this->baseUrl().$query."&amp;debug=1'>Enable Debug Output</a> | \n";
207
+		echo "<a href='".$this->baseUrl().$query."&amp;code_coverage=true'>Analyze Code Coverage</a></p>\n";
208 208
 	}
209 209
 
210 210
 /**
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
  */
231 231
 	public function paintDocumentEnd() {
232 232
 		$baseDir = $this->params['baseDir'];
233
-		include CAKE . 'TestSuite' . DS . 'templates' . DS . 'footer.php';
233
+		include CAKE.'TestSuite'.DS.'templates'.DS.'footer.php';
234 234
 		if (ob_get_length()) {
235 235
 			ob_end_flush();
236 236
 		}
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
  */
249 249
 	public function paintFail($message, $test) {
250 250
 		$trace = $this->_getStackTrace($message);
251
-		$testName = get_class($test) . '(' . $test->getName() . ')';
251
+		$testName = get_class($test).'('.$test->getName().')';
252 252
 
253 253
 		$actualMsg = $expectedMsg = null;
254 254
 		if (method_exists($message, 'getComparisonFailure')) {
@@ -261,15 +261,15 @@  discard block
 block discarded – undo
261 261
 
262 262
 		echo "<li class='fail'>\n";
263 263
 		echo "<span>Failed</span>";
264
-		echo "<div class='msg'><pre>" . $this->_htmlEntities($message->toString());
264
+		echo "<div class='msg'><pre>".$this->_htmlEntities($message->toString());
265 265
 
266 266
 		if ((is_string($actualMsg) && is_string($expectedMsg)) || (is_array($actualMsg) && is_array($expectedMsg))) {
267
-			echo "<br />" . PHPUnit_Util_Diff::diff($expectedMsg, $actualMsg);
267
+			echo "<br />".PHPUnit_Util_Diff::diff($expectedMsg, $actualMsg);
268 268
 		}
269 269
 
270 270
 		echo "</pre></div>\n";
271
-		echo "<div class='msg'>" . __d('cake_dev', 'Test case: %s', $testName) . "</div>\n";
272
-		echo "<div class='msg'>" . __d('cake_dev', 'Stack trace:') . '<br />' . $trace . "</div>\n";
271
+		echo "<div class='msg'>".__d('cake_dev', 'Test case: %s', $testName)."</div>\n";
272
+		echo "<div class='msg'>".__d('cake_dev', 'Stack trace:').'<br />'.$trace."</div>\n";
273 273
 		echo "</li>\n";
274 274
 	}
275 275
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 			echo "<li class='pass'>\n";
288 288
 			echo "<span>Passed</span> ";
289 289
 
290
-			echo "<br />" . $this->_htmlEntities($test->getName()) . " ($time seconds)\n";
290
+			echo "<br />".$this->_htmlEntities($test->getName())." ($time seconds)\n";
291 291
 			echo "</li>\n";
292 292
 		}
293 293
 	}
@@ -301,14 +301,14 @@  discard block
 block discarded – undo
301 301
  */
302 302
 	public function paintException($message, $test) {
303 303
 		$trace = $this->_getStackTrace($message);
304
-		$testName = get_class($test) . '(' . $test->getName() . ')';
304
+		$testName = get_class($test).'('.$test->getName().')';
305 305
 
306 306
 		echo "<li class='fail'>\n";
307
-		echo "<span>" . get_class($message) . "</span>";
307
+		echo "<span>".get_class($message)."</span>";
308 308
 
309
-		echo "<div class='msg'>" . $this->_htmlEntities($message->getMessage()) . "</div>\n";
310
-		echo "<div class='msg'>" . __d('cake_dev', 'Test case: %s', $testName) . "</div>\n";
311
-		echo "<div class='msg'>" . __d('cake_dev', 'Stack trace:') . '<br />' . $trace . "</div>\n";
309
+		echo "<div class='msg'>".$this->_htmlEntities($message->getMessage())."</div>\n";
310
+		echo "<div class='msg'>".__d('cake_dev', 'Test case: %s', $testName)."</div>\n";
311
+		echo "<div class='msg'>".__d('cake_dev', 'Stack trace:').'<br />'.$trace."</div>\n";
312 312
 		echo "</li>\n";
313 313
 	}
314 314
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	public function paintSkip($message, $test) {
323 323
 		echo "<li class='skipped'>\n";
324 324
 		echo "<span>Skipped</span> ";
325
-		echo $test->getName() . ': ' . $this->_htmlEntities($message->getMessage());
325
+		echo $test->getName().': '.$this->_htmlEntities($message->getMessage());
326 326
 		echo "</li>\n";
327 327
 	}
328 328
 
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
  * @return void
334 334
  */
335 335
 	public function paintFormattedMessage($message) {
336
-		echo '<pre>' . $this->_htmlEntities($message) . '</pre>';
336
+		echo '<pre>'.$this->_htmlEntities($message).'</pre>';
337 337
 	}
338 338
 
339 339
 /**
@@ -357,9 +357,9 @@  discard block
 block discarded – undo
357 357
 		$out = array();
358 358
 		foreach ($trace as $frame) {
359 359
 			if (isset($frame['file']) && isset($frame['line'])) {
360
-				$out[] = $frame['file'] . ' : ' . $frame['line'];
360
+				$out[] = $frame['file'].' : '.$frame['line'];
361 361
 			} elseif (isset($frame['class']) && isset($frame['function'])) {
362
-				$out[] = $frame['class'] . '::' . $frame['function'];
362
+				$out[] = $frame['class'].'::'.$frame['function'];
363 363
 			} else {
364 364
 				$out[] = '[internal]';
365 365
 			}
@@ -374,10 +374,10 @@  discard block
 block discarded – undo
374 374
  * @return void
375 375
  */
376 376
 	public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
377
-		if (!$this->_headerSent) {
377
+		if ( ! $this->_headerSent) {
378 378
 			echo $this->paintHeader();
379 379
 		}
380
-		echo '<h2>' . __d('cake_dev', 'Running  %s', $suite->getName()) . '</h2>';
380
+		echo '<h2>'.__d('cake_dev', 'Running  %s', $suite->getName()).'</h2>';
381 381
 	}
382 382
 
383 383
 }
Please login to merge, or discard this patch.
lib/Cake/Utility/CakeNumber.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
  *
98 98
  * @param float $value A floating point number.
99 99
  * @param integer $precision The precision of the returned number.
100
- * @return float Formatted float.
100
+ * @return string Formatted float.
101 101
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::precision
102 102
  */
103 103
 	public static function precision($value, $precision = 3) {
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  */
138 138
 	public static function fromReadableSize($size, $default = false) {
139 139
 		if (ctype_digit($size)) {
140
-			return (int)$size;
140
+			return (int) $size;
141 141
 		}
142 142
 		$size = strtoupper($size);
143 143
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
 		if (substr($size, -1) === 'B' && ctype_digit(substr($size, 0, -1))) {
156 156
 			$size = substr($size, 0, -1);
157
-			return (int)$size;
157
+			return (int) $size;
158 158
 		}
159 159
 
160 160
 		if ($default !== false) {
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		if ($options['multiply']) {
182 182
 			$value *= 100;
183 183
 		}
184
-		return self::precision($value, $precision) . '%';
184
+		return self::precision($value, $precision).'%';
185 185
 	}
186 186
 
187 187
 /**
@@ -202,15 +202,15 @@  discard block
 block discarded – undo
202 202
 		$separators = array(',', '.', '-', ':');
203 203
 
204 204
 		$before = $after = null;
205
-		if (is_string($options) && !in_array($options, $separators)) {
205
+		if (is_string($options) && ! in_array($options, $separators)) {
206 206
 			$before = $options;
207 207
 		}
208 208
 		$thousands = ',';
209
-		if (!is_array($options) && in_array($options, $separators)) {
209
+		if ( ! is_array($options) && in_array($options, $separators)) {
210 210
 			$thousands = $options;
211 211
 		}
212 212
 		$decimals = '.';
213
-		if (!is_array($options) && in_array($options, $separators)) {
213
+		if ( ! is_array($options) && in_array($options, $separators)) {
214 214
 			$decimals = $options;
215 215
 		}
216 216
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		}
223 223
 
224 224
 		$value = self::_numberFormat($value, $places, '.', '');
225
-		$out = $before . self::_numberFormat($value, $places, $decimals, $thousands) . $after;
225
+		$out = $before.self::_numberFormat($value, $places, $decimals, $thousands).$after;
226 226
 
227 227
 		if ($escape) {
228 228
 			return h($out);
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 		$places = isset($options['places']) ? $options['places'] : 0;
252 252
 		$value = self::_numberFormat($value, $places, '.', '');
253 253
 		$sign = $value > 0 ? '+' : '';
254
-		$options['before'] = isset($options['before']) ? $options['before'] . $sign : $sign;
254
+		$options['before'] = isset($options['before']) ? $options['before'].$sign : $sign;
255 255
 		return self::format($value, $options);
256 256
 	}
257 257
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
  * @return string
266 266
  */
267 267
 	protected static function _numberFormat($value, $places = 0, $decimals = '.', $thousands = ',') {
268
-		if (!isset(self::$_numberFormatSupport)) {
268
+		if ( ! isset(self::$_numberFormatSupport)) {
269 269
 			self::$_numberFormatSupport = version_compare(PHP_VERSION, '5.4.0', '>=');
270 270
 		}
271 271
 		if (self::$_numberFormatSupport) {
@@ -339,15 +339,15 @@  discard block
 block discarded – undo
339 339
 		if (isset($options['before']) && $options['before'] !== '') {
340 340
 			$options['wholeSymbol'] = $options['before'];
341 341
 		}
342
-		if (isset($options['after']) && !$options['after'] !== '') {
342
+		if (isset($options['after']) && ! $options['after'] !== '') {
343 343
 			$options['fractionSymbol'] = $options['after'];
344 344
 		}
345 345
 
346 346
 		$result = $options['before'] = $options['after'] = null;
347 347
 
348 348
 		$symbolKey = 'whole';
349
-		$value = (float)$value;
350
-		if (!$value) {
349
+		$value = (float) $value;
350
+		if ( ! $value) {
351 351
 			if ($options['zero'] !== 0) {
352 352
 				return $options['zero'];
353 353
 			}
@@ -360,17 +360,17 @@  discard block
 block discarded – undo
360 360
 			}
361 361
 		}
362 362
 
363
-		$position = $options[$symbolKey . 'Position'] !== 'after' ? 'before' : 'after';
364
-		$options[$position] = $options[$symbolKey . 'Symbol'];
363
+		$position = $options[$symbolKey.'Position'] !== 'after' ? 'before' : 'after';
364
+		$options[$position] = $options[$symbolKey.'Symbol'];
365 365
 
366 366
 		$abs = abs($value);
367 367
 		$result = self::format($abs, $options);
368 368
 
369 369
 		if ($value < 0) {
370 370
 			if ($options['negative'] === '()') {
371
-				$result = '(' . $result . ')';
371
+				$result = '('.$result.')';
372 372
 			} else {
373
-				$result = $options['negative'] . $result;
373
+				$result = $options['negative'].$result;
374 374
 			}
375 375
 		}
376 376
 		return $result;
Please login to merge, or discard this patch.
lib/Cake/Utility/CakeTime.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 /**
296 296
  * Returns server's offset from GMT in seconds.
297 297
  *
298
- * @return integer Offset
298
+ * @return string Offset
299 299
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#TimeHelper::serverOffset
300 300
  */
301 301
 	public static function serverOffset() {
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
  * @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
624 624
  * @param string|DateTimeZone $timezone Timezone string or DateTimeZone object
625 625
  * @param string $format date format string
626
- * @return mixed Formatted date
626
+ * @return false|string Formatted date
627 627
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#TimeHelper::toServer
628 628
  */
629 629
 	public static function toServer($dateString, $timezone = null, $format = 'Y-m-d H:i:s') {
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 /**
940 940
  * Returns true if specified datetime was within the interval specified, else false.
941 941
  *
942
- * @param string|integer $timeInterval the numeric value with space then time type.
942
+ * @param string $timeInterval the numeric value with space then time type.
943 943
  *    Example of valid types: 6 hours, 2 days, 1 minute.
944 944
  * @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
945 945
  * @param string|DateTimeZone $timezone Timezone string or DateTimeZone object
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 /**
963 963
  * Returns true if specified datetime is within the interval specified, else false.
964 964
  *
965
- * @param string|integer $timeInterval the numeric value with space then time type.
965
+ * @param string $timeInterval the numeric value with space then time type.
966 966
  *    Example of valid types: 6 hours, 2 days, 1 minute.
967 967
  * @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
968 968
  * @param string|DateTimeZone $timezone Timezone string or DateTimeZone object
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
  *   CakeTime::format('2012-02-15 23:01:01', '%c', 'N/A', 'America/New_York'); // converts passed date to timezone
1020 1020
  * }}}
1021 1021
  *
1022
- * @param integer|string|DateTime $date UNIX timestamp, strtotime() valid string or DateTime object (or a date format string)
1022
+ * @param string $date UNIX timestamp, strtotime() valid string or DateTime object (or a date format string)
1023 1023
  * @param integer|string|DateTime $format date format string (or UNIX timestamp, strtotime() valid string or DateTime object)
1024 1024
  * @param boolean|string $default if an invalid date is passed it will output supplied default value. Pass false if you want raw conversion value
1025 1025
  * @param string|DateTimeZone $timezone Timezone string or DateTimeZone object
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#TimeHelper::convertSpecifiers
133 133
  */
134 134
 	public static function convertSpecifiers($format, $time = null) {
135
-		if (!$time) {
135
+		if ( ! $time) {
136 136
 			$time = time();
137 137
 		}
138 138
 		self::$_time = $time;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 				}
177 177
 				$day = date('j', self::$_time);
178 178
 				if ($day < 10) {
179
-					$day = ' ' . $day;
179
+					$day = ' '.$day;
180 180
 				}
181 181
 				return $day;
182 182
 			case 'eS' :
@@ -249,16 +249,16 @@  discard block
 block discarded – undo
249 249
 		if ($serverTimezone === null || (date_default_timezone_get() !== $serverTimezone->getName())) {
250 250
 			$serverTimezone = new DateTimeZone(date_default_timezone_get());
251 251
 		}
252
-		$serverOffset = $serverTimezone->getOffset(new DateTime('@' . $serverTime));
252
+		$serverOffset = $serverTimezone->getOffset(new DateTime('@'.$serverTime));
253 253
 		$gmtTime = $serverTime - $serverOffset;
254 254
 		if (is_numeric($timezone)) {
255 255
 			$userOffset = $timezone * (60 * 60);
256 256
 		} else {
257 257
 			$timezone = self::timezone($timezone);
258
-			$userOffset = $timezone->getOffset(new DateTime('@' . $gmtTime));
258
+			$userOffset = $timezone->getOffset(new DateTime('@'.$gmtTime));
259 259
 		}
260 260
 		$userTime = $gmtTime + $userOffset;
261
-		return (int)$userTime;
261
+		return (int) $userTime;
262 262
 	}
263 263
 
264 264
 /**
@@ -328,9 +328,9 @@  discard block
 block discarded – undo
328 328
 		) {
329 329
 			$clone = clone $dateString;
330 330
 			$clone->setTimezone(new DateTimeZone(date_default_timezone_get()));
331
-			$date = (int)$clone->format('U') + $clone->getOffset();
331
+			$date = (int) $clone->format('U') + $clone->getOffset();
332 332
 		} elseif ($dateString instanceof DateTime) {
333
-			$date = (int)$dateString->format('U');
333
+			$date = (int) $dateString->format('U');
334 334
 		} else {
335 335
 			$date = strtotime($dateString);
336 336
 		}
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#TimeHelper::nice
363 363
  */
364 364
 	public static function nice($dateString = null, $timezone = null, $format = null) {
365
-		if (!$dateString) {
365
+		if ( ! $dateString) {
366 366
 			$dateString = time();
367 367
 		}
368 368
 		$date = self::fromString($dateString, $timezone);
369 369
 
370
-		if (!$format) {
370
+		if ( ! $format) {
371 371
 			$format = self::$niceFormat;
372 372
 		}
373 373
 		return self::_strftime(self::convertSpecifiers($format, $date), $date);
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#TimeHelper::niceShort
390 390
  */
391 391
 	public static function niceShort($dateString = null, $timezone = null) {
392
-		if (!$dateString) {
392
+		if ( ! $dateString) {
393 393
 			$dateString = time();
394 394
 		}
395 395
 		$date = self::fromString($dateString, $timezone);
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 		}
423 423
 
424 424
 		$y = '';
425
-		if (!self::isThisYear($date)) {
425
+		if ( ! self::isThisYear($date)) {
426 426
 			$y = ' %Y';
427 427
 		}
428 428
 		return self::_strftime(self::convertSpecifiers("%b %eS{$y}, %H:%M", $date), $date);
@@ -441,8 +441,8 @@  discard block
 block discarded – undo
441 441
 	public static function daysAsSql($begin, $end, $fieldName, $timezone = null) {
442 442
 		$begin = self::fromString($begin, $timezone);
443 443
 		$end = self::fromString($end, $timezone);
444
-		$begin = date('Y-m-d', $begin) . ' 00:00:00';
445
-		$end = date('Y-m-d', $end) . ' 23:59:59';
444
+		$begin = date('Y-m-d', $begin).' 00:00:00';
445
+		$end = date('Y-m-d', $end).' 23:59:59';
446 446
 
447 447
 		return "($fieldName >= '$begin') AND ($fieldName <= '$end')";
448 448
 	}
@@ -589,13 +589,13 @@  discard block
 block discarded – undo
589 589
 		$year = date('Y', $time);
590 590
 		switch ($date) {
591 591
 			case 1:
592
-				return array($year . '-01-01', $year . '-03-31');
592
+				return array($year.'-01-01', $year.'-03-31');
593 593
 			case 2:
594
-				return array($year . '-04-01', $year . '-06-30');
594
+				return array($year.'-04-01', $year.'-06-30');
595 595
 			case 3:
596
-				return array($year . '-07-01', $year . '-09-30');
596
+				return array($year.'-07-01', $year.'-09-30');
597 597
 			case 4:
598
-				return array($year . '-10-01', $year . '-12-31');
598
+				return array($year.'-10-01', $year.'-12-31');
599 599
 		}
600 600
 	}
601 601
 
@@ -631,16 +631,16 @@  discard block
 block discarded – undo
631 631
 			$timezone = new DateTimeZone('UTC');
632 632
 		} elseif (is_string($timezone)) {
633 633
 			$timezone = new DateTimeZone($timezone);
634
-		} elseif (!($timezone instanceof DateTimeZone)) {
634
+		} elseif ( ! ($timezone instanceof DateTimeZone)) {
635 635
 			return false;
636 636
 		}
637 637
 
638 638
 		if ($dateString instanceof DateTime) {
639 639
 			$date = $dateString;
640 640
 		} elseif (is_int($dateString) || is_numeric($dateString)) {
641
-			$dateString = (int)$dateString;
641
+			$dateString = (int) $dateString;
642 642
 
643
-			$date = new DateTime('@' . $dateString);
643
+			$date = new DateTime('@'.$dateString);
644 644
 			$date->setTimezone($timezone);
645 645
 		} else {
646 646
 			$date = new DateTime($dateString, $timezone);
@@ -678,22 +678,22 @@  discard block
 block discarded – undo
678 678
 		}
679 679
 
680 680
 		$userOffset = $timezone;
681
-		if (!is_numeric($timezone)) {
682
-			if (!is_object($timezone)) {
681
+		if ( ! is_numeric($timezone)) {
682
+			if ( ! is_object($timezone)) {
683 683
 				$timezone = new DateTimeZone($timezone);
684 684
 			}
685
-			$currentDate = new DateTime('@' . $date);
685
+			$currentDate = new DateTime('@'.$date);
686 686
 			$currentDate->setTimezone($timezone);
687 687
 			$userOffset = $timezone->getOffset($currentDate) / 60 / 60;
688 688
 		}
689 689
 
690 690
 		$timezone = '+0000';
691 691
 		if ($userOffset != 0) {
692
-			$hours = (int)floor(abs($userOffset));
693
-			$minutes = (int)(fmod(abs($userOffset), $hours) * 60);
694
-			$timezone = ($userOffset < 0 ? '-' : '+') . str_pad($hours, 2, '0', STR_PAD_LEFT) . str_pad($minutes, 2, '0', STR_PAD_LEFT);
692
+			$hours = (int) floor(abs($userOffset));
693
+			$minutes = (int) (fmod(abs($userOffset), $hours) * 60);
694
+			$timezone = ($userOffset < 0 ? '-' : '+').str_pad($hours, 2, '0', STR_PAD_LEFT).str_pad($minutes, 2, '0', STR_PAD_LEFT);
695 695
 		}
696
-		return date('D, d M Y H:i:s', $date) . ' ' . $timezone;
696
+		return date('D, d M Y H:i:s', $date).' '.$timezone;
697 697
 	}
698 698
 
699 699
 /**
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 		}
792 792
 		$diff = $futureTime - $pastTime;
793 793
 
794
-		if (!$diff) {
794
+		if ( ! $diff) {
795 795
 			return __d('cake', 'just now', 'just now');
796 796
 		}
797 797
 
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 				$daysInPastMonth = date('t', $pastTime);
824 824
 				$daysInFutureMonth = date('t', mktime(0, 0, 0, $future['m'] - 1, 1, $future['Y']));
825 825
 
826
-				if (!$backwards) {
826
+				if ( ! $backwards) {
827 827
 					$days = ($daysInPastMonth - $past['d']) + $future['d'];
828 828
 				} else {
829 829
 					$days = ($daysInFutureMonth - $past['d']) + $future['d'];
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 				}
835 835
 			}
836 836
 
837
-			if (!$months && $years >= 1 && $diff < ($years * 31536000)) {
837
+			if ( ! $months && $years >= 1 && $diff < ($years * 31536000)) {
838 838
 				$months = 11;
839 839
 				$years--;
840 840
 			}
@@ -881,32 +881,32 @@  discard block
 block discarded – undo
881 881
 
882 882
 		$relativeDate = '';
883 883
 		if ($fNum >= 1 && $years > 0) {
884
-			$relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d year', '%d years', $years, $years);
884
+			$relativeDate .= ($relativeDate ? ', ' : '').__dn('cake', '%d year', '%d years', $years, $years);
885 885
 		}
886 886
 		if ($fNum >= 2 && $months > 0) {
887
-			$relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d month', '%d months', $months, $months);
887
+			$relativeDate .= ($relativeDate ? ', ' : '').__dn('cake', '%d month', '%d months', $months, $months);
888 888
 		}
889 889
 		if ($fNum >= 3 && $weeks > 0) {
890
-			$relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d week', '%d weeks', $weeks, $weeks);
890
+			$relativeDate .= ($relativeDate ? ', ' : '').__dn('cake', '%d week', '%d weeks', $weeks, $weeks);
891 891
 		}
892 892
 		if ($fNum >= 4 && $days > 0) {
893
-			$relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d day', '%d days', $days, $days);
893
+			$relativeDate .= ($relativeDate ? ', ' : '').__dn('cake', '%d day', '%d days', $days, $days);
894 894
 		}
895 895
 		if ($fNum >= 5 && $hours > 0) {
896
-			$relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d hour', '%d hours', $hours, $hours);
896
+			$relativeDate .= ($relativeDate ? ', ' : '').__dn('cake', '%d hour', '%d hours', $hours, $hours);
897 897
 		}
898 898
 		if ($fNum >= 6 && $minutes > 0) {
899
-			$relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d minute', '%d minutes', $minutes, $minutes);
899
+			$relativeDate .= ($relativeDate ? ', ' : '').__dn('cake', '%d minute', '%d minutes', $minutes, $minutes);
900 900
 		}
901 901
 		if ($fNum >= 7 && $seconds > 0) {
902
-			$relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d second', '%d seconds', $seconds, $seconds);
902
+			$relativeDate .= ($relativeDate ? ', ' : '').__dn('cake', '%d second', '%d seconds', $seconds, $seconds);
903 903
 		}
904 904
 
905 905
 		// When time has passed
906
-		if (!$backwards && $relativeDate) {
906
+		if ( ! $backwards && $relativeDate) {
907 907
 			return sprintf($relativeString, $relativeDate);
908 908
 		}
909
-		if (!$backwards) {
909
+		if ( ! $backwards) {
910 910
 			$aboutAgo = array(
911 911
 				'second' => __d('cake', 'about a second ago'),
912 912
 				'minute' => __d('cake', 'about a minute ago'),
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 		}
921 921
 
922 922
 		// When time is to come
923
-		if (!$relativeDate) {
923
+		if ( ! $relativeDate) {
924 924
 			$aboutIn = array(
925 925
 				'second' => __d('cake', 'in about a second'),
926 926
 				'minute' => __d('cake', 'in about a minute'),
@@ -949,11 +949,11 @@  discard block
 block discarded – undo
949 949
 	public static function wasWithinLast($timeInterval, $dateString, $timezone = null) {
950 950
 		$tmp = str_replace(' ', '', $timeInterval);
951 951
 		if (is_numeric($tmp)) {
952
-			$timeInterval = $tmp . ' ' . __d('cake', 'days');
952
+			$timeInterval = $tmp.' '.__d('cake', 'days');
953 953
 		}
954 954
 
955 955
 		$date = self::fromString($dateString, $timezone);
956
-		$interval = self::fromString('-' . $timeInterval);
956
+		$interval = self::fromString('-'.$timeInterval);
957 957
 		$now = self::fromString('now', $timezone);
958 958
 
959 959
 		return $date >= $interval && $date <= $now;
@@ -971,11 +971,11 @@  discard block
 block discarded – undo
971 971
 	public static function isWithinNext($timeInterval, $dateString, $timezone = null) {
972 972
 		$tmp = str_replace(' ', '', $timeInterval);
973 973
 		if (is_numeric($tmp)) {
974
-			$timeInterval = $tmp . ' ' . __d('cake', 'days');
974
+			$timeInterval = $tmp.' '.__d('cake', 'days');
975 975
 		}
976 976
 
977 977
 		$date = self::fromString($dateString, $timezone);
978
-		$interval = self::fromString('+' . $timeInterval);
978
+		$interval = self::fromString('+'.$timeInterval);
979 979
 		$now = self::fromString('now', $timezone);
980 980
 
981 981
 		return $date <= $interval && $date >= $now;
@@ -1091,7 +1091,7 @@  discard block
 block discarded – undo
1091 1091
 
1092 1092
 		if ($regex) {
1093 1093
 			foreach ($identifiers as $key => $tz) {
1094
-				if (!preg_match($regex, $tz)) {
1094
+				if ( ! preg_match($regex, $tz)) {
1095 1095
 					unset($identifiers[$key]);
1096 1096
 				}
1097 1097
 			}
@@ -1125,13 +1125,13 @@  discard block
 block discarded – undo
1125 1125
 		$format = strftime($format, $date);
1126 1126
 		$encoding = Configure::read('App.encoding');
1127 1127
 
1128
-		if (!empty($encoding) && $encoding === 'UTF-8') {
1128
+		if ( ! empty($encoding) && $encoding === 'UTF-8') {
1129 1129
 			if (function_exists('mb_check_encoding')) {
1130 1130
 				$valid = mb_check_encoding($format, $encoding);
1131 1131
 			} else {
1132
-				$valid = !Multibyte::checkMultibyte($format);
1132
+				$valid = ! Multibyte::checkMultibyte($format);
1133 1133
 			}
1134
-			if (!$valid) {
1134
+			if ( ! $valid) {
1135 1135
 				$format = utf8_encode($format);
1136 1136
 			}
1137 1137
 		}
Please login to merge, or discard this patch.
lib/Cake/Utility/File.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
  * @param string $bytes where to start
147 147
  * @param string $mode A `fread` compatible mode.
148 148
  * @param boolean $force If true then the file will be re-opened even if its already opened, otherwise it won't
149
- * @return mixed string on success, false on failure
149
+ * @return string|false string on success, false on failure
150 150
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::read
151 151
  */
152 152
 	public function read($bytes = false, $mode = 'rb', $force = false) {
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 /**
369 369
  * Get md5 Checksum of file with previous check of Filesize
370 370
  *
371
- * @param integer|boolean $maxsize in MB or true to force
371
+ * @param integer $maxsize in MB or true to force
372 372
  * @return string|false md5 Checksum {@link http://php.net/md5_file See md5_file()}, or false in case of an error
373 373
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::md5
374 374
  */
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
  */
86 86
 	public function __construct($path, $create = false, $mode = 0755) {
87 87
 		$this->Folder = new Folder(dirname($path), $create, $mode);
88
-		if (!is_dir($path)) {
88
+		if ( ! is_dir($path)) {
89 89
 			$this->name = basename($path);
90 90
 		}
91 91
 		$this->pwd();
92
-		$create && !$this->exists() && $this->safe($path) && $this->create();
92
+		$create && ! $this->exists() && $this->safe($path) && $this->create();
93 93
 	}
94 94
 
95 95
 /**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
  */
108 108
 	public function create() {
109 109
 		$dir = $this->Folder->pwd();
110
-		if (is_dir($dir) && is_writable($dir) && !$this->exists()) {
110
+		if (is_dir($dir) && is_writable($dir) && ! $this->exists()) {
111 111
 			if (touch($this->path)) {
112 112
 				return true;
113 113
 			}
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::open
125 125
  */
126 126
 	public function open($mode = 'r', $force = false) {
127
-		if (!$force && is_resource($this->handle)) {
127
+		if ( ! $force && is_resource($this->handle)) {
128 128
 			return true;
129 129
 		}
130 130
 		if ($this->exists() === false) {
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		}
165 165
 
166 166
 		$data = '';
167
-		while (!feof($this->handle)) {
167
+		while ( ! feof($this->handle)) {
168 168
 			$data .= fgets($this->handle, 4096);
169 169
 		}
170 170
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::close
262 262
  */
263 263
 	public function close() {
264
-		if (!is_resource($this->handle)) {
264
+		if ( ! is_resource($this->handle)) {
265 265
 			return true;
266 266
 		}
267 267
 		return fclose($this->handle);
@@ -298,16 +298,16 @@  discard block
 block discarded – undo
298 298
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::info
299 299
  */
300 300
 	public function info() {
301
-		if (!$this->info) {
301
+		if ( ! $this->info) {
302 302
 			$this->info = pathinfo($this->path);
303 303
 		}
304
-		if (!isset($this->info['filename'])) {
304
+		if ( ! isset($this->info['filename'])) {
305 305
 			$this->info['filename'] = $this->name();
306 306
 		}
307
-		if (!isset($this->info['filesize'])) {
307
+		if ( ! isset($this->info['filesize'])) {
308 308
 			$this->info['filesize'] = $this->size();
309 309
 		}
310
-		if (!isset($this->info['mime'])) {
310
+		if ( ! isset($this->info['mime'])) {
311 311
 			$this->info['mime'] = $this->mime();
312 312
 		}
313 313
 		return $this->info;
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::ext
321 321
  */
322 322
 	public function ext() {
323
-		if (!$this->info) {
323
+		if ( ! $this->info) {
324 324
 			$this->info();
325 325
 		}
326 326
 		if (isset($this->info['extension'])) {
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::name
337 337
  */
338 338
 	public function name() {
339
-		if (!$this->info) {
339
+		if ( ! $this->info) {
340 340
 			$this->info();
341 341
 		}
342 342
 		if (isset($this->info['extension'])) {
343
-			return basename($this->name, '.' . $this->info['extension']);
343
+			return basename($this->name, '.'.$this->info['extension']);
344 344
 		} elseif ($this->name) {
345 345
 			return $this->name;
346 346
 		}
@@ -356,10 +356,10 @@  discard block
 block discarded – undo
356 356
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::safe
357 357
  */
358 358
 	public function safe($name = null, $ext = null) {
359
-		if (!$name) {
359
+		if ( ! $name) {
360 360
 			$name = $this->name;
361 361
 		}
362
-		if (!$ext) {
362
+		if ( ! $ext) {
363 363
 			$ext = $this->ext();
364 364
 		}
365 365
 		return preg_replace("/(?:[^\w\.-]+)/", "_", basename($name, $ext));
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
  */
394 394
 	public function pwd() {
395 395
 		if ($this->path === null) {
396
-			$this->path = $this->Folder->slashTerm($this->Folder->pwd()) . $this->name;
396
+			$this->path = $this->Folder->slashTerm($this->Folder->pwd()).$this->name;
397 397
 		}
398 398
 		return $this->path;
399 399
 	}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::copy
537 537
  */
538 538
 	public function copy($dest, $overwrite = true) {
539
-		if (!$this->exists() || is_file($dest) && !$overwrite) {
539
+		if ( ! $this->exists() || is_file($dest) && ! $overwrite) {
540 540
 			return false;
541 541
 		}
542 542
 		return copy($this->path, $dest);
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
  * @return false|string The mimetype of the file, or false if reading fails.
550 550
  */
551 551
 	public function mime() {
552
-		if (!$this->exists()) {
552
+		if ( ! $this->exists()) {
553 553
 			return false;
554 554
 		}
555 555
 		if (function_exists('finfo_open')) {
556 556
 			$finfo = finfo_open(FILEINFO_MIME);
557 557
 			$finfo = finfo_file($finfo, $this->pwd());
558
-			if (!$finfo) {
558
+			if ( ! $finfo) {
559 559
 				return false;
560 560
 			}
561 561
 			list($type) = explode(';', $finfo);
Please login to merge, or discard this patch.
lib/Cake/Utility/Folder.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
  * @param string $path The path to chmod
370 370
  * @param integer $mode octal value 0755
371 371
  * @param boolean $recursive chmod recursively, set to false to only change the current directory.
372
- * @param array $exceptions array of files, directories to skip
372
+ * @param string[] $exceptions array of files, directories to skip
373 373
  * @return boolean Returns TRUE on success, FALSE on failure
374 374
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::chmod
375 375
  */
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
  * Recursively Remove directories if the system allows.
566 566
  *
567 567
  * @param string $path Path of directory to delete
568
- * @return boolean Success
568
+ * @return null|boolean Success
569 569
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::delete
570 570
  */
571 571
 	public function delete($path = null) {
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
 			$this->mode = $mode;
116 116
 		}
117 117
 
118
-		if (!file_exists($path) && $create === true) {
118
+		if ( ! file_exists($path) && $create === true) {
119 119
 			$this->create($path, $this->mode);
120 120
 		}
121
-		if (!Folder::isAbsolute($path)) {
121
+		if ( ! Folder::isAbsolute($path)) {
122 122
 			$path = realpath($path);
123 123
 		}
124
-		if (!empty($path)) {
124
+		if ( ! empty($path)) {
125 125
 			$this->cd($path);
126 126
 		}
127 127
 	}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	public function read($sort = true, $exceptions = false, $fullPath = false) {
166 166
 		$dirs = $files = array();
167 167
 
168
-		if (!$this->pwd()) {
168
+		if ( ! $this->pwd()) {
169 169
 			return array($dirs, $files);
170 170
 		}
171 171
 		if (is_array($exceptions)) {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
  */
214 214
 	public function find($regexpPattern = '.*', $sort = false) {
215 215
 		list(, $files) = $this->read($sort);
216
-		return array_values(preg_grep('/^' . $regexpPattern . '$/i', $files));
216
+		return array_values(preg_grep('/^'.$regexpPattern.'$/i', $files));
217 217
 	}
218 218
 
219 219
 /**
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::findRecursive
226 226
  */
227 227
 	public function findRecursive($pattern = '.*', $sort = false) {
228
-		if (!$this->pwd()) {
228
+		if ( ! $this->pwd()) {
229 229
 			return array();
230 230
 		}
231 231
 		$startsOn = $this->path;
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 		$found = array();
247 247
 
248 248
 		foreach ($files as $file) {
249
-			if (preg_match('/^' . $pattern . '$/i', $file)) {
249
+			if (preg_match('/^'.$pattern.'$/i', $file)) {
250 250
 				$found[] = Folder::addPathElement($this->path, $file);
251 251
 			}
252 252
 		}
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::isAbsolute
279 279
  */
280 280
 	public static function isAbsolute($path) {
281
-		return !empty($path) && ($path[0] === '/' || preg_match('/^[A-Z]:\\\\/i', $path) || substr($path, 0, 2) === '\\\\');
281
+		return ! empty($path) && ($path[0] === '/' || preg_match('/^[A-Z]:\\\\/i', $path) || substr($path, 0, 2) === '\\\\');
282 282
 	}
283 283
 
284 284
 /**
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		if (Folder::isSlashTerm($path)) {
315 315
 			return $path;
316 316
 		}
317
-		return $path . Folder::correctSlashFor($path);
317
+		return $path.Folder::correctSlashFor($path);
318 318
 	}
319 319
 
320 320
 /**
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::addPathElement
327 327
  */
328 328
 	public static function addPathElement($path, $element) {
329
-		return rtrim($path, DS) . DS . $element;
329
+		return rtrim($path, DS).DS.$element;
330 330
 	}
331 331
 
332 332
 /**
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
  */
339 339
 	public function inCakePath($path = '') {
340 340
 		$dir = substr(Folder::slashTerm(ROOT), 0, -1);
341
-		$newdir = $dir . $path;
341
+		$newdir = $dir.$path;
342 342
 
343 343
 		return $this->inPath($newdir);
344 344
 	}
@@ -355,12 +355,12 @@  discard block
 block discarded – undo
355 355
 		$dir = Folder::slashTerm($path);
356 356
 		$current = Folder::slashTerm($this->pwd());
357 357
 
358
-		if (!$reverse) {
359
-			$return = preg_match('/^(.*)' . preg_quote($dir, '/') . '(.*)/', $current);
358
+		if ( ! $reverse) {
359
+			$return = preg_match('/^(.*)'.preg_quote($dir, '/').'(.*)/', $current);
360 360
 		} else {
361
-			$return = preg_match('/^(.*)' . preg_quote($current, '/') . '(.*)/', $dir);
361
+			$return = preg_match('/^(.*)'.preg_quote($current, '/').'(.*)/', $dir);
362 362
 		}
363
-		return (bool)$return;
363
+		return (bool) $return;
364 364
 	}
365 365
 
366 366
 /**
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::chmod
375 375
  */
376 376
 	public function chmod($path, $mode = false, $recursive = true, $exceptions = array()) {
377
-		if (!$mode) {
377
+		if ( ! $mode) {
378 378
 			$mode = $this->mode;
379 379
 		}
380 380
 
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::tree
431 431
  */
432 432
 	public function tree($path = null, $exceptions = false, $type = null) {
433
-		if (!$path) {
433
+		if ( ! $path) {
434 434
 			$path = $this->path;
435 435
 		}
436 436
 		$files = array();
@@ -460,18 +460,18 @@  discard block
 block discarded – undo
460 460
 		foreach ($iterator as $itemPath => $fsIterator) {
461 461
 			if ($skipHidden) {
462 462
 				$subPathName = $fsIterator->getSubPathname();
463
-				if ($subPathName{0} === '.' || strpos($subPathName, DS . '.') !== false) {
463
+				if ($subPathName{0} === '.' || strpos($subPathName, DS.'.') !== false) {
464 464
 					continue;
465 465
 				}
466 466
 			}
467 467
 			$item = $fsIterator->current();
468
-			if (!empty($exceptions) && isset($exceptions[$item->getFilename()])) {
468
+			if ( ! empty($exceptions) && isset($exceptions[$item->getFilename()])) {
469 469
 				continue;
470 470
 			}
471 471
 
472 472
 			if ($item->isFile()) {
473 473
 				$files[] = $itemPath;
474
-			} elseif ($item->isDir() && !$item->isDot()) {
474
+			} elseif ($item->isDir() && ! $item->isDot()) {
475 475
 				$directories[] = $itemPath;
476 476
 			}
477 477
 		}
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 			return true;
499 499
 		}
500 500
 
501
-		if (!$mode) {
501
+		if ( ! $mode) {
502 502
 			$mode = $this->mode;
503 503
 		}
504 504
 
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 		$nextPathname = substr($pathname, 0, strrpos($pathname, DS));
511 511
 
512 512
 		if ($this->create($nextPathname, $mode)) {
513
-			if (!file_exists($pathname)) {
513
+			if ( ! file_exists($pathname)) {
514 514
 				$old = umask(0);
515 515
 				if (mkdir($pathname, $mode)) {
516 516
 					umask($old);
@@ -546,9 +546,9 @@  discard block
 block discarded – undo
546 546
 						if ($entry === '.' || $entry === '..') {
547 547
 							continue;
548 548
 						}
549
-						$add = $stack[$i] . $entry;
549
+						$add = $stack[$i].$entry;
550 550
 
551
-						if (is_dir($stack[$i] . $entry)) {
551
+						if (is_dir($stack[$i].$entry)) {
552 552
 							$add = Folder::slashTerm($add);
553 553
 						}
554 554
 						$stack[] = $add;
@@ -569,10 +569,10 @@  discard block
 block discarded – undo
569 569
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::delete
570 570
  */
571 571
 	public function delete($path = null) {
572
-		if (!$path) {
572
+		if ( ! $path) {
573 573
 			$path = $this->pwd();
574 574
 		}
575
-		if (!$path) {
575
+		if ( ! $path) {
576 576
 			return null;
577 577
 		}
578 578
 		$path = Folder::slashTerm($path);
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 					} else {
595 595
 						$this->_errors[] = __d('cake_dev', '%s NOT removed', $filePath);
596 596
 					}
597
-				} elseif ($item->isDir() && !$item->isDot()) {
597
+				} elseif ($item->isDir() && ! $item->isDot()) {
598 598
 					//@codingStandardsIgnoreStart
599 599
 					if (@rmdir($filePath)) {
600 600
 						//@codingStandardsIgnoreEnd
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::copy
636 636
  */
637 637
 	public function copy($options) {
638
-		if (!$this->pwd()) {
638
+		if ( ! $this->pwd()) {
639 639
 			return false;
640 640
 		}
641 641
 		$to = null;
@@ -649,16 +649,16 @@  discard block
 block discarded – undo
649 649
 		$toDir = $options['to'];
650 650
 		$mode = $options['mode'];
651 651
 
652
-		if (!$this->cd($fromDir)) {
652
+		if ( ! $this->cd($fromDir)) {
653 653
 			$this->_errors[] = __d('cake_dev', '%s not found', $fromDir);
654 654
 			return false;
655 655
 		}
656 656
 
657
-		if (!is_dir($toDir)) {
657
+		if ( ! is_dir($toDir)) {
658 658
 			$this->create($toDir, $mode);
659 659
 		}
660 660
 
661
-		if (!is_writable($toDir)) {
661
+		if ( ! is_writable($toDir)) {
662 662
 			$this->_errors[] = __d('cake_dev', '%s not writable', $toDir);
663 663
 			return false;
664 664
 		}
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
 			//@codingStandardsIgnoreEnd
670 670
 			while (($item = readdir($handle)) !== false) {
671 671
 				$to = Folder::addPathElement($toDir, $item);
672
-				if (($options['scheme'] != Folder::SKIP || !is_dir($to)) && !in_array($item, $exceptions)) {
672
+				if (($options['scheme'] != Folder::SKIP || ! is_dir($to)) && ! in_array($item, $exceptions)) {
673 673
 					$from = Folder::addPathElement($fromDir, $item);
674 674
 					if (is_file($from)) {
675 675
 						if (copy($from, $to)) {
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 						$this->delete($to);
686 686
 					}
687 687
 
688
-					if (is_dir($from) && !file_exists($to)) {
688
+					if (is_dir($from) && ! file_exists($to)) {
689 689
 						$old = umask(0);
690 690
 						if (mkdir($to, $mode)) {
691 691
 							umask($old);
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 			return false;
710 710
 		}
711 711
 
712
-		if (!empty($this->_errors)) {
712
+		if ( ! empty($this->_errors)) {
713 713
 			return false;
714 714
 		}
715 715
 		return true;
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 		$to = null;
735 735
 		if (is_string($options)) {
736 736
 			$to = $options;
737
-			$options = (array)$options;
737
+			$options = (array) $options;
738 738
 		}
739 739
 		$options = array_merge(
740 740
 			array('to' => $to, 'from' => $this->path, 'mode' => $this->mode, 'skip' => array()),
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 
744 744
 		if ($this->copy($options)) {
745 745
 			if ($this->delete($options['from'])) {
746
-				return (bool)$this->cd($options['to']);
746
+				return (bool) $this->cd($options['to']);
747 747
 			}
748 748
 		}
749 749
 		return false;
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 	public function realpath($path) {
790 790
 		$path = str_replace('/', DS, trim($path));
791 791
 		if (strpos($path, '..') === false) {
792
-			if (!Folder::isAbsolute($path)) {
792
+			if ( ! Folder::isAbsolute($path)) {
793 793
 				$path = Folder::addPathElement($this->path, $path);
794 794
 			}
795 795
 			return $path;
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 				continue;
807 807
 			}
808 808
 			if ($part === '..') {
809
-				if (!empty($newparts)) {
809
+				if ( ! empty($newparts)) {
810 810
 					array_pop($newparts);
811 811
 					continue;
812 812
 				}
Please login to merge, or discard this patch.
lib/Cake/Utility/Hash.php 2 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -630,7 +630,6 @@  discard block
 block discarded – undo
630 630
 /**
631 631
  * Checks to see if all the values in the array are numeric
632 632
  *
633
- * @param array $array The array to check.
634 633
  * @return boolean true if values are numeric, false otherwise
635 634
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::numeric
636 635
  */
@@ -648,7 +647,6 @@  discard block
 block discarded – undo
648 647
  * If you have an un-even or heterogenous array, consider using Hash::maxDimensions()
649 648
  * to get the dimensions of the array.
650 649
  *
651
- * @param array $array Array to count dimensions on
652 650
  * @return integer The number of dimensions in $data
653 651
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::dimensions
654 652
  */
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		}
52 52
 		foreach ($parts as $key) {
53 53
 			if (is_array($data) && isset($data[$key])) {
54
-				$data =& $data[$key];
54
+				$data = & $data[$key];
55 55
 			} else {
56 56
 				return null;
57 57
 			}
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 		}
95 95
 
96 96
 		// Simple paths.
97
-		if (!preg_match('/[{\[]/', $path)) {
98
-			return (array)self::get($data, $path);
97
+		if ( ! preg_match('/[{\[]/', $path)) {
98
+			return (array) self::get($data, $path);
99 99
 		}
100 100
 
101 101
 		if (strpos($path, '[') === false) {
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			}
120 120
 
121 121
 			foreach ($context[$_key] as $item) {
122
-				foreach ((array)$item as $k => $v) {
122
+				foreach ((array) $item as $k => $v) {
123 123
 					if (self::_matchToken($k, $token)) {
124 124
 						$next[] = $v;
125 125
 					}
@@ -183,12 +183,12 @@  discard block
 block discarded – undo
183 183
 			$val = isset($cond['val']) ? $cond['val'] : null;
184 184
 
185 185
 			// Presence test.
186
-			if (empty($op) && empty($val) && !isset($data[$attr])) {
186
+			if (empty($op) && empty($val) && ! isset($data[$attr])) {
187 187
 				return false;
188 188
 			}
189 189
 
190 190
 			// Empty attribute = fail.
191
-			if (!(isset($data[$attr]) || array_key_exists($attr, $data))) {
191
+			if ( ! (isset($data[$attr]) || array_key_exists($attr, $data))) {
192 192
 				return false;
193 193
 			}
194 194
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
 			// Pattern matches and other operators.
204 204
 			if ($op === '=' && $val && $val[0] === '/') {
205
-				if (!preg_match($val, $prop)) {
205
+				if ( ! preg_match($val, $prop)) {
206 206
 					return false;
207 207
 				}
208 208
 			} elseif (
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
  * @return array $data.
257 257
  */
258 258
 	protected static function _simpleOp($op, $data, $path, $values = null) {
259
-		$_list =& $data;
259
+		$_list = & $data;
260 260
 
261 261
 		$count = count($path);
262 262
 		$last = $count - 1;
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 					$_list[$key] = $values;
270 270
 					return $data;
271 271
 				}
272
-				if (!isset($_list[$key])) {
272
+				if ( ! isset($_list[$key])) {
273 273
 					$_list[$key] = array();
274 274
 				}
275
-				$_list =& $_list[$key];
276
-				if (!is_array($_list)) {
275
+				$_list = & $_list[$key];
276
+				if ( ! is_array($_list)) {
277 277
 					$_list = array();
278 278
 				}
279 279
 			} elseif ($op === 'remove') {
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
 					unset($_list[$key]);
282 282
 					return $data;
283 283
 				}
284
-				if (!isset($_list[$key])) {
284
+				if ( ! isset($_list[$key])) {
285 285
 					return $data;
286 286
 				}
287
-				$_list =& $_list[$key];
287
+				$_list = & $_list[$key];
288 288
 			}
289 289
 		}
290 290
 	}
@@ -347,10 +347,10 @@  discard block
 block discarded – undo
347 347
 			return array();
348 348
 		}
349 349
 
350
-		if (!empty($valuePath) && is_array($valuePath)) {
350
+		if ( ! empty($valuePath) && is_array($valuePath)) {
351 351
 			$format = array_shift($valuePath);
352 352
 			$vals = self::format($data, $valuePath, $format);
353
-		} elseif (!empty($valuePath)) {
353
+		} elseif ( ! empty($valuePath)) {
354 354
 			$vals = self::extract($data, $valuePath);
355 355
 		}
356 356
 		if (empty($vals)) {
@@ -366,13 +366,13 @@  discard block
 block discarded – undo
366 366
 
367 367
 		if ($groupPath !== null) {
368 368
 			$group = self::extract($data, $groupPath);
369
-			if (!empty($group)) {
369
+			if ( ! empty($group)) {
370 370
 				$c = count($keys);
371 371
 				for ($i = 0; $i < $c; $i++) {
372
-					if (!isset($group[$i])) {
372
+					if ( ! isset($group[$i])) {
373 373
 						$group[$i] = 0;
374 374
 					}
375
-					if (!isset($out[$group[$i]])) {
375
+					if ( ! isset($out[$group[$i]])) {
376 376
 						$out[$group[$i]] = array();
377 377
 					}
378 378
 					$out[$group[$i]][$keys[$i]] = $vals[$i];
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 		$extracted = array();
412 412
 		$count = count($paths);
413 413
 
414
-		if (!$count) {
414
+		if ( ! $count) {
415 415
 			return;
416 416
 		}
417 417
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 		}
450 450
 		$stack = array();
451 451
 
452
-		while (!empty($needle)) {
452
+		while ( ! empty($needle)) {
453 453
 			$key = key($needle);
454 454
 			$val = $needle[$key];
455 455
 			unset($needle[$key]);
@@ -458,14 +458,14 @@  discard block
 block discarded – undo
458 458
 				$next = $data[$key];
459 459
 				unset($data[$key]);
460 460
 
461
-				if (!empty($val)) {
461
+				if ( ! empty($val)) {
462 462
 					$stack[] = array($val, $next);
463 463
 				}
464
-			} elseif (!array_key_exists($key, $data) || $data[$key] != $val) {
464
+			} elseif ( ! array_key_exists($key, $data) || $data[$key] != $val) {
465 465
 				return false;
466 466
 			}
467 467
 
468
-			if (empty($needle) && !empty($stack)) {
468
+			if (empty($needle) && ! empty($stack)) {
469 469
 				list($needle, $data) = array_pop($stack);
470 470
 			}
471 471
 		}
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
  */
488 488
 	public static function check(array $data, $path) {
489 489
 		$results = self::extract($data, $path);
490
-		if (!is_array($results)) {
490
+		if ( ! is_array($results)) {
491 491
 			return false;
492 492
 		}
493 493
 		return count($results) > 0;
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
  * @return boolean
519 519
  */
520 520
 	protected static function _filter($var) {
521
-		if ($var === 0 || $var === '0' || !empty($var)) {
521
+		if ($var === 0 || $var === '0' || ! empty($var)) {
522 522
 			return true;
523 523
 		}
524 524
 		return false;
@@ -540,23 +540,23 @@  discard block
 block discarded – undo
540 540
 		$path = null;
541 541
 
542 542
 		reset($data);
543
-		while (!empty($data)) {
543
+		while ( ! empty($data)) {
544 544
 			$key = key($data);
545 545
 			$element = $data[$key];
546 546
 			unset($data[$key]);
547 547
 
548
-			if (is_array($element) && !empty($element)) {
549
-				if (!empty($data)) {
548
+			if (is_array($element) && ! empty($element)) {
549
+				if ( ! empty($data)) {
550 550
 					$stack[] = array($data, $path);
551 551
 				}
552 552
 				$data = $element;
553 553
 				reset($data);
554
-				$path .= $key . $separator;
554
+				$path .= $key.$separator;
555 555
 			} else {
556
-				$result[$path . $key] = $element;
556
+				$result[$path.$key] = $element;
557 557
 			}
558 558
 
559
-			if (empty($data) && !empty($stack)) {
559
+			if (empty($data) && ! empty($stack)) {
560 560
 				list($data, $path) = array_pop($stack);
561 561
 				reset($data);
562 562
 			}
@@ -614,8 +614,8 @@  discard block
 block discarded – undo
614 614
 		$return = current($args);
615 615
 
616 616
 		while (($arg = next($args)) !== false) {
617
-			foreach ((array)$arg as $key => $val) {
618
-				if (!empty($return[$key]) && is_array($return[$key]) && is_array($val)) {
617
+			foreach ((array) $arg as $key => $val) {
618
+				if ( ! empty($return[$key]) && is_array($return[$key]) && is_array($val)) {
619 619
 					$return[$key] = self::merge($return[$key], $val);
620 620
 				} elseif (is_int($key) && isset($return[$key])) {
621 621
 					$return[] = $val;
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 		while ($elem = array_shift($data)) {
662 662
 			if (is_array($elem)) {
663 663
 				$depth += 1;
664
-				$data =& $elem;
664
+				$data = & $elem;
665 665
 			} else {
666 666
 				break;
667 667
 			}
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 		$depth = array();
682 682
 		if (is_array($data) && reset($data) !== false) {
683 683
 			foreach ($data as $value) {
684
-				$depth[] = self::dimensions((array)$value) + 1;
684
+				$depth[] = self::dimensions((array) $value) + 1;
685 685
 			}
686 686
 		}
687 687
 		return max($depth);
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::map
699 699
  */
700 700
 	public static function map(array $data, $path, $function) {
701
-		$values = (array)self::extract($data, $path);
701
+		$values = (array) self::extract($data, $path);
702 702
 		return array_map($function, $values);
703 703
 	}
704 704
 
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::reduce
713 713
  */
714 714
 	public static function reduce(array $data, $path, $function) {
715
-		$values = (array)self::extract($data, $path);
715
+		$values = (array) self::extract($data, $path);
716 716
 		return array_reduce($values, $function);
717 717
 	}
718 718
 
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
  * @return mixed The results of the applied method.
738 738
  */
739 739
 	public static function apply(array $data, $path, $function) {
740
-		$values = (array)self::extract($data, $path);
740
+		$values = (array) self::extract($data, $path);
741 741
 		return call_user_func($function, $values);
742 742
 	}
743 743
 
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 			if ($key !== null) {
839 839
 				$id = $key;
840 840
 			}
841
-			if (is_array($r) && !empty($r)) {
841
+			if (is_array($r) && ! empty($r)) {
842 842
 				$stack = array_merge($stack, self::_squash($r, $id));
843 843
 			} else {
844 844
 				$stack[] = array('id' => $id, 'value' => $r);
@@ -860,10 +860,10 @@  discard block
 block discarded – undo
860 860
  */
861 861
 	public static function diff(array $data, $compare) {
862 862
 		if (empty($data)) {
863
-			return (array)$compare;
863
+			return (array) $compare;
864 864
 		}
865 865
 		if (empty($compare)) {
866
-			return (array)$data;
866
+			return (array) $data;
867 867
 		}
868 868
 		$intersection = array_intersect_key($data, $compare);
869 869
 		while (($key = key($intersection)) !== null) {
@@ -885,14 +885,14 @@  discard block
 block discarded – undo
885 885
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::mergeDiff
886 886
  */
887 887
 	public static function mergeDiff(array $data, $compare) {
888
-		if (empty($data) && !empty($compare)) {
888
+		if (empty($data) && ! empty($compare)) {
889 889
 			return $compare;
890 890
 		}
891 891
 		if (empty($compare)) {
892 892
 			return $data;
893 893
 		}
894 894
 		foreach ($compare as $key => $value) {
895
-			if (!array_key_exists($key, $data)) {
895
+			if ( ! array_key_exists($key, $data)) {
896 896
 				$data[$key] = $value;
897 897
 			} elseif (is_array($value)) {
898 898
 				$data[$key] = self::mergeDiff($data[$key], $compare[$key]);
@@ -914,15 +914,15 @@  discard block
 block discarded – undo
914 914
 		$count = count($keys);
915 915
 		$numeric = true;
916 916
 
917
-		if (!$assoc) {
917
+		if ( ! $assoc) {
918 918
 			for ($i = 0; $i < $count; $i++) {
919
-				if (!is_int($keys[$i])) {
919
+				if ( ! is_int($keys[$i])) {
920 920
 					$numeric = false;
921 921
 					break;
922 922
 				}
923 923
 			}
924 924
 		}
925
-		if (!$numeric || $assoc) {
925
+		if ( ! $numeric || $assoc) {
926 926
 			$newList = array();
927 927
 			for ($i = 0; $i < $count; $i++) {
928 928
 				if (is_int($keys[$i])) {
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
  * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::nest
956 956
  */
957 957
 	public static function nest(array $data, $options = array()) {
958
-		if (!$data) {
958
+		if ( ! $data) {
959 959
 			return $data;
960 960
 		}
961 961
 
@@ -983,14 +983,14 @@  discard block
 block discarded – undo
983 983
 			$parentId = self::get($result, $parentKeys);
984 984
 
985 985
 			if (isset($idMap[$id][$options['children']])) {
986
-				$idMap[$id] = array_merge($result, (array)$idMap[$id]);
986
+				$idMap[$id] = array_merge($result, (array) $idMap[$id]);
987 987
 			} else {
988 988
 				$idMap[$id] = array_merge($result, array($options['children'] => array()));
989 989
 			}
990
-			if (!$parentId || !in_array($parentId, $ids)) {
991
-				$return[] =& $idMap[$id];
990
+			if ( ! $parentId || ! in_array($parentId, $ids)) {
991
+				$return[] = & $idMap[$id];
992 992
 			} else {
993
-				$idMap[$parentId][$options['children']][] =& $idMap[$id];
993
+				$idMap[$parentId][$options['children']][] = & $idMap[$id];
994 994
 			}
995 995
 		}
996 996
 
Please login to merge, or discard this patch.