Skip to content
This repository
Browse code

Fixed some API doc in console.

  • Loading branch information...
commit a0ee8b49feed1d49c30af90ae99d688e8a01059e 1 parent f9373ff
Juan Basso authored July 28, 2011

Showing 30 changed files with 140 additions and 51 deletions. Show diff stats Hide diff stats

  1. 14  lib/Cake/Console/Command/AclShell.php
  2. 5  lib/Cake/Console/Command/ApiShell.php
  3. 3  lib/Cake/Console/Command/BakeShell.php
  4. 6  lib/Cake/Console/Command/CommandListShell.php
  5. 4  lib/Cake/Console/Command/ConsoleShell.php
  6. 3  lib/Cake/Console/Command/I18nShell.php
  7. 15  lib/Cake/Console/Command/SchemaShell.php
  8. 9  lib/Cake/Console/Command/Task/ControllerTask.php
  9. 4  lib/Cake/Console/Command/Task/DbConfigTask.php
  10. 5  lib/Cake/Console/Command/Task/ExtractTask.php
  11. 10  lib/Cake/Console/Command/Task/FixtureTask.php
  12. 11  lib/Cake/Console/Command/Task/ModelTask.php
  13. 8  lib/Cake/Console/Command/Task/PluginTask.php
  14. 3  lib/Cake/Console/Command/Task/ProjectTask.php
  15. 11  lib/Cake/Console/Command/Task/TestTask.php
  16. 7  lib/Cake/Console/Command/Task/ViewTask.php
  17. 6  lib/Cake/Console/ConsoleErrorHandler.php
  18. 4  lib/Cake/Console/ConsoleInputArgument.php
  19. 4  lib/Cake/Console/ConsoleInputOption.php
  20. 2  lib/Cake/Console/ConsoleInputSubcommand.php
  21. 19  lib/Cake/Console/ConsoleOptionParser.php
  22. 1  lib/Cake/Console/HelpFormatter.php
  23. 14  lib/Cake/Console/Shell.php
  24. 10  lib/Cake/Console/ShellDispatcher.php
  25. 4  lib/Cake/Console/TaskCollection.php
  26. 3  lib/Cake/Core/App.php
  27. 2  lib/Cake/Core/Object.php
  28. 1  lib/Cake/Error/ErrorHandler.php
  29. 2  lib/Cake/Log/CakeLog.php
  30. 1  lib/Cake/Utility/ObjectCollection.php
