Skip to content
This repository
Browse code

Fix most of the coding standards issues in Console/

  • Loading branch information...
commit db8c6b5c788893de6704907228e3714c5baf3ffd 1 parent 2a7bee0
Mark Story authored March 03, 2012

Showing 36 changed files with 146 additions and 158 deletions. Show diff stats Hide diff stats

  1. 15  lib/Cake/Console/Command/AclShell.php
  2. 21  lib/Cake/Console/Command/ApiShell.php
  3. 6  lib/Cake/Console/Command/BakeShell.php
  4. 7  lib/Cake/Console/Command/CommandListShell.php
  5. 7  lib/Cake/Console/Command/ConsoleShell.php
  6. 1  lib/Cake/Console/Command/I18nShell.php
  7. 9  lib/Cake/Console/Command/SchemaShell.php
  8. 53  lib/Cake/Console/Command/Task/ControllerTask.php
  9. 3  lib/Cake/Console/Command/Task/DbConfigTask.php
  10. 9  lib/Cake/Console/Command/Task/ExtractTask.php
  11. 4  lib/Cake/Console/Command/Task/FixtureTask.php
  12. 30  lib/Cake/Console/Command/Task/ModelTask.php
  13. 5  lib/Cake/Console/Command/Task/PluginTask.php
  14. 9  lib/Cake/Console/Command/Task/ProjectTask.php
  15. 5  lib/Cake/Console/Command/Task/TemplateTask.php
  16. 12  lib/Cake/Console/Command/Task/TestTask.php
  17. 5  lib/Cake/Console/Command/Task/ViewTask.php
  18. 6  lib/Cake/Console/Command/TestShell.php
  19. 1  lib/Cake/Console/Command/TestsuiteShell.php
  20. 13  lib/Cake/Console/Command/UpgradeShell.php
  21. 4  lib/Cake/Console/ConsoleInput.php
  22. 4  lib/Cake/Console/ConsoleInputArgument.php
  23. 4  lib/Cake/Console/ConsoleInputOption.php
  24. 1  lib/Cake/Console/ConsoleInputSubcommand.php
  25. 2  lib/Cake/Console/ConsoleOptionParser.php
  26. 1  lib/Cake/Console/ConsoleOutput.php
  27. 2  lib/Cake/Console/HelpFormatter.php
  28. 3  lib/Cake/Console/Shell.php
  29. 1  lib/Cake/Console/ShellDispatcher.php
  30. 1  lib/Cake/Console/TaskCollection.php
  31. 22  lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php
  32. 16  lib/Cake/Console/Templates/skel/Config/Schema/i18n.php
  33. 10  lib/Cake/Console/Templates/skel/Config/Schema/sessions.php
  34. 2  lib/Cake/Console/Templates/skel/Console/cake.php
  35. 8  lib/Cake/Console/Templates/skel/Controller/PagesController.php
  36. 2  lib/Cake/Console/cake.php
15  lib/Cake/Console/Command/AclShell.php
@@ -200,7 +200,7 @@ public function getPath() {
200 200
 		}
201 201
 		$this->out(__d('cake_console', 'Path:'));
202 202
 		$this->hr();
203  
-		for ($i = 0; $i < count($nodes); $i++) {
  203
+		for ($i = 0, $len = count($nodes); $i < $len; $i++) {
204 204
 			$this->_outputNode($class, $nodes[$i], $i);
205 205
 		}
206 206
 	}
@@ -218,7 +218,7 @@ protected function _outputNode($class, $node, $indent) {
218 218
 		$data = $node[$class];
219 219
 		if ($data['alias']) {
220 220
 			$this->out($indent . "[" . $data['id'] . "] " . $data['alias']);
221  
-		 } else {
  221
+		} else {
222 222
 			$this->out($indent . "[" . $data['id'] . "] " . $data['model'] . '.' . $data['foreign_key']);
223 223
 		}
224 224
 	}
@@ -366,8 +366,9 @@ public function getOptionParser() {
366 366
 			'help' => __d('cake_console', 'Type of node to create.')
367 367
 		);
368 368
 