14  lib/Cake/Console/Command/AclShell.php
@@ -58,6 +58,7 @@ class AclShell extends Shell {
58 58
 /**
59 59
  * Override startup of the Shell
60 60
  *
  61
+ * @return void
61 62
  */
62 63
 	public function startup() {
63 64
 		parent::startup();
@@ -96,6 +97,7 @@ public function startup() {
96 97
 /**
97 98
  * Override main() for help message hook
98 99
  *
  100
+ * @return voids
99 101
  */
100 102
 	public function main() {
101 103
 		$this->out($this->OptionParser->help());
@@ -104,6 +106,7 @@ public function main() {
104 106
 /**
105 107
  * Creates an ARO/ACO node
106 108
  *
  109
+ * @return void
107 110
  */
108 111
 	public function create() {
109 112
 		extract($this->__dataVars());
@@ -136,6 +139,7 @@ public function create() {
136 139
 /**
137 140
  * Delete an ARO/ACO node.
138 141
  *
  142
+ * @return void
139 143
  */
140 144
 	public function delete() {
141 145
 		extract($this->__dataVars());
@@ -152,6 +156,7 @@ public function delete() {
152 156
 /**
153 157
  * Set parent for an ARO/ACO node.
154 158
  *
  159
+ * @return void
155 160
  */
156 161
 	public function setParent() {
157 162
 		extract($this->__dataVars());
@@ -175,6 +180,7 @@ public function setParent() {
175 180
 /**
176 181
  * Get path to specified ARO/ACO node.
177 182
  *
  183
+ * @return void
178 184
  */
179 185
 	public function getPath() {
180 186
 		extract($this->__dataVars());
@@ -217,6 +223,7 @@ protected function _outputNode($class, $node, $indent) {
217 223
 /**
218 224
  * Check permission for a given ARO to a given ACO.
219 225
  *
  226
+ * @return void
220 227
  */
221 228
 	public function check() {
222 229
 		extract($this->__getParams());
@@ -231,6 +238,7 @@ public function check() {
231 238
 /**
232 239
  * Grant permission for a given ARO to a given ACO.
233 240
  *
  241
+ * @return void
234 242
  */
235 243
 	public function grant() {
236 244
 		extract($this->__getParams());
@@ -245,6 +253,7 @@ public function grant() {
245 253
 /**
246 254
  * Deny access for an ARO to an ACO.
247 255
  *
  256
+ * @return void
248 257
  */
249 258
 	public function deny() {
250 259
 		extract($this->__getParams());
@@ -259,6 +268,7 @@ public function deny() {
259 268
 /**
260 269
  * Set an ARO to inherit permission to an ACO.
261 270
  *
  271
+ * @return void
262 272
  */
263 273
 	public function inherit() {
264 274
 		extract($this->__getParams());
@@ -273,6 +283,7 @@ public function inherit() {
273 283
 /**
274 284
  * Show a specific ARO/ACO node.
275 285
  *
  286
+ * @return void
276 287
  */
277 288
 	public function view() {
278 289
 		extract($this->__dataVars());
@@ -332,6 +343,7 @@ public function view() {
332 343
 /**
333 344
  * Initialize ACL database.
334 345
  *
  346
+ * @return mixed
335 347
  */
336 348
 	public function initdb() {
337 349
 		return $this->dispatchShell('schema create DbAcl');
@@ -493,8 +505,6 @@ public function getOptionParser() {
493 505
 /**
494 506
  * Checks that given node exists
495 507
  *
496  
- * @param string $type Node type (ARO/ACO)
497  
- * @param integer $id Node id
498 508
  * @return boolean Success
499 509
  */
500 510
 	public function nodeExists() {
5  lib/Cake/Console/Command/ApiShell.php
@@ -36,6 +36,7 @@ class ApiShell extends Shell {
36 36
 /**
37 37
  * Override initialize of the Shell
38 38
  *
  39
+ * @return void
39 40
  */
40 41
 	public function initialize() {
41 42
 		$this->paths = array_merge($this->paths, array(
@@ -53,6 +54,7 @@ public function initialize() {
53 54
 /**
54 55
  * Override main() to handle action
55 56
  *
  57
+ * @return void
56 58
  */
57 59
 	public function main() {
58 60
 		if (empty($this->args)) {
@@ -150,6 +152,7 @@ public function getOptionParser() {
150 152
 /**
151 153
  * Show help for this shell.
152 154
  *
  155
+ * @return void
153 156
  */
154 157
 	public function help() {
155 158
 		$head  = "Usage: cake api [<type>] <className> [-m <method>]\n";
@@ -187,7 +190,7 @@ public function help() {
187 190
  * Parse a given class (located on given file) and get public methods and their
188 191
  * signatures.
189 192
  *
190  
- * @param object $File File object
  193
+ * @param string $path File path
191 194
  * @param string $class Class name
192 195
  * @return array Methods and signatures indexed by method name
193 196
  */
3  lib/Cake/Console/Command/BakeShell.php
@@ -47,6 +47,7 @@ class BakeShell extends Shell {
47 47
 /**
48 48
  * Assign $this->connection to the active task if a connection param is set.
49 49
  *
  50
+ * @return void
50 51
  */
51 52
 	public function startup() {
52 53
 		parent::startup();
@@ -61,6 +62,7 @@ public function startup() {
61 62
 /**
62 63
  * Override main() to handle action
63 64
  *
  65
+ * @return mixed
64 66
  */
65 67
 	public function main() {
66 68
 		if (!is_dir($this->DbConfig->path)) {
@@ -124,6 +126,7 @@ public function main() {
124 126
 /**
125 127
  * Quickly bake the MVC
126 128
  *
  129
+ * @return void
127 130
  */
128 131
 	public function all() {
129 132
 		$this->out('Bake All');
6  lib/Cake/Console/Command/CommandListShell.php
@@ -98,6 +98,9 @@ protected function _getShellList() {
98 98
 /**
99 99
  * Scan the provided paths for shells, and append them into $shellList
100 100
  *
  101
+ * @param string $type
  102
+ * @param array $shells
  103
+ * @param array $shellList
101 104
  * @return array
102 105
  */
103 106
 	protected function _appendShells($type, $shells, $shellList) {
@@ -111,6 +114,7 @@ protected function _appendShells($type, $shells, $shellList) {
111 114
 /**
112 115
  * Output text.
113 116
  *
  117
+ * @param array $shellList
114 118
  * @return void
115 119
  */
116 120
 	protected function _asText($shellList) {
@@ -146,6 +150,7 @@ protected function _asText($shellList) {
146 150
 /**
147 151
  * Generates the shell list sorted by where the shells are found.
148 152
  *
  153
+ * @param array $shellList
149 154
  * @return void
150 155
  */
151 156
 	protected function _asSorted($shellList) {
@@ -184,6 +189,7 @@ protected function _asSorted($shellList) {
184 189
 /**
185 190
  * Output as XML
186 191
  *
  192
+ * @param array $shellList
187 193
  * @return void
188 194
  */
189 195
 	protected function _asXml($shellList) {
4  lib/Cake/Console/Command/ConsoleShell.php
@@ -47,6 +47,7 @@ class ConsoleShell extends Shell {
47 47
 /**
48 48
  * Override initialize of the Shell
49 49
  *
  50
+ * @return void
50 51
  */
51 52
 	public function initialize() {
52 53
 		App::uses('Dispatcher', 'Routing');
@@ -71,6 +72,7 @@ public function initialize() {
71 72
 /**
72 73
  * Prints the help message
73 74
  *
  75
+ * @return void
74 76
  */
75 77
 	public function help() {
76 78
 		$out  = 'Console help:';
@@ -133,6 +135,8 @@ public function help() {
133 135
 /**
134 136
  * Override main() to handle action
135 137
  *
  138
+ * @param string $command
  139
+ * @return void
136 140
  */
137 141
 	public function main($command = null) {
138 142
 		while (true) {
3  lib/Cake/Console/Command/I18nShell.php
@@ -40,6 +40,7 @@ class I18nShell extends Shell {
40 40
 /**
41 41
  * Override startup of the Shell
42 42
  *
  43
+ * @return mixed
43 44
  */
44 45
 	public function startup() {
45 46
 		$this->_welcome();
@@ -58,6 +59,7 @@ public function startup() {
58 59
 /**
59 60
  * Override main() for help message hook
60 61
  *
  62
+ * @return void
61 63
  */
62 64
 	public function main() {
63 65
 		$this->out(__d('cake_console', '<info>I18n Shell</info>'));
@@ -91,6 +93,7 @@ public function main() {
91 93
 /**
92 94
  * Initialize I18N database.
93 95
  *
  96
+ * @return void
94 97
  */
95 98
 	public function initdb() {
96 99
 		$this->dispatchShell('schema create i18n');
15  lib/Cake/Console/Command/SchemaShell.php
@@ -47,6 +47,7 @@ class SchemaShell extends Shell {
47 47
 /**
48 48
  * Override initialize
49 49
  *
  50
+ * @return string
50 51
  */
51 52
 	public function initialize() {
52 53
 		$this->_welcome();
@@ -57,6 +58,7 @@ public function initialize() {
57 58
 /**
58 59
  * Override startup
59 60
  *
  61
+ * @return void
60 62
  */
61 63
 	public function startup() {
62 64
 		$name = $path = $connection = $plugin = null;
@@ -103,6 +105,7 @@ public function startup() {
103 105
  * Read and output contents of schema object
104 106
  * path to read as second arg
105 107
  *
  108
+ * @return void
106 109
  */
107 110
 	public function view() {
108 111
 		$File = new File($this->Schema->path . DS . $this->params['file']);
@@ -120,6 +123,7 @@ public function view() {
120 123
  * Read database and Write schema object
121 124
  * accepts a connection as first arg or path to save as second arg
122 125
  *
  126
+ * @return void
123 127
  */
124 128
 	public function generate() {
125 129
 		$this->out(__d('cake_console', 'Generating Schema...'));
@@ -197,6 +201,7 @@ public function generate() {
197 201
  * If -write contains a full path name the file will be saved there. If -write only
198 202
  * contains no DS, that will be used as the file name, in the same dir as the schema file.
199 203
  *
  204
+ * @return string
200 205
  */
201 206
 	public function dump() {
202 207
 		$write = false;
@@ -300,6 +305,9 @@ function _loadSchema() {
300 305
  * Create database from Schema object
301 306
  * Should be called via the run method
302 307
  *
  308
+ * @param CakeSchema $Schema
  309
+ * @param string $table
  310
+ * @return void
303 311
  */
304 312
 	function __create($Schema, $table = null) {
305 313
 		$db = ConnectionManager::getDataSource($this->Schema->connection);
@@ -342,6 +350,9 @@ function __create($Schema, $table = null) {
342 350
  * Update database with Schema object
343 351
  * Should be called via the run method
344 352
  *
  353
+ * @param CakeSchema $Schema
  354
+ * @param string $table
  355
+ * @return void
345 356
  */
346 357
 	function __update(&$Schema, $table = null) {
347 358
 		$db = ConnectionManager::getDataSource($this->Schema->connection);
@@ -383,6 +394,10 @@ function __update(&$Schema, $table = null) {
383 394
 /**
384 395
  * Runs sql from __create() or __update()
385 396
  *
  397
+ * @param array $contents
  398
+ * @param string $event
  399
+ * @param CakeSchema $Schema
  400
+ * @return void
386 401
  */
387 402
 	function __run($contents, $event, &$Schema) {
388 403
 		if (empty($contents)) {
9  lib/Cake/Console/Command/Task/ControllerTask.php
@@ -43,6 +43,7 @@ class ControllerTask extends BakeTask {
43 43
 /**
44 44
  * Override initialize
45 45
  *
  46
+ * @return void
46 47
  */
47 48
 	public function initialize() {
48 49
 		$this->path = current(App::path('Controller'));
@@ -51,6 +52,7 @@ public function initialize() {
51 52
 /**
52 53
  * Execution method always used for tasks
53 54
  *
  55
+ * @return void
54 56
  */
55 57
 	public function execute() {
56 58
 		parent::execute();
@@ -203,6 +205,10 @@ protected function _interactive() {
203 205
 /**
204 206
  * Confirm a to be baked controller with the user
205 207
  *
  208
+ * @param string $controllerName
  209
+ * @param string $useDynamicScaffold
  210
+ * @param array $helpers
  211
+ * @param array $components
206 212
  * @return void
207 213
  */
208 214
 	public function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
@@ -299,7 +305,6 @@ public function bakeActions($controllerName, $admin = null, $wannaUseSession = t
299 305
  * @param string $actions Actions to add, or set the whole controller to use $scaffold (set $actions to 'scaffold')
300 306
  * @param array $helpers Helpers to use in controller
301 307
  * @param array $components Components to use in controller
302  
- * @param array $uses Models to use in controller
303 308
  * @return string Baked controller
304 309
  */
305 310
 	public function bake($controllerName, $actions = '', $helpers = null, $components = null) {
@@ -378,7 +383,6 @@ protected function _doPropertyChoices($prompt, $example) {
378 383
  * Outputs and gets the list of possible controllers from database
379 384
  *
380 385
  * @param string $useDbConfig Database configuration name
381  
- * @param boolean $interactive Whether you are using listAll interactively and want options output.
382 386
  * @return array Set of controllers
383 387
  */
384 388
 	public function listAll($useDbConfig = null) {
@@ -462,6 +466,7 @@ public function getOptionParser() {
462 466
 /**
463 467
  * Displays help contents
464 468
  *
  469
+ * @return void
465 470
  */
466 471
 	public function help() {
467 472
 		$this->hr();
4  lib/Cake/Console/Command/Task/DbConfigTask.php
@@ -60,7 +60,7 @@ class DbConfigTask extends Shell {
60 60
 /**
61 61
  * initialization callback
62 62
  *
63  
- * @var string
  63
+ * @return void
64 64
  */
65 65
 	public function initialize() {
66 66
 		$this->path = APP . 'Config' . DS;
@@ -69,6 +69,7 @@ public function initialize() {
69 69
 /**
70 70
  * Execution method always used for tasks
71 71
  *
  72
+ * @return void
72 73
  */
73 74
 	public function execute() {
74 75
 		if (empty($this->args)) {
@@ -197,6 +198,7 @@ protected function _interactive() {
197 198
 /**
198 199
  * Output verification message and bake if it looks good
199 200
  *
  201
+ * @param array $config
200 202
  * @return boolean True if user says it looks good, false otherwise
201 203
  */
202 204
 	protected function _verify($config) {
5  lib/Cake/Console/Command/Task/ExtractTask.php
@@ -377,7 +377,7 @@ protected function _extractValidationMessages() {
377 377
  * @param string $field the name of the field that is being processed
378 378
  * @param array $rules the set of validation rules for the field
379 379
  * @param string $file the file name where this validation rule was found
380  
- * @param string domain default domain to bind the validations to
  380
+ * @param string $domain default domain to bind the validations to
381 381
  * @return void
382 382
  */
383 383
 	protected function _processValidationRules($field, $rules, $file, $domain) {
@@ -433,6 +433,9 @@ protected function _buildFiles() {
433 433
 /**
434 434
  * Prepare a file to be stored
435 435
  *
  436
+ * @param string $domain
  437
+ * @param string $header
  438
+ * @param string $sentence
436 439
  * @return void
437 440
  */
438 441
 	protected function _store($domain, $header, $sentence) {
10  lib/Cake/Console/Command/Task/FixtureTask.php
@@ -50,6 +50,9 @@ class FixtureTask extends BakeTask {
50 50
 /**
51 51
  * Override initialize
52 52
  *
  53
+ * @param ConsoleOutput $stdout A ConsoleOutput object for stdout.
  54
+ * @param ConsoleOutput $stderr A ConsoleOutput object for stderr.
  55
+ * @param ConsoleInput $stdin A ConsoleInput object for stdin.
53 56
  */
54 57
 	public function __construct($stdout = null, $stderr = null, $stdin = null) {
55 58
 		parent::__construct($stdout, $stderr, $stdin);
@@ -236,7 +239,7 @@ public function bake($model, $useTable = false, $importOptions = array()) {
236 239
  * Generate the fixture file, and write to disk
237 240
  *
238 241
  * @param string $model name of the model being generated
239  
- * @param string $fixture Contents of the fixture file.
  242
+ * @param string $otherVars Contents of the fixture file.
240 243
  * @return string Content saved into fixture file.
241 244
  */
242 245
 	public function generateFixtureFile($model, $otherVars) {
@@ -271,7 +274,7 @@ public function getPath() {
271 274
 /**
272 275
  * Generates a string representation of a schema.
273 276
  *
274  
- * @param array $table Table schema array
  277
+ * @param array $tableInfo Table schema array
275 278
  * @return string fields definitions
276 279
  */
277 280
 	protected function _generateSchema($tableInfo) {
@@ -282,7 +285,8 @@ protected function _generateSchema($tableInfo) {
282 285
 /**
283 286
  * Generate String representation of Records
284 287
  *
285  
- * @param array $table Table schema array
  288
+ * @param array $tableInfo Table schema array
  289
+ * @param integer $recordCount
286 290
  * @return array Array of records to use in the fixture.
287 291
  */
288 292
 	protected function _generateRecords($tableInfo, $recordCount = 1) {
11  lib/Cake/Console/Command/Task/ModelTask.php
@@ -66,6 +66,7 @@ class ModelTask extends BakeTask {
66 66
 /**
67 67
  * Override initialize
68 68
  *
  69
+ * @return void
69 70
  */
70 71
 	public function initialize() {
71 72
 		$this->path = current(App::path('Model'));
@@ -74,6 +75,7 @@ public function initialize() {
74 75
 /**
75 76
  * Execution method always used for tasks
76 77
  *
  78
+ * @return void
77 79
  */
78 80
 	public function execute() {
79 81
 		parent::execute();
@@ -127,7 +129,8 @@ public function all() {
127 129
  * Get a model object for a class name.
128 130
  *
129 131
  * @param string $className Name of class you want model to be.
130  
- * @return object Model instance
  132
+ * @param string $table Table name
  133
+ * @return Model Model instance
131 134
  */
132 135
 	protected function &_getModelObject($className, $table = null) {
133 136
 		if (!$table) {
@@ -166,6 +169,7 @@ public function inOptions($options, $prompt = null, $default = null) {
166 169
 /**
167 170
  * Handles interactive baking
168 171
  *
  172
+ * @return boolean
169 173
  */
170 174
 	protected function _interactive() {
171 175
 		$this->hr();
@@ -359,6 +363,7 @@ public function initValidations() {
359 363
  *
360 364
  * @param string $fieldName Name of field to be validated.
361 365
  * @param array $metaData metadata for field
  366
+ * @param string $primaryKey
362 367
  * @return array Array of validation for the field.
363 368
  */
364 369
 	public function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
@@ -717,6 +722,7 @@ protected function _generatePossibleKeys() {
717 722
  *
718 723
  * @param mixed $name Model name or object
719 724
  * @param mixed $data if array and $name is not an object assume bake data, otherwise boolean.
  725
+ * @return string
720 726
  */
721 727
 	public function bake($name, $data = array()) {
722 728
 		if (is_object($name)) {
@@ -752,6 +758,7 @@ public function bake($name, $data = array()) {
752 758
  * Assembles and writes a unit test file
753 759
  *
754 760
  * @param string $className Model class name
  761
+ * @return string
755 762
  */
756 763
 	public function bakeTest($className) {
757 764
 		$this->Test->interactive = $this->interactive;
@@ -764,6 +771,7 @@ public function bakeTest($className) {
764 771
  * outputs the a list of possible models or controllers from database
765 772
  *
766 773
  * @param string $useDbConfig Database configuration name
  774
+ * @return array
767 775
  */
768 776
 	public function listAll($useDbConfig = null) {
769 777
 		$this->_tables = $this->getAllTables($useDbConfig);
@@ -843,6 +851,7 @@ public function getAllTables($useDbConfig = null) {
843 851
 /**
844 852
  * Forces the user to specify the model he wants to bake, and returns the selected model name.
845 853
  *
  854
+ * @param string $useDbConfig Database config name
846 855
  * @return string the model name
847 856
  */
848 857
 	public function getName($useDbConfig = null) {
8  lib/Cake/Console/Command/Task/PluginTask.php
@@ -65,10 +65,11 @@ public function execute() {
65 65
 /**
66 66
  * Interactive interface
67 67
  *
  68
+ * @param string $plugin
68 69
  * @return void
69 70
  */
70 71
 	protected function _interactive($plugin = null) {
71  
-		while ($plugin === null) {
  72
+		if ($plugin === null) {
72 73
 			$plugin = $this->in(__d('cake_console', 'Enter the name of the plugin in CamelCase format'));
73 74
 		}
74 75
 
@@ -80,8 +81,8 @@ protected function _interactive($plugin = null) {
80 81
 /**
81 82
  * Bake the plugin, create directories and files
82 83
  *
83  
- * @params $plugin name of the plugin in CamelCased format
84  
- * @return bool
  84
+ * @param string $plugin Name of the plugin in CamelCased format
  85
+ * @return boolean
85 86
  */
86 87
 	public function bake($plugin) {
87 88
 		$pathOptions = App::path('plugins');
@@ -154,6 +155,7 @@ public function bake($plugin) {
154 155
 /**
155 156
  * find and change $this->path to the user selection
156 157
  *
  158
+ * @param array $pathOptions
157 159
  * @return string plugin path
158 160
  */
159 161
 	public function findPath($pathOptions) {
3  lib/Cake/Console/Command/Task/ProjectTask.php
@@ -40,7 +40,7 @@ class ProjectTask extends Shell {
40 40
  * Checks that given project path does not already exist, and
41 41
  * finds the app directory in it. Then it calls bake() with that information.
42 42
  *
43  
- * @param string $project Project path
  43
+ * @return mixed
44 44
  */
45 45
 	public function execute() {
46 46
 		$project = null;
@@ -137,6 +137,7 @@ public function execute() {
137 137
  * @param string $path Project path
138 138
  * @param string $skel Path to copy from
139 139
  * @param string $skip array of directories to skip when copying
  140
+ * @return mixed
140 141
  */
141 142
 	public function bake($path, $skel = null, $skip = array('empty')) {
142 143
 		if (!$skel && !empty($this->params['skel'])) {
11  lib/Cake/Console/Command/Task/TestTask.php
@@ -56,13 +56,14 @@ class TestTask extends BakeTask {
56 56
 /**
57 57
  * Internal list of fixtures that have been added so far.
58 58
  *
59  
- * @var string
  59
+ * @var array
60 60
  */
61 61
 	protected $_fixtures = array();
62 62
 
63 63
 /**
64 64
  * Execution method always used for tasks
65 65
  *
  66
+ * @return void
66 67
  */
67 68
 	public function execute() {
68 69
 		parent::execute();
@@ -85,6 +86,8 @@ public function execute() {
85 86
 /**
86 87
  * Handles interactive baking
87 88
  *
  89
+ * @param string $type
  90
+ * @return string|boolean
88 91
  */
89 92
 	protected function _interactive($type = null) {
90 93
 		$this->interactive = true;
@@ -110,6 +113,7 @@ protected function _interactive($type = null) {
110 113
  *
111 114
  * @param string $type Type of object to bake test case for ie. Model, Controller
112 115
  * @param string $className the 'cake name' for the class ie. Posts for the PostsController
  116
+ * @return string|boolean
113 117
  */
114 118
 	public function bake($type, $className) {
115 119
 		if ($this->typeCanDetectFixtures($type) && $this->isLoadableClass($type, $className)) {
@@ -215,7 +219,6 @@ public function getClassName($objectType) {
215 219
  * Currently only model, and controller are supported
216 220
  *
217 221
  * @param string $type The Type of object you are generating tests for eg. controller
218  
- * @param string $className the Classname of the class the test is being generated for.
219 222
  * @return boolean
220 223
  */
221 224
 	public function typeCanDetectFixtures($type) {
@@ -227,7 +230,7 @@ public function typeCanDetectFixtures($type) {
227 230
  * Check if a class with the given type is loaded or can be loaded.
228 231
  *
229 232
  * @param string $type The Type of object you are generating tests for eg. controller
230  
- * @param string $className the Classname of the class the test is being generated for.
  233
+ * @param string $class the Classname of the class the test is being generated for.
231 234
  * @return boolean
232 235
  */
233 236
 	public function isLoadableClass($type, $class) {
@@ -398,7 +401,7 @@ public function hasMockClass($type) {
398 401
  * Generate a constructor code snippet for the type and classname
399 402
  *
400 403
  * @param string $type The Type of object you are generating tests for eg. controller
401  
- * @param string $className the Classname of the class the test is being generated for.
  404
+ * @param string $fullClassName The Classname of the class the test is being generated for.
402 405
  * @return string Constructor snippet for the thing you are building.
403 406
  */
404 407
 	public function generateConstructor($type, $fullClassName) {
7  lib/Cake/Console/Command/Task/ViewTask.php
@@ -72,6 +72,7 @@ class ViewTask extends BakeTask {
72 72
 /**
73 73
  * Override initialize
74 74
  *
  75
+ * @return void
75 76
  */
76 77
 	public function initialize() {
77 78
 		$this->path = current(App::path('View'));
@@ -80,6 +81,7 @@ public function initialize() {
80 81
 /**
81 82
  * Execution method always used for tasks
82 83
  *
  84
+ * @return mixed
83 85
  */
84 86
 	public function execute() {
85 87
 		parent::execute();
@@ -188,6 +190,7 @@ public function all() {
188 190
 /**
189 191
  * Handles interactive baking
190 192
  *
  193
+ * @return void
191 194
  */
192 195
 	protected function _interactive() {
193 196
 		$this->hr();
@@ -295,6 +298,7 @@ private function __loadController() {
295 298
  * Bake a view file for each of the supplied actions
296 299
  *
297 300
  * @param array $actions Array of actions to make files for.
  301
+ * @param array $vars
298 302
  * @return void
299 303
  */
300 304
 	public function bakeActions($actions, $vars) {
@@ -436,7 +440,8 @@ public function getOptionParser() {
436 440
 /**
437 441
  * Returns associations for controllers models.
438 442
  *
439  
- * @return  array $associations
  443
+ * @param Model $model
  444
+ * @return array $associations
440 445
  */
441 446
 	private function __associations($model) {
442 447
 		$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
6  lib/Cake/Console/ConsoleErrorHandler.php
@@ -30,16 +30,14 @@ class ConsoleErrorHandler extends ErrorHandler {
30 30
 /**
31 31
  * Standard error stream.
32 32
  *
33  
- * @var filehandle
34  
- * @access public
  33
+ * @var ConsoleOutput
35 34
  */
36 35
 	public static $stderr;
37 36
 
38 37
 /**
39 38
  * Get the stderr object for the console error handling.
40 39
  *
41  
- * @param Exception $error Exception to handle.
42  
- * @param array $messages Error messages
  40
+ * @return ConsoleOutput
43 41
  */
44 42
 	public static function getStderr() {
45 43
 		if (empty(self::$stderr)) {
4  lib/Cake/Console/ConsoleInputArgument.php
@@ -131,7 +131,9 @@ public function isRequired() {
131 131
 /**
132 132
  * Check that $value is a valid choice for this argument.
133 133
  *
  134
+ * @param string $value
134 135
  * @return boolean
  136
+ * @throws ConsoleException
135 137
  */
136 138
 	public function validChoice($value) {
137 139
 		if (empty($this->_choices)) {
@@ -149,7 +151,7 @@ public function validChoice($value) {
149 151
 /**
150 152
  * Append this arguments XML representation to the passed in SimpleXml object.
151 153
  *
152  
- * @param SimpleXmlElement The parent element.
  154
+ * @param SimpleXmlElement $parent The parent element.
153 155
  * @return SimpleXmlElement The parent with this argument appended.
154 156
  */
155 157
 	public function xml(SimpleXmlElement $parent) {
4  lib/Cake/Console/ConsoleInputOption.php
@@ -171,7 +171,9 @@ public function isBoolean() {
171 171
 /**
172 172
  * Check that a value is a valid choice for this option.
173 173
  *
  174
+ * @param string $value
174 175
  * @return boolean
  176
+ * @throws ConsoleException
175 177
  */
176 178
 	public function validChoice($value) {
177 179
 		if (empty($this->_choices)) {
@@ -189,7 +191,7 @@ public function validChoice($value) {
189 191
 /**
190 192
  * Append the option's xml into the parent.
191 193
  *
192  
- * @param SimpleXmlElement The parent element.
  194
+ * @param SimpleXmlElement $parent The parent element.
193 195
  * @return SimpleXmlElement The parent with this option appended.
194 196
  */
195 197
 	public function xml(SimpleXmlElement $parent) {
2  lib/Cake/Console/ConsoleInputSubcommand.php
@@ -108,7 +108,7 @@ public function parser() {
108 108
 /**
109 109
  * Append this subcommand to the Parent element
110 110
  *
111  
- * @param SimpleXmlElement The parent element.
  111
+ * @param SimpleXmlElement $parent The parent element.
112 112
  * @return SimpleXmlElement The parent with this subcommand appended.
113 113
  */
114 114
 	public function xml(SimpleXmlElement $parent) {
19  lib/Cake/Console/ConsoleOptionParser.php
@@ -267,8 +267,8 @@ public function epilog($text = null) {
267 267
  *
268 268
  * @param mixed $name The long name you want to the value to be parsed out as when options are parsed.
269 269
  *   Will also accept an instance of ConsoleInputOption
270  
- * @param array $params An array of parameters that define the behavior of the option
271  
- * @return returns $this.
  270
+ * @param array $options An array of parameters that define the behavior of the option
  271
+ * @return ConsoleOptionParser $this.
272 272
  */
273 273
 	public function addOption($name, $options = array()) {
274 274
 		if (is_object($name) && $name instanceof ConsoleInputOption) {
@@ -308,7 +308,7 @@ public function addOption($name, $options = array()) {
308 308
  *
309 309
  * @param mixed $name The name of the argument.  Will also accept an instance of ConsoleInputArgument
310 310
  * @param array $params Parameters for the argument, see above.
311  
- * @return $this.
  311
+ * @return ConsoleOptionParser $this.
312 312
  */
313 313
 	public function addArgument($name, $params = array()) {
314 314
 		if (is_object($name) && $name instanceof ConsoleInputArgument) {
@@ -337,7 +337,7 @@ public function addArgument($name, $params = array()) {
337 337
  *
338 338
  * @param array $args Array of arguments to add.
339 339
  * @see ConsoleOptionParser::addArgument()
340  
- * @return $this
  340
+ * @return ConsoleOptionParser $this
341 341
  */
342 342
 	public function addArguments(array $args) {
343 343
 		foreach ($args as $name => $params) {
@@ -352,7 +352,7 @@ public function addArguments(array $args) {
352 352
  *
353 353
  * @param array $options Array of options to add.
354 354
  * @see ConsoleOptionParser::addOption()
355  
- * @return $this
  355
+ * @return ConsoleOptionParser $this
356 356
  */
357 357
 	public function addOptions(array $options) {
358 358
 		foreach ($options as $name => $params) {
@@ -373,8 +373,8 @@ public function addOptions(array $options) {
373 373
  *    it will be used.
374 374
  *
375 375
  * @param mixed $name Name of the subcommand. Will also accept an instance of ConsoleInputSubcommand
376  
- * @param array $params Array of params, see above.
377  
- * @return $this.
  376
+ * @param array $options Array of params, see above.
  377
+ * @return ConsoleOptionParser $this.
378 378
  */
379 379
 	public function addSubcommand($name, $options = array()) {
380 380
 		if (is_object($name) && $name instanceof ConsoleInputSubcommand) {
@@ -397,7 +397,7 @@ public function addSubcommand($name, $options = array()) {
397 397
  * Add multiple subcommands at once.
398 398
  *
399 399
  * @param array $commands Array of subcommands.
400  
- * @return $this
  400
+ * @return ConsoleOptionParser $this
401 401
  */
402 402
 	public function addSubcommands(array $commands) {
403 403
 		foreach ($commands as $name => $params) {
@@ -489,6 +489,7 @@ public function parse($argv, $command = null) {
489 489
  *
490 490
  * @param string $subcommand If present and a valid subcommand that has a linked parser.
491 491
  *    That subcommands help will be shown instead.
  492
+ * @param string $format Define the output format, can be text or xml
492 493
  * @param int $width The width to format user content to. Defaults to 72
493 494
  * @return string Generated help.
494 495
  */
@@ -551,7 +552,7 @@ protected function _parseShortOption($option, $params) {
551 552
 /**
552 553
  * Parse an option by its name index.
553 554
  *
554  
- * @param string $option The option to parse.
  555
+ * @param string $name The name to parse.
555 556
  * @param array $params The params to append the parsed value into
556 557
  * @return array Params with $option added in.
557 558
  */
1  lib/Cake/Console/HelpFormatter.php
@@ -134,6 +134,7 @@ protected function _generateUsage() {
134 134
 /**
135 135
  * Iterate over a collection and find the longest named thing.
136 136
  *
  137
+ * @param array $collection
137 138
  * @return integer
138 139
  */
139 140
 	protected function _getMaxLength($collection) {
14  lib/Cake/Console/Shell.php
@@ -310,9 +310,7 @@ public function hasMethod($name) {
310 310
  *
311 311
  * `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');`
312 312
  *
313  
- * @param mixed $command Either an array of args similar to $argv. Or a string command, that can be
314  
- *   exploded on space to simulate argv.
315  
- * @return mixed. The return of the other shell.
  313
+ * @return mixed The return of the other shell.
316 314
  */
317 315
 	public function dispatchShell() {
318 316
 		$args = func_get_args();
@@ -383,6 +381,7 @@ public function runCommand($command, $argv) {
383 381
 /**
384 382
  * Display the help in the correct format
385 383
  *
  384
+ * @param string $command
386 385
  * @return void
387 386
  */
388 387
 	protected function _displayHelp($command) {
@@ -410,7 +409,8 @@ public function getOptionParser() {
410 409
 /**
411 410
  * Overload get for lazy building of tasks
412 411
  *
413  
- * @return void
  412
+ * @param string $name
  413
+ * @return Shell Object of Task
414 414
  */
415 415
 	public function __get($name) {
416 416
 		if (empty($this->{$name}) && in_array($name, $this->taskNames)) {
@@ -523,7 +523,7 @@ public function wrapText($text, $options = array()) {
523 523
  * @param mixed $message A string or a an array of strings to output
524 524
  * @param integer $newlines Number of newlines to append
525 525
  * @param integer $level The message's output level, see above.
526  
- * @return integer Returns the number of bytes returned from writing to stdout.
  526
+ * @return integer|boolean Returns the number of bytes returned from writing to stdout.
527 527
  */
528 528
 	public function out($message = null, $newlines = 1, $level = Shell::NORMAL) {
529 529
 		$currentLevel = Shell::NORMAL;
@@ -545,6 +545,7 @@ public function out($message = null, $newlines = 1, $level = Shell::NORMAL) {
545 545
  *
546 546
  * @param mixed $message A string or a an array of strings to output
547 547
  * @param integer $newlines Number of newlines to append
  548
+ * @return void
548 549
  */
549 550
 	public function err($message = null, $newlines = 1) {
550 551
 		$this->stderr->write($message, $newlines);
@@ -554,7 +555,6 @@ public function err($message = null, $newlines = 1) {
554 555
  * Returns a single or multiple linefeeds sequences.
555 556
  *
556 557
  * @param integer $multiplier Number of times the linefeed sequence should be repeated
557  
- * @access public
558 558
  * @return string
559 559
  */
560 560
 	public function nl($multiplier = 1) {
@@ -566,6 +566,7 @@ public function nl($multiplier = 1) {
566 566
  *
567 567
  * @param integer $newlines Number of newlines to pre- and append
568 568
  * @param integer $width Width of the line, defaults to 63
  569
+ * @return void
569 570
  */
570 571
 	public function hr($newlines = 0, $width = 63) {
571 572
 		$this->out(null, $newlines);
@@ -579,6 +580,7 @@ public function hr($newlines = 0, $width = 63) {
579 580
  *
580 581
  * @param string $title Title of the error
581 582
  * @param string $message An optional error message
  583
+ * @return void
582 584
  */
583 585
 	public function error($title, $message = null) {
584 586
 		$this->err(__d('cake_console', '<error>Error:</error> %s', $title));
10  lib/Cake/Console/ShellDispatcher.php
@@ -198,8 +198,8 @@ public function dispatch() {
198 198
  * All paths in the loaded shell paths are searched.
199 199
  *
200 200
  * @param string $shell Optionally the name of a plugin
201  
- * @return mixed False if no shell could be found or an object on success
202  
- * @throws MissingShellFileException, MissingShellClassException when errors are encountered.
  201
+ * @return mixed An object
  202
+ * @throws MissingShellFileException when errors are encountered.
203 203
  */
204 204
 	protected function _getShell($shell) {
205 205
 		list($plugin, $shell) = pluginSplit($shell, true);
@@ -221,7 +221,8 @@ protected function _getShell($shell) {
221 221
 /**
222 222
  * Parses command line options and extracts the directory paths from $params
223 223
  *
224  
- * @param array $params Parameters to parse
  224
+ * @param array $args Parameters to parse
  225
+ * @return void
225 226
  */
226 227
 	public function parseParams($args) {
227 228
 		$this->_parsePaths($args);
@@ -276,6 +277,7 @@ public function parseParams($args) {
276 277
 /**
277 278
  * Parses out the paths from from the argv
278 279
  *
  280
+ * @param array $args
279 281
  * @return void
280 282
  */
281 283
 	protected function _parsePaths($args) {
@@ -316,7 +318,7 @@ public function help() {
316 318
 /**
317 319
  * Stop execution of the current script
318 320
  *
319  
- * @param $status see http://php.net/exit for values
  321
+ * @param integer|string $status see http://php.net/exit for values
320 322
  * @return void
321 323
  */
322 324
 	protected function _stop($status = 0) {
4  lib/Cake/Console/TaskCollection.php
@@ -27,7 +27,7 @@ class TaskCollection extends ObjectCollection {
27 27
 /**
28 28
  * Shell to use to set params to tasks.
29 29
  *
30  
- * @var array
  30
+ * @var Shell
31 31
  */
32 32
 	protected $_Shell;
33 33
 
@@ -41,7 +41,7 @@ class TaskCollection extends ObjectCollection {
41 41
 /**
42 42
  * Constructor
43 43
  *
44  
- * @param array $paths Array of paths to search for tasks on .
  44
+ * @param Shell $Shell
45 45
  * @return void
46 46
  */
47 47
 	public function __construct(Shell $Shell) {
3  lib/Cake/Core/App.php
@@ -527,6 +527,7 @@ public static function objects($type, $path = null, $cache = true) {
527 527
  *
528 528
  * @param string $className the name of the class to configure package for
529 529
  * @param string $location the package name
  530
+ * @return void
530 531
  */
531 532
 	public static function uses($className, $location) {
532 533
 		self::$__classMap[$className] = $location;
@@ -539,6 +540,7 @@ public static function uses($className, $location) {
539 540
  * if a class is name `MyCustomClass` the file name should be `MyCustomClass.php`
540 541
  *
541 542
  * @param string $className the name of the class to load
  543
+ * @return boolean
542 544
  */
543 545
 	public static function load($className) {
544 546
 		if (!isset(self::$__classMap[$className])) {
@@ -676,7 +678,6 @@ public static function import($type = null, $name = null, $parent = true, $searc
676 678
  * @param string $name unique name of the file for identifying it inside the application
677 679
  * @param string $plugin camel cased plugin name if any
678 680
  * @param string $type name of the packed where the class is located
679  
- * @param string $file filename if known, the $name param will be used otherwise
680 681
  * @param string $originalType type name as supplied initially by the user
681 682
  * @param boolean $parent whether to load the class parent or not
682 683
  * @return boolean true indicating the successful load and existence of the class
2  lib/Cake/Core/Object.php
@@ -122,7 +122,7 @@ public function dispatchMethod($method, $params = array()) {
122 122
  * Stop execution of the current script.  Wraps exit() making
123 123
  * testing easier.
124 124
  *
125  
- * @param $status see http://php.net/exit for values
  125
+ * @param integer|string $status see http://php.net/exit for values
126 126
  * @return void
127 127
  */
128 128
 	protected function _stop($status = 0) {
1  lib/Cake/Error/ErrorHandler.php
@@ -103,6 +103,7 @@ class ErrorHandler {
103 103
  * This will either use an AppError class if your application has one,
104 104
  * or use the default ExceptionRenderer.
105 105
  *
  106
+ * @param Exception $exception
106 107
  * @return void
107 108
  * @see http://php.net/manual/en/function.set-exception-handler.php
108 109
  */
2  lib/Cake/Log/CakeLog.php
@@ -127,7 +127,7 @@ public static function configured() {
127 127
  * Removes a stream from the active streams.  Once a stream has been removed
128 128
  * it will no longer have messages sent to it.
129 129
  *
130  
- * @param string $keyname Key name of a configured stream to remove.
  130
+ * @param string $streamName Key name of a configured stream to remove.
131 131
  * @return void
132 132
  */
133 133
 	public static function drop($streamName) {
1  lib/Cake/Utility/ObjectCollection.php
@@ -226,6 +226,7 @@ public function unload($name) {
226 226
  *
227 227
  * @param string $name Name of the object
228 228
  * @param Object $object The object to use
  229
+ * @return array Loaded objects
229 230
  */
230 231
 	public function set($name = null, $object = null) {
231 232
 		if (!empty($name) && !empty($object)) {

0 notes on commit a0ee8b4

José Lorenzo Rodríguez

What happens if the user enters an empty string twice?

Juan Basso

Will change the behavior... I reverted that change.

Renan Gonçalves

One little typo in here.

Mark Story

Shell::in() should loop as long as the user input is ''. I'm not sure the extra while is needed. One way to find out is to run the shell.

Juan Basso

Thanks! I will fix in my next push.

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