369  
-		$parser->description(__d('cake_console', 'A console tool for managing the DbAcl'))
370  
-			->addSubcommand('create', array(
  369
+		$parser->description(
  370
+			__d('cake_console', 'A console tool for managing the DbAcl')
  371
+			)->addSubcommand('create', array(
371 372
 				'help' => __d('cake_console', 'Create a new ACL node'),
372 373
 				'parser' => array(
373 374
 					'description' => __d('cake_console', 'Creates a new ACL object <node> under the parent'),
@@ -514,8 +515,9 @@ public function nodeExists() {
514 515
 		if (!isset($this->args[0]) || !isset($this->args[1])) {
515 516
 			return false;
516 517
 		}
517  
-		extract($this->_dataVars($this->args[0]));
518  
-		$key = is_numeric($this->args[1]) ? $secondary_id : 'alias';
  518
+		$dataVars = $this->_dataVars($this->args[0]);
  519
+		extract($dataVars);
  520
+		$key = is_numeric($this->args[1]) ? $dataVars['secondary_id'] : 'alias';
519 521
 		$conditions = array($class . '.' . $key => $this->args[1]);
520 522
 		$possibility = $this->Acl->{$class}->find('all', compact('conditions'));
521 523
 		if (empty($possibility)) {
@@ -602,4 +604,5 @@ protected function _dataVars($type = null) {
602 604
 		$vars['class'] = $class;
603 605
 		return $vars;
604 606
 	}
  607
+
605 608
 }
21  lib/Cake/Console/Command/ApiShell.php
@@ -92,7 +92,7 @@ public function main() {
92 92
 			$this->error(__d('cake_console', '%s not found', $class));
93 93
 		}
94 94
 
95  
-		$parsed = $this->_parseClass($path . $class .'.php', $class);
  95
+		$parsed = $this->_parseClass($path . $class . '.php', $class);
96 96
 
97 97
 		if (!empty($parsed)) {
98 98
 			if (isset($this->params['method'])) {
@@ -166,14 +166,14 @@ public function help() {
166 166
 
167 167
 		$commands = array(
168 168
 			'path' => "\t<type>\n" .
169  
-				"\t\tEither a full path or type of class (model, behavior, controller, component, view, helper).\n".
170  
-				"\t\tAvailable values:\n\n".
171  
-				"\t\tbehavior\tLook for class in CakePHP behavior path\n".
172  
-				"\t\tcache\tLook for class in CakePHP cache path\n".
173  
-				"\t\tcontroller\tLook for class in CakePHP controller path\n".
174  
-				"\t\tcomponent\tLook for class in CakePHP component path\n".
175  
-				"\t\thelper\tLook for class in CakePHP helper path\n".
176  
-				"\t\tmodel\tLook for class in CakePHP model path\n".
  169
+				"\t\tEither a full path or type of class (model, behavior, controller, component, view, helper).\n" .
  170
+				"\t\tAvailable values:\n\n" .
  171
+				"\t\tbehavior\tLook for class in CakePHP behavior path\n" .
  172
+				"\t\tcache\tLook for class in CakePHP cache path\n" .
  173
+				"\t\tcontroller\tLook for class in CakePHP controller path\n" .
  174
+				"\t\tcomponent\tLook for class in CakePHP component path\n" .
  175
+				"\t\thelper\tLook for class in CakePHP helper path\n" .
  176
+				"\t\tmodel\tLook for class in CakePHP model path\n" .
177 177
 				"\t\tview\tLook for class in CakePHP view path\n",
178 178
 			'className' => "\t<className>\n" .
179 179
 				"\t\tA CakePHP core class name (e.g: Component, HtmlHelper).\n"
@@ -203,7 +203,7 @@ protected function _parseClass($path, $class) {
203 203
 		$parsed = array();
204 204
 
205 205
 		if (!class_exists($class)) {
206  
-			if (!include_once($path)) {
  206
+			if (!include_once $path) {
207 207
 				$this->err(__d('cake_console', '%s could not be found', $path));
208 208
 			}
209 209
 		}
@@ -234,4 +234,5 @@ protected function _parseClass($path, $class) {
234 234
 		ksort($parsed);
235 235
 		return $parsed;
236 236
 	}
  237
+
237 238
 }
6  lib/Cake/Console/Command/BakeShell.php
@@ -209,9 +209,9 @@ public function all() {
209 209
 	public function getOptionParser() {
210 210
 		$parser = parent::getOptionParser();
211 211
 		return $parser->description(__d('cake_console',
212  
-			'The Bake script generates controllers, views and models for your application.'
213  
-			. ' If run with no command line arguments, Bake guides the user through the class creation process.'
214  
-			. ' You can customize the generation process by telling Bake where different parts of your application are using command line arguments.'
  212
+			'The Bake script generates controllers, views and models for your application.' .
  213
+			' If run with no command line arguments, Bake guides the user through the class creation process.' .
  214
+			' You can customize the generation process by telling Bake where different parts of your application are using command line arguments.'
215 215
 		))->addSubcommand('all', array(
216 216
 			'help' => __d('cake_console', 'Bake a complete MVC. optional <name> of a Model'),
217 217
 		))->addSubcommand('project', array(
7  lib/Cake/Console/Command/CommandListShell.php
... ...
@@ -1,9 +1,5 @@
1 1
 <?php
2 2
 /**
3  
- * Command list Shell
4  
- *
5  
- * PHP 5
6  
- *
7 3
  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
8 4
  * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
9 5
  *
@@ -46,7 +42,7 @@ public function startup() {
46 42
 	public function main() {
47 43
 		if (empty($this->params['xml'])) {
48 44
 			$this->out(__d('cake_console', "<info>Current Paths:</info>"), 2);
49  
-			$this->out(" -app: ". APP_DIR);
  45
+			$this->out(" -app: " . APP_DIR);
50 46
 			$this->out(" -working: " . rtrim(APP, DS));
51 47
 			$this->out(" -root: " . rtrim(ROOT, DS));
52 48
 			$this->out(" -core: " . rtrim(CORE_PATH, DS));
@@ -234,4 +230,5 @@ public function getOptionParser() {
234 230
 				'boolean' => true
235 231
 			));
236 232
 	}
  233
+
237 234
 }
7  lib/Cake/Console/Command/ConsoleShell.php
... ...
@@ -1,9 +1,5 @@
1 1
 <?php
2 2
 /**
3  
- * CakePHP Console Shell
4  
- *
5  
- * PHP 5
6  
- *
7 3
  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
8 4
  * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
9 5
  *
@@ -343,7 +339,7 @@ protected function _loadRoutes() {
343 339
 		Router::reload();
344 340
 		extract(Router::getNamedExpressions());
345 341
 
346  
-		if (!@include(APP . 'Config' . DS . 'routes.php')) {
  342
+		if (!@include APP . 'Config' . DS . 'routes.php') {
347 343
 			return false;
348 344
 		}
349 345
 		CakePlugin::routes();
@@ -359,4 +355,5 @@ protected function _loadRoutes() {
359 355
 		}
360 356
 		return true;
361 357
 	}
  358
+
362 359
 }
1  lib/Cake/Console/Command/I18nShell.php
@@ -117,4 +117,5 @@ public function getOptionParser() {
117 117
 				'parser' => $this->Extract->getOptionParser()
118 118
 			));
119 119
 	}
  120
+
120 121
 }
9  lib/Cake/Console/Command/SchemaShell.php
@@ -58,7 +58,7 @@ public function startup() {
58 58
 		$this->_welcome();
59 59
 		$this->out('Cake Schema Shell');
60 60
 		$this->hr();
61  
-	
  61
+
62 62
 		$name = $path = $connection = $plugin = null;
63 63
 		if (!empty($this->params['name'])) {
64 64
 			$name = $this->params['name'];
@@ -168,7 +168,7 @@ public function generate() {
168 168
 			$count = 0;
169 169
 			if (!empty($result[1])) {
170 170
 				foreach ($result[1] as $file) {
171  
-					if (preg_match('/'.preg_quote($fileName).'(?:[_\d]*)?\.php$/', $file)) {
  171
+					if (preg_match('/' . preg_quote($fileName) . '(?:[_\d]*)?\.php$/', $file)) {
172 172
 						$count++;
173 173
 					}
174 174
 				}
@@ -216,7 +216,7 @@ public function dump() {
216 216
 			}
217 217
 		}
218 218
 		$db = ConnectionManager::getDataSource($this->Schema->connection);
219  
-		$contents = "\n\n" . $db->dropSchema($Schema) . "\n\n". $db->createSchema($Schema);
  219
+		$contents = "\n\n" . $db->dropSchema($Schema) . "\n\n" . $db->createSchema($Schema);
220 220
 
221 221
 		if ($write) {
222 222
 			if (strpos($write, '.sql') === false) {
@@ -419,7 +419,7 @@ protected function _run($contents, $event, &$Schema) {
419 419
 					try {
420 420
 						$db->execute($sql);
421 421
 					} catch (PDOException $e) {
422  
-						$error = $table . ': '  . $e->getMessage();
  422
+						$error = $table . ': ' . $e->getMessage();
423 423
 					}
424 424
 
425 425
 					$Schema->after(array($event => $table, 'errors' => $error));
@@ -529,4 +529,5 @@ public function getOptionParser() {
529 529
 		));
530 530
 		return $parser;
531 531
 	}
  532
+
532 533
 }
53  lib/Cake/Console/Command/Task/ControllerTask.php
@@ -145,17 +145,16 @@ protected function _interactive() {
145 145
 		$useDynamicScaffold = 'n';
146 146
 		$wannaBakeCrud = 'y';
147 147
 
148  
-
149 148
 		$question[] = __d('cake_console', "Would you like to build your controller interactively?");
150  
-		if (file_exists($this->path . $controllerName .'Controller.php')) {
  149
+		if (file_exists($this->path . $controllerName . 'Controller.php')) {
151 150
 			$question[] = __d('cake_console', "Warning: Choosing no will overwrite the %sController.", $controllerName);
152 151
 		}
153  
-		$doItInteractive = $this->in(implode("\n", $question), array('y','n'), 'y');
  152
+		$doItInteractive = $this->in(implode("\n", $question), array('y', 'n'), 'y');
154 153
 
155 154
 		if (strtolower($doItInteractive) == 'y') {
156 155
 			$this->interactive = true;
157 156
 			$useDynamicScaffold = $this->in(
158  
-				__d('cake_console', "Would you like to use dynamic scaffolding?"), array('y','n'), 'n'
  157
+				__d('cake_console', "Would you like to use dynamic scaffolding?"), array('y', 'n'), 'n'
159 158
 			);
160 159
 
161 160
 			if (strtolower($useDynamicScaffold) == 'y') {
@@ -233,7 +232,7 @@ public function confirmController($controllerName, $useDynamicScaffold, $helpers
233 232
 				$output = '';
234 233
 				$length = count($$var);
235 234
 				foreach ($$var as $i => $propElement) {
236  
-					if ($i != $length -1) {
  235
+					if ($i != $length - 1) {
237 236
 						$output .= ucfirst($propElement) . ', ';
238 237
 					} else {
239 238
 						$output .= ucfirst($propElement);
@@ -468,48 +467,4 @@ public function getOptionParser() {
468 467
 			))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
469 468
 	}
470 469
 
471  
-/**
472  
- * Displays help contents
473  
- *
474  
- * @return void
475  
- */
476  
-	public function help() {
477  
-		$this->hr();
478  
-		$this->out("Usage: cake bake controller <arg1> <arg2>...");
479  
-		$this->hr();
480  
-		$this->out('Arguments:');
481  
-		$this->out();
482  
-		$this->out("<name>");
483  
-		$this->out("\tName of the controller to bake. Can use Plugin.name");
484  
-		$this->out("\tas a shortcut for plugin baking.");
485  
-		$this->out();
486  
-		$this->out('Params:');
487  
-		$this->out();
488  
-		$this->out('-connection <config>');
489  
-		$this->out("\tset db config <config>. uses 'default' if none is specified");
490  
-		$this->out();
491  
-		$this->out('Commands:');
492  
-		$this->out();
493  
-		$this->out("controller <name>");
494  
-		$this->out("\tbakes controller with var \$scaffold");
495  
-		$this->out();
496  
-		$this->out("controller <name> public");
497  
-		$this->out("\tbakes controller with basic crud actions");
498  
-		$this->out("\t(index, view, add, edit, delete)");
499  
-		$this->out();
500  
-		$this->out("controller <name> admin");
501  
-		$this->out("\tbakes a controller with basic crud actions for one of the");
502  
-		$this->out("\tConfigure::read('Routing.prefixes') methods.");
503  
-		$this->out();
504  
-		$this->out("controller <name> public admin");
505  
-		$this->out("\tbakes a controller with basic crud actions for one");
506  
-		$this->out("\tConfigure::read('Routing.prefixes') and non admin methods.");
507  
-		$this->out("\t(index, view, add, edit, delete,");
508  
-		$this->out("\tadmin_index, admin_view, admin_edit, admin_add, admin_delete)");
509  
-		$this->out();
510  
-		$this->out("controller all");
511  
-		$this->out("\tbakes all controllers with CRUD methods.");
512  
-		$this->out();
513  
-		$this->_stop();
514  
-	}
515 470
 }
3  lib/Cake/Console/Command/Task/DbConfigTask.php
@@ -364,7 +364,7 @@ public function getConfig() {
364 364
 		$connections = array_keys($configs);
365 365
 
366 366
 		if (count($connections) > 1) {
367  
-			$useDbConfig = $this->in(__d('cake_console', 'Use Database Config') .':', $connections, $useDbConfig);
  367
+			$useDbConfig = $this->in(__d('cake_console', 'Use Database Config') . ':', $connections, $useDbConfig);
368 368
 		}
369 369
 		return $useDbConfig;
370 370
 	}
@@ -380,4 +380,5 @@ public function getOptionParser() {
380 380
 				__d('cake_console', 'Bake new database configuration settings.')
381 381
 			);
382 382
 	}
  383
+
383 384
 }
9  lib/Cake/Console/Command/Task/ExtractTask.php
@@ -584,8 +584,10 @@ protected function _writeHeader() {
584 584
  */
585 585
 	protected function _getStrings(&$position, $target) {
586 586
 		$strings = array();
587  
-		while (count($strings) < $target && ($this->_tokens[$position] == ',' || $this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING)) {
588  
-			if ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING && $this->_tokens[$position+1] == '.') {
  587
+		$count = count($strings);
  588
+		while ($count < $target && ($this->_tokens[$position] == ',' || $this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING)) {
  589
+			$count = count($strings);
  590
+			if ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING && $this->_tokens[$position + 1] == '.') {
589 591
 				$string = '';
590 592
 				while ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING || $this->_tokens[$position] == '.') {
591 593
 					if ($this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING) {
@@ -668,7 +670,7 @@ protected function _searchFiles() {
668 670
 				}
669 671
 				$exclude[] = preg_quote($e, '/');
670 672
 			}
671  
-			$pattern =  '/' . implode('|', $exclude) . '/';
  673
+			$pattern = '/' . implode('|', $exclude) . '/';
672 674
 		}
673 675
 		foreach ($this->_paths as $path) {
674 676
 			$Folder = new Folder($path);
@@ -694,4 +696,5 @@ protected function _searchFiles() {
694 696
 	protected function _isExtractingApp() {
695 697
 		return $this->_paths === array(APP);
696 698
 	}
  699
+
697 700
 }
4  lib/Cake/Console/Command/Task/FixtureTask.php
@@ -86,7 +86,7 @@ public function getOptionParser() {
86 86
 			'help' => __d('cake_console', 'Used with --count and <name>/all commands to pull [n] records from the live tables, where [n] is either --count or the default of 10'),
87 87
 			'short' => 'r',
88 88
 			'boolean' => true
89  
-		))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));;
  89
+		))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
90 90
 	}
91 91
 
92 92
 /**
@@ -388,7 +388,7 @@ protected function _getRecordsFromTable($modelName, $useTable = null) {
388 388
 				$condition = $this->in($prompt, null, 'WHERE 1=1');
389 389
 			}
390 390
 			$prompt = __d('cake_console', "How many records do you want to import?");
391  
-			$recordCount =  $this->in($prompt, null, 10);
  391
+			$recordCount = $this->in($prompt, null, 10);
392 392
 		} else {
393 393
 			$condition = 'WHERE 1=1';
394 394
 			$recordCount = (isset($this->params['count']) ? $this->params['count'] : 10);
30  lib/Cake/Console/Command/Task/ModelTask.php
@@ -170,7 +170,7 @@ public function inOptions($options, $prompt = null, $default = null) {
170 170
 		$max = count($options);
171 171
 		while (!$valid) {
172 172
 			foreach ($options as $i => $option) {
173  
-				$this->out($i + 1 .'. ' . $option);
  173
+				$this->out($i + 1 . '. ' . $option);
174 174
 			}
175 175
 			if (empty($prompt)) {
176 176
 				$prompt = __d('cake_console', 'Make a selection from the choices above');
@@ -297,7 +297,7 @@ protected function _interactive() {
297 297
  */
298 298
 	protected function _printAssociation($modelName, $type, $associations) {
299 299
 		if (!empty($associations[$type])) {
300  
-			for ($i = 0; $i < count($associations[$type]); $i++) {
  300
+			for ($i = 0, $len = count($associations[$type]); $i < $len; $i++) {
301 301
 				$out = "\t" . $modelName . ' ' . $type . ' ' . $associations[$type][$i]['alias'];
302 302
 				$this->out($out);
303 303
 			}
@@ -414,7 +414,7 @@ public function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
414 414
 			for ($i = 1; $i < $defaultChoice; $i++) {
415 415
 				$prompt .= $i . ' - ' . $this->_validations[$i] . "\n";
416 416
 			}
417  
-			$prompt .=  __d('cake_console', "%s - Do not do any validation on this field.\n", $defaultChoice);
  417
+			$prompt .= __d('cake_console', "%s - Do not do any validation on this field.\n", $defaultChoice);
418 418
 			$prompt .= __d('cake_console', "... or enter in a valid regex validation string.\n");
419 419
 
420 420
 			$methods = array_flip($this->_validations);
@@ -498,11 +498,14 @@ public function doAssociations($model) {
498 498
 		}
499 499
 
500 500
 		if (empty($this->_tables)) {
501  
-			$this->_tables = (array) $this->getAllTables();
  501
+			$this->_tables = (array)$this->getAllTables();
502 502
 		}
503 503
 
504 504
 		$associations = array(
505  
-			'belongsTo' => array(), 'hasMany' => array(), 'hasOne' => array(), 'hasAndBelongsToMany' => array()
  505
+			'belongsTo' => array(),
  506
+			'hasMany' => array(),
  507
+			'hasOne' => array(),
  508
+			'hasAndBelongsToMany' => array()
506 509
 		);
507 510
 
508 511
 		$associations = $this->findBelongsTo($model, $associations);
@@ -780,13 +783,19 @@ public function bake($name, $data = array()) {
780 783
 		} else {
781 784
 			$data['name'] = $name;
782 785
 		}
783  
-		$defaults = array('associations' => array(), 'validate' => array(), 'primaryKey' => 'id',
784  
-			'useTable' => null, 'useDbConfig' => 'default', 'displayField' => null);
  786
+		$defaults = array(
  787
+			'associations' => array(),
  788
+			'validate' => array(),
  789
+			'primaryKey' => 'id',
  790
+			'useTable' => null,
  791
+			'useDbConfig' => 'default',
  792
+			'displayField' => null
  793
+		);
785 794
 		$data = array_merge($defaults, $data);
786 795
 
787 796
 		$pluginPath = '';
788 797
 		if ($this->plugin) {
789  
-			$pluginPath =  $this->plugin . '.';
  798
+			$pluginPath = $this->plugin . '.';
790 799
 		}
791 800
 
792 801
 		$this->Template->set($data);
@@ -824,7 +833,7 @@ public function bakeTest($className) {
824 833
  * @return array
825 834
  */
826 835
 	public function listAll($useDbConfig = null) {
827  
-		$this->_tables = (array) $this->getAllTables($useDbConfig);
  836
+		$this->_tables = (array)$this->getAllTables($useDbConfig);
828 837
 
829 838
 		$this->_modelNames = array();
830 839
 		$count = count($this->_tables);
@@ -926,7 +935,7 @@ public function getName($useDbConfig = null) {
926 935
 			}
927 936
 
928 937
 			if ($enteredModel == '' || intval($enteredModel) > count($this->_modelNames)) {
929  
-				$this->err(__d('cake_console', "The model name you supplied was empty,\n" . 
  938
+				$this->err(__d('cake_console', "The model name you supplied was empty,\n" .
930 939
 					"or the number you selected was not an option. Please try again."));
931 940
 				$enteredModel = '';
932 941
 			}
@@ -975,4 +984,5 @@ public function bakeFixture($className, $useTable = null) {
975 984
 		$this->Fixture->plugin = $this->plugin;
976 985
 		$this->Fixture->bake($className, $useTable);
977 986
 	}
  987
+
978 988
 }
5  lib/Cake/Console/Command/Task/PluginTask.php
@@ -135,7 +135,7 @@ public function bake($plugin) {
135 135
 			$out = "<?php\n\n";
136 136
 			$out .= "class {$plugin}AppController extends AppController {\n\n";
137 137
 			$out .= "}\n\n";
138  
-			$this->createFile($this->path . $plugin. DS . 'Controller' . DS . $controllerFileName, $out);
  138
+			$this->createFile($this->path . $plugin . DS . 'Controller' . DS . $controllerFileName, $out);
139 139
 
140 140
 			$modelFileName = $plugin . 'AppModel.php';
141 141
 
@@ -167,7 +167,7 @@ public function findPath($pathOptions) {
167 167
 		$max = count($pathOptions);
168 168
 		while (!$valid) {
169 169
 			foreach ($pathOptions as $i => $option) {
170  
-				$this->out($i + 1 .'. ' . $option);
  170
+				$this->out($i + 1 . '. ' . $option);
171 171
 			}
172 172
 			$prompt = __d('cake_console', 'Choose a plugin path from the paths above.');
173 173
 			$choice = $this->in($prompt);
@@ -191,7 +191,6 @@ public function getOptionParser() {
191 191
 		))->addArgument('name', array(
192 192
 			'help' => __d('cake_console', 'CamelCased name of the plugin to create.')
193 193
 		));
194  
-
195 194
 	}
196 195
 
197 196
 }
9  lib/Cake/Console/Command/Task/ProjectTask.php
@@ -54,7 +54,6 @@ public function execute() {
54 54
 			$project = $this->in($prompt, null, APP . 'myapp');
55 55
 		}
56 56
 
57  
-
58 57
 		if ($project && !Folder::isAbsolute($project) && isset($_SERVER['PWD'])) {
59 58
 			$project = $_SERVER['PWD'] . DS . $project;
60 59
 		}
@@ -112,7 +111,7 @@ public function execute() {
112 111
 				$this->out(__d('cake_console', ' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/index.php', CAKE_CORE_INCLUDE_PATH));
113 112
 				$this->out(__d('cake_console', ' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/test.php', CAKE_CORE_INCLUDE_PATH));
114 113
 			} else {
115  
-				$this->err(__d('cake_console', 'Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in %s', $path . 'webroot' .DS .'index.php'));
  114
+				$this->err(__d('cake_console', 'Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in %s', $path . 'webroot' . DS .'index.php'));
116 115
 				$success = false;
117 116
 			}
118 117
 			if ($success && $hardCode) {
@@ -231,8 +230,8 @@ public function createHome($dir) {
231 230
 		$app = basename($dir);
232 231
 		$path = $dir . 'View' . DS . 'Pages' . DS;
233 232
 		$source = CAKE . 'Console' . DS . 'Templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
234  
-		include($source);
235  
-		return $this->createFile($path.'home.ctp', $output);
  233
+		include $source;
  234
+		return $this->createFile($path . 'home.ctp', $output);
236 235
 	}
237 236
 
238 237
 /**
@@ -282,7 +281,7 @@ public function securitySalt($path) {
282 281
  *
283 282
  * @param string $path Project path
284 283
  * @return boolean Success
285  
-	 */
  284
+ */
286 285
 	public function securityCipherSeed($path) {
287 286
 		$File = new File($path . 'Config' . DS . 'core.php');
288 287
 		$contents = $File->read();
5  lib/Cake/Console/Command/Task/TemplateTask.php
@@ -74,7 +74,7 @@ protected function _findThemes() {
74 74
 		foreach ($plugins as $plugin) {
75 75
 			$paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
76 76
 		}
77  
-		
  77
+
78 78
 		$paths = array_merge($paths, App::path('Console'));
79 79
 
80 80
 		// TEMPORARY TODO remove when all paths are DS terminated
@@ -149,7 +149,7 @@ public function generate($directory, $filename, $vars = null) {
149 149
 			extract($this->templateVars);
150 150
 			ob_start();
151 151
 			ob_implicit_flush(0);
152  
-			include($templateFile);
  152
+			include $templateFile;
153 153
 			$content = ob_get_clean();
154 154
 			return $content;
155 155
 		}
@@ -214,4 +214,5 @@ protected function _findTemplate($path, $directory, $filename) {
214 214
 		$this->err(__d('cake_console', 'Could not find template for %s', $filename));
215 215
 		return false;
216 216
 	}
  217
+
217 218
 }
12  lib/Cake/Console/Command/Task/TestTask.php
@@ -46,7 +46,7 @@ class TestTask extends BakeTask {
46 46
  *
47 47
  * @var array
48 48
  */
49  
-	public $classTypes =  array(
  49
+	public $classTypes = array(
50 50
 		'Model' => 'Model',
51 51
 		'Controller' => 'Controller',
52 52
 		'Component' => 'Controller/Component',
@@ -276,9 +276,9 @@ public function getRealClassName($type, $class) {
276 276
 		if (strtolower($type) == 'model' || empty($this->classTypes[$type])) {
277 277
 			return $class;
278 278
 		}
279  
-	
  279
+
280 280
 		$position = strpos($class, $type);
281  
-		 
  281
+
282 282
 		if ($position !== false && strlen($class) - $position == strlen($type)) {
283 283
 			return $class;
284 284
 		}
@@ -291,6 +291,7 @@ public function getRealClassName($type, $class) {
291 291
  * @param string $type The type of thing having a test generated.
292 292
  * @param string $plugin The plugin name.
293 293
  * @return string
  294
+ * @throws CakeException When invalid object types are requested.
294 295
  */
295 296
 	public function mapType($type, $plugin) {
296 297
 		$type = ucfirst($type);
@@ -397,8 +398,8 @@ protected function _processController($subject) {
397 398
 	protected function _addFixture($name) {
398 399
 		$parent = get_parent_class($name);
399 400
 		$prefix = 'app.';
400  
-		if (strtolower($parent) != 'appmodel' && strtolower(substr($parent, -8)) == 'appmodel') {
401  
-			$pluginName = substr($parent, 0, strlen($parent) -8);
  401
+		if (strtolower($parent) != 'appmodel' && strtolower(substr($parent, - 8)) == 'appmodel') {
  402
+			$pluginName = substr($parent, 0, strlen($parent) - 8);
402 403
 			$prefix = 'plugin.' . Inflector::underscore($pluginName) . '.';
403 404
 		}
404 405
 		$fixture = $prefix . Inflector::underscore($name);
@@ -530,4 +531,5 @@ public function getOptionParser() {
530 531
 				'help' => __d('cake_console', 'CamelCased name of the plugin to bake tests for.')
531 532
 			))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
532 533
 	}
  534
+
533 535
 }
5  lib/Cake/Console/Command/Task/ViewTask.php
@@ -133,7 +133,7 @@ public function execute() {
133 133
  * @return array Array of action names that should be baked
134 134
  */
135 135
 	protected function _methodsToBake() {
136  
-		$methods =  array_diff(
  136
+		$methods = array_diff(
137 137
 			array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
138 138
 			array_map('strtolower', get_class_methods('AppController'))
139 139
 		);
@@ -459,9 +459,10 @@ protected function _associations(Model $model) {
459 459
 				$associations[$type][$assocKey]['displayField'] = $model->{$assocKey}->displayField;
460 460
 				$associations[$type][$assocKey]['foreignKey'] = $assocData['foreignKey'];
461 461
 				$associations[$type][$assocKey]['controller'] = Inflector::pluralize(Inflector::underscore($modelClass));
462  
-				$associations[$type][$assocKey]['fields'] =  array_keys($model->{$assocKey}->schema(true));
  462
+				$associations[$type][$assocKey]['fields'] = array_keys($model->{$assocKey}->schema(true));
463 463
 			}
464 464
 		}
465 465
 		return $associations;
466 466
 	}
  467
+
467 468
 }
6  lib/Cake/Console/Command/TestShell.php
@@ -192,7 +192,6 @@ protected function _parseArgs() {
192 192
 			'output' => 'text',
193 193
 		);
194 194
 
195  
-
196 195
 		if (strpos($this->args[0], '.php')) {
197 196
 			$category = $this->_mapFileToCategory($this->args[0]);
198 197
 			$params['case'] = $this->_mapFileToCase($this->args[0], $category);
@@ -312,7 +311,7 @@ public function available() {
312 311
 		}
313 312
 
314 313
 		while ($choice = $this->in(__d('cake_console', 'What test case would you like to run?'), null, 'q')) {
315  
-			if (is_numeric($choice)  && isset($cases[$choice])) {
  314
+			if (is_numeric($choice) && isset($cases[$choice])) {
316 315
 				$this->args[0] = $category;
317 316
 				$this->args[1] = $cases[$choice];
318 317
 				$this->_run($this->_parseArgs(), $this->_runnerOptions());
@@ -385,7 +384,7 @@ protected function _mapFileToCase($file, $category, $throwOnMissingFile = true)
385 384
 			if (!file_exists($testFile) && $throwOnMissingFile) {
386 385
 				throw new Exception(__d('cake_dev', 'Test case %s not found', $testFile));
387 386
 			}
388  
-				
  387
+
389 388
 			return $testCase;
390 389
 		}
391 390
 
@@ -431,4 +430,5 @@ protected function _mapFileToCategory($file) {
431 430
 		}
432 431
 		return 'app';
433 432
 	}
  433
+
434 434
 }
1  lib/Cake/Console/Command/TestsuiteShell.php
@@ -207,4 +207,5 @@ public function main() {
207 207
 
208 208
 		$this->_run($args, $this->_runnerOptions());
209 209
 	}
  210
+
210 211
 }
13  lib/Cake/Console/Command/UpgradeShell.php
@@ -169,7 +169,7 @@ public function locations() {
169 169
 				}
170 170
 			}
171 171
 		}
172  
-	
  172
+
173 173
 		$this->_moveViewFiles();
174 174
 		$this->_moveAppClasses();
175 175
 
@@ -234,7 +234,7 @@ public function helpers() {
234 234
 		$helpers = array_merge($pluginHelpers, $helpers);
235 235
 		foreach ($helpers as $helper) {
236 236
 			$helper = preg_replace('/Helper$/', '', $helper);
237  
-			$oldHelper = strtolower(substr($helper, 0, 1)).substr($helper, 1);
  237
+			$oldHelper = strtolower(substr($helper, 0, 1)) . substr($helper, 1);
238 238
 			$patterns[] = array(
239 239
 				"\${$oldHelper} to \$this->{$helper}",
240 240
 				"/\\\${$oldHelper}->/",
@@ -355,7 +355,7 @@ public function request() {
355 355
 			$pluginPath = App::pluginPath($this->params['plugin']);
356 356
 			$this->_paths = array(
357 357
 				$pluginPath . 'controllers' . DS,
358  
-				$pluginPath . 'controllers' . DS . 'components' .DS,
  358
+				$pluginPath . 'controllers' . DS . 'components' . DS,
359 359
 				$pluginPath . 'views' . DS,
360 360
 			);
361 361
 		}
@@ -536,7 +536,7 @@ public function exceptions() {
536 536
 			$pluginPath = App::pluginPath($this->params['plugin']);
537 537
 			$this->_paths = array(
538 538
 				$pluginPath . 'controllers' . DS,
539  
-				$pluginPath . 'controllers' . DS . 'components' .DS,
  539
+				$pluginPath . 'controllers' . DS . 'components' . DS,
540 540
 			);
541 541
 		}
542 542
 		$patterns = array(
@@ -604,7 +604,7 @@ protected function _moveViewFiles() {
604 604
 	protected function _moveAppClasses() {
605 605
 		$files = array(
606 606
 			APP . 'app_controller.php' => APP . 'Controller' . DS . 'AppController.php',
607  
-			APP . 'controllers' . DS .'app_controller.php' => APP . 'Controller' . DS . 'AppController.php',
  607
+			APP . 'controllers' . DS . 'app_controller.php' => APP . 'Controller' . DS . 'AppController.php',
608 608
 			APP . 'app_model.php' => APP . 'Model' . DS . 'AppModel.php',
609 609
 			APP . 'models' . DS . 'app_model.php' => APP . 'Model' . DS . 'AppModel.php',
610 610
 		);
@@ -706,7 +706,7 @@ protected function _movePhpFiles($path, $options) {
706 706
 			if (!$this->params['dry-run']) {
707 707
 				if ($this->params['git']) {
708 708
 					exec('git mv -f ' . escapeshellarg($file) . ' ' . escapeshellarg($file . '__'));
709  
-					exec('git mv -f ' . escapeshellarg($file. '__') . ' ' . escapeshellarg($new));
  709
+					exec('git mv -f ' . escapeshellarg($file . '__') . ' ' . escapeshellarg($new));
710 710
 				} else {
711 711
 					rename($file, $new);
712 712
 				}
@@ -854,4 +854,5 @@ public function getOptionParser() {
854 854
 				'parser' => $subcommandParser
855 855
 			));
856 856
 	}
  857
+
857 858
 }
4  lib/Cake/Console/ConsoleInput.php
@@ -22,6 +22,7 @@
22 22
  * @package       Cake.Console
23 23
  */
24 24
 class ConsoleInput {
  25
+
25 26
 /**
26 27
  * Input value.
27 28
  *
@@ -46,4 +47,5 @@ public function __construct($handle = 'php://stdin') {
46 47
 	public function read() {
47 48
 		return fgets($this->_input);
48 49
 	}
49  
-}
  50
+
  51
+}
4  lib/Cake/Console/ConsoleInputArgument.php
@@ -23,6 +23,7 @@
23 23
  * @package       Cake.Console
24 24
  */
25 25
 class ConsoleInputArgument {
  26
+
26 27
 /**
27 28
  * Name of the argument.
28 29
  *
@@ -125,7 +126,7 @@ public function usage() {
125 126
  * @return boolean
126 127
  */
127 128
 	public function isRequired() {
128  
-		return (bool) $this->_required;
  129
+		return (bool)$this->_required;
129 130
 	}
130 131
 
131 132
 /**
@@ -165,4 +166,5 @@ public function xml(SimpleXmlElement $parent) {
165 166
 		}
166 167
 		return $parent;
167 168
 	}
  169
+
168 170
 }
4  lib/Cake/Console/ConsoleInputOption.php
@@ -24,6 +24,7 @@
24 24
  * @package       Cake.Console
25 25
  */
26 26
 class ConsoleInputOption {
  27
+
27 28
 /**
28 29
  * Name of the option
29 30
  *
@@ -171,7 +172,7 @@ public function defaultValue() {
171 172
  * @return boolean
172 173
  */
173 174
 	public function isBoolean() {
174  
-		return (bool) $this->_boolean;
  175
+		return (bool)$this->_boolean;
175 176
 	}
176 177
 
177 178
 /**
@@ -216,4 +217,5 @@ public function xml(SimpleXmlElement $parent) {
216 217
 		}
217 218
 		return $parent;
218 219
 	}
  220
+
219 221
 }
1  lib/Cake/Console/ConsoleInputSubcommand.php
@@ -117,4 +117,5 @@ public function xml(SimpleXmlElement $parent) {
117 117
 		$command->addAttribute('help', $this->_help);
118 118
 		return $parent;
119 119
 	}
  120
+
120 121
 }
2  lib/Cake/Console/ConsoleOptionParser.php
@@ -551,6 +551,7 @@ protected function _parseLongOption($option, $params) {
551 551
  * @param string $option The option to parse.
552 552
  * @param array $params The params to append the parsed value into
553 553
  * @return array Params with $option added in.
  554
+ * @throws ConsoleException When unknown short options are encountered.
554 555
  */
555 556
 	protected function _parseShortOption($option, $params) {
556 557
 		$key = substr($option, 1);
@@ -597,7 +598,6 @@ protected function _parseOption($name, $params) {
597 598
 		}
598 599
 	}
599 600
 
600  
-
601 601
 /**
602 602
  * Check to see if $name has an option (short/long) defined for it.
603 603
  *
1  lib/Cake/Console/ConsoleOutput.php
@@ -284,4 +284,5 @@ public function outputAs($type = null) {
284 284
 	public function __destruct() {
285 285
 		fclose($this->_output);
286 286
 	}
  287
+
287 288
 }
2  lib/Cake/Console/HelpFormatter.php
@@ -29,6 +29,7 @@
29 29
  * @since  CakePHP(tm) v 2.0
30 30
  */
31 31
 class HelpFormatter {
  32
+
32 33
 /**
33 34
  * The maximum number of arguments shown when generating usage.
34 35
  *
@@ -196,4 +197,5 @@ public function xml($string = true) {
196 197
 		}
197 198
 		return $string ? $xml->asXml() : $xml;
198 199
 	}
  200
+
199 201
 }
3  lib/Cake/Console/Shell.php
@@ -400,7 +400,7 @@ public function runCommand($command, $argv) {
400 400
  */
401 401
 	protected function _displayHelp($command) {
402 402
 		$format = 'text';
403  
-		if (!empty($this->args[0]) && $this->args[0] == 'xml')  {
  403
+		if (!empty($this->args[0]) && $this->args[0] == 'xml') {
404 404
 			$format = 'xml';
405 405
 			$this->stdout->outputAs(ConsoleOutput::RAW);
406 406
 		} else {
@@ -812,4 +812,5 @@ protected function _pluginPath($pluginName) {
812 812
 		}
813 813
 		return current(App::path('plugins')) . $pluginName . DS;
814 814
 	}
  815
+
815 816
 }
1  lib/Cake/Console/ShellDispatcher.php
@@ -328,4 +328,5 @@ public function help() {
328 328
 	protected function _stop($status = 0) {
329 329
 		exit($status);
330 330
 	}
  331
+
331 332
 }
1  lib/Cake/Console/TaskCollection.php
@@ -24,6 +24,7 @@
24 24
  * @package       Cake.Console
25 25
  */
26 26
 class TaskCollection extends ObjectCollection {
  27
+
27 28
 /**
28 29
  * Shell to use to set params to tasks.
29 30
  *
22  lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php
@@ -39,29 +39,29 @@ public function after($event = array()) {
39 39
 	}
40 40
 
41 41
 	public $acos = array(
42  
-			'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
43  
-			'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
  42
+			'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
  43
+			'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
44 44
 			'model' => array('type' => 'string', 'null' => true),
45  
-			'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
  45
+			'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
46 46
 			'alias' => array('type' => 'string', 'null' => true),
47  
-			'lft' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
48  
-			'rght' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
  47
+			'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  48
+			'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
49 49
 			'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
50 50
 		);
51 51
 
52 52
 	public $aros = array(
53  
-			'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
54  
-			'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
  53
+			'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
  54
+			'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
55 55
 			'model' => array('type' => 'string', 'null' => true),
56  
-			'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
  56
+			'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
57 57
 			'alias' => array('type' => 'string', 'null' => true),
58  
-			'lft' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
59  
-			'rght' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
  58
+			'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  59
+			'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
60 60
 			'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
61 61
 		);
62 62
 
63 63
 	public $aros_acos = array(
64  
-			'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
  64
+			'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
65 65
 			'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
66 66
 			'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
67 67
 			'_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
16  lib/Cake/Console/Templates/skel/Config/Schema/i18n.php
@@ -39,13 +39,13 @@ public function after($event = array()) {
39 39
 	}
40 40
 
41 41
 	public $i18n = array(
42  
-			'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
43  
-			'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
44  
-			'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
45  
-			'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
46  
-			'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
47  
-			'content' => array('type' => 'text', 'null' => true, 'default' => NULL),
48  
-			'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
49  
-		);
  42
+		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
  43
+		'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
  44
+		'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
  45
+		'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
  46
+		'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
  47
+		'content' => array('type' => 'text', 'null' => true, 'default' => null),
  48
+		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
  49
+	);
50 50
 
51 51
 }
10  lib/Cake/Console/Templates/skel/Config/Schema/sessions.php
@@ -39,10 +39,10 @@ public function after($event = array()) {
39 39
 	}
40 40
 
41 41
 	public $cake_sessions = array(
42  
-			'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'),
43  
-			'data' => array('type' => 'text', 'null' => true, 'default' => NULL),
44  
-			'expires' => array('type' => 'integer', 'null' => true, 'default' => NULL),
45  
-			'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
46  
-		);
  42
+		'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'),
  43
+		'data' => array('type' => 'text', 'null' => true, 'default' => null),
  44
+		'expires' => array('type' => 'integer', 'null' => true, 'default' => null),
  45
+		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
  46
+	);
47 47
 
48 48
 }
2  lib/Cake/Console/Templates/skel/Console/cake.php
@@ -25,7 +25,7 @@
25 25
 	ini_set('include_path', $root . PATH_SEPARATOR . __CAKE_PATH__ . PATH_SEPARATOR . ini_get('include_path'));
26 26
 }
27 27
 
28  
-if (!include($dispatcher)) {
  28
+if (!include $dispatcher) {
29 29
 	trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
30 30
 }
31 31
 unset($paths, $path, $dispatcher, $root, $ds);
8  lib/Cake/Console/Templates/skel/Controller/PagesController.php
@@ -55,7 +55,7 @@ public function display() {
55 55
 		if (!$count) {
56 56
 			$this->redirect('/');
57 57
 		}
58  
-		$page = $subpage = $title_for_layout = null;
  58
+		$page = $subpage = $title = null;
59 59
 
60 60
 		if (!empty($path[0])) {
61 61
 			$page = $path[0];
@@ -64,9 +64,11 @@ public function display() {
64 64
 			$subpage = $path[1];
65 65
 		}
66 66
 		if (!empty($path[$count - 1])) {
67  
-			$title_for_layout = Inflector::humanize($path[$count - 1]);
  67
+			$title = Inflector::humanize($path[$count - 1]);
68 68
 		}
69  
-		$this->set(compact('page', 'subpage', 'title_for_layout'));
  69
+		$this->set(compact('page', 'subpage'));
  70
+		$this->set('title_for_layout', $title);
70 71
 		$this->render(implode('/', $path));
71 72
 	}
  73
+
72 74
 }
2  lib/Cake/Console/cake.php
@@ -33,7 +33,7 @@
33 33
 	ini_set('include_path', $root . $ds . PATH_SEPARATOR . ini_get('include_path'));
34 34
 }
35 35
 
36  
-if (!include($dispatcher)) {
  36
+if (!include $dispatcher) {
37 37
 	trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
38 38
 }
39 39
 unset($paths, $path, $found, $dispatcher, $root, $ds);

0 notes on commit db8c6b5

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