Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed some API doc in console.

  • Loading branch information...
commit a0ee8b49feed1d49c30af90ae99d688e8a01059e 1 parent f9373ff
@jrbasso jrbasso authored
Showing with 140 additions and 51 deletions.
  1. +12 −2 lib/Cake/Console/Command/AclShell.php
  2. +4 −1 lib/Cake/Console/Command/ApiShell.php
  3. +3 −0  lib/Cake/Console/Command/BakeShell.php
  4. +6 −0 lib/Cake/Console/Command/CommandListShell.php
  5. +4 −0 lib/Cake/Console/Command/ConsoleShell.php
  6. +3 −0  lib/Cake/Console/Command/I18nShell.php
  7. +15 −0 lib/Cake/Console/Command/SchemaShell.php
  8. +7 −2 lib/Cake/Console/Command/Task/ControllerTask.php
  9. +3 −1 lib/Cake/Console/Command/Task/DbConfigTask.php
  10. +4 −1 lib/Cake/Console/Command/Task/ExtractTask.php
  11. +7 −3 lib/Cake/Console/Command/Task/FixtureTask.php
  12. +10 −1 lib/Cake/Console/Command/Task/ModelTask.php
  13. +5 −3 lib/Cake/Console/Command/Task/PluginTask.php
  14. +2 −1  lib/Cake/Console/Command/Task/ProjectTask.php
  15. +7 −4 lib/Cake/Console/Command/Task/TestTask.php
  16. +6 −1 lib/Cake/Console/Command/Task/ViewTask.php
  17. +2 −4 lib/Cake/Console/ConsoleErrorHandler.php
  18. +3 −1 lib/Cake/Console/ConsoleInputArgument.php
  19. +3 −1 lib/Cake/Console/ConsoleInputOption.php
  20. +1 −1  lib/Cake/Console/ConsoleInputSubcommand.php
  21. +10 −9 lib/Cake/Console/ConsoleOptionParser.php
  22. +1 −0  lib/Cake/Console/HelpFormatter.php
  23. +8 −6 lib/Cake/Console/Shell.php
  24. +6 −4 lib/Cake/Console/ShellDispatcher.php
  25. +2 −2 lib/Cake/Console/TaskCollection.php
  26. +2 −1  lib/Cake/Core/App.php
  27. +1 −1  lib/Cake/Core/Object.php
  28. +1 −0  lib/Cake/Error/ErrorHandler.php
  29. +1 −1  lib/Cake/Log/CakeLog.php
  30. +1 −0  lib/Cake/Utility/ObjectCollection.php
View
14 lib/Cake/Console/Command/AclShell.php
@@ -58,6 +58,7 @@ class AclShell extends Shell {
/**
* Override startup of the Shell
*
+ * @return void
*/
public function startup() {
parent::startup();
@@ -96,6 +97,7 @@ public function startup() {
/**
* Override main() for help message hook
*
+ * @return voids
@renan Collaborator
renan added a note

One little typo in here.

@jrbasso Collaborator
jrbasso added a note

Thanks! I will fix in my next push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
*/
public function main() {
$this->out($this->OptionParser->help());
@@ -104,6 +106,7 @@ public function main() {
/**
* Creates an ARO/ACO node
*
+ * @return void
*/
public function create() {
extract($this->__dataVars());
@@ -136,6 +139,7 @@ public function create() {
/**
* Delete an ARO/ACO node.
*
+ * @return void
*/
public function delete() {
extract($this->__dataVars());
@@ -152,6 +156,7 @@ public function delete() {
/**
* Set parent for an ARO/ACO node.
*
+ * @return void
*/
public function setParent() {
extract($this->__dataVars());
@@ -175,6 +180,7 @@ public function setParent() {
/**
* Get path to specified ARO/ACO node.
*
+ * @return void
*/
public function getPath() {
extract($this->__dataVars());
@@ -217,6 +223,7 @@ protected function _outputNode($class, $node, $indent) {
/**
* Check permission for a given ARO to a given ACO.
*
+ * @return void
*/
public function check() {
extract($this->__getParams());
@@ -231,6 +238,7 @@ public function check() {
/**
* Grant permission for a given ARO to a given ACO.
*
+ * @return void
*/
public function grant() {
extract($this->__getParams());
@@ -245,6 +253,7 @@ public function grant() {
/**
* Deny access for an ARO to an ACO.
*
+ * @return void
*/
public function deny() {
extract($this->__getParams());
@@ -259,6 +268,7 @@ public function deny() {
/**
* Set an ARO to inherit permission to an ACO.
*
+ * @return void
*/
public function inherit() {
extract($this->__getParams());
@@ -273,6 +283,7 @@ public function inherit() {
/**
* Show a specific ARO/ACO node.
*
+ * @return void
*/
public function view() {
extract($this->__dataVars());
@@ -332,6 +343,7 @@ public function view() {
/**
* Initialize ACL database.
*
+ * @return mixed
*/
public function initdb() {
return $this->dispatchShell('schema create DbAcl');
@@ -493,8 +505,6 @@ public function getOptionParser() {
/**
* Checks that given node exists
*
- * @param string $type Node type (ARO/ACO)
- * @param integer $id Node id
* @return boolean Success
*/
public function nodeExists() {
View
5 lib/Cake/Console/Command/ApiShell.php
@@ -36,6 +36,7 @@ class ApiShell extends Shell {
/**
* Override initialize of the Shell
*
+ * @return void
*/
public function initialize() {
$this->paths = array_merge($this->paths, array(
@@ -53,6 +54,7 @@ public function initialize() {
/**
* Override main() to handle action
*
+ * @return void
*/
public function main() {
if (empty($this->args)) {
@@ -150,6 +152,7 @@ public function getOptionParser() {
/**
* Show help for this shell.
*
+ * @return void
*/
public function help() {
$head = "Usage: cake api [<type>] <className> [-m <method>]\n";
@@ -187,7 +190,7 @@ public function help() {
* Parse a given class (located on given file) and get public methods and their
* signatures.
*
- * @param object $File File object
+ * @param string $path File path
* @param string $class Class name
* @return array Methods and signatures indexed by method name
*/
View
3  lib/Cake/Console/Command/BakeShell.php
@@ -47,6 +47,7 @@ class BakeShell extends Shell {
/**
* Assign $this->connection to the active task if a connection param is set.
*
+ * @return void
*/
public function startup() {
parent::startup();
@@ -61,6 +62,7 @@ public function startup() {
/**
* Override main() to handle action
*
+ * @return mixed
*/
public function main() {
if (!is_dir($this->DbConfig->path)) {
@@ -124,6 +126,7 @@ public function main() {
/**
* Quickly bake the MVC
*
+ * @return void
*/
public function all() {
$this->out('Bake All');
View
6 lib/Cake/Console/Command/CommandListShell.php
@@ -98,6 +98,9 @@ protected function _getShellList() {
/**
* Scan the provided paths for shells, and append them into $shellList
*
+ * @param string $type
+ * @param array $shells
+ * @param array $shellList
* @return array
*/
protected function _appendShells($type, $shells, $shellList) {
@@ -111,6 +114,7 @@ protected function _appendShells($type, $shells, $shellList) {
/**
* Output text.
*
+ * @param array $shellList
* @return void
*/
protected function _asText($shellList) {
@@ -146,6 +150,7 @@ protected function _asText($shellList) {
/**
* Generates the shell list sorted by where the shells are found.
*
+ * @param array $shellList
* @return void
*/
protected function _asSorted($shellList) {
@@ -184,6 +189,7 @@ protected function _asSorted($shellList) {
/**
* Output as XML
*
+ * @param array $shellList
* @return void
*/
protected function _asXml($shellList) {
View
4 lib/Cake/Console/Command/ConsoleShell.php
@@ -47,6 +47,7 @@ class ConsoleShell extends Shell {
/**
* Override initialize of the Shell
*
+ * @return void
*/
public function initialize() {
App::uses('Dispatcher', 'Routing');
@@ -71,6 +72,7 @@ public function initialize() {
/**
* Prints the help message
*
+ * @return void
*/
public function help() {
$out = 'Console help:';
@@ -133,6 +135,8 @@ public function help() {
/**
* Override main() to handle action
*
+ * @param string $command
+ * @return void
*/
public function main($command = null) {
while (true) {
View
3  lib/Cake/Console/Command/I18nShell.php
@@ -40,6 +40,7 @@ class I18nShell extends Shell {
/**
* Override startup of the Shell
*
+ * @return mixed
*/
public function startup() {
$this->_welcome();
@@ -58,6 +59,7 @@ public function startup() {
/**
* Override main() for help message hook
*
+ * @return void
*/
public function main() {
$this->out(__d('cake_console', '<info>I18n Shell</info>'));
@@ -91,6 +93,7 @@ public function main() {
/**
* Initialize I18N database.
*
+ * @return void
*/
public function initdb() {
$this->dispatchShell('schema create i18n');
View
15 lib/Cake/Console/Command/SchemaShell.php
@@ -47,6 +47,7 @@ class SchemaShell extends Shell {
/**
* Override initialize
*
+ * @return string
*/
public function initialize() {
$this->_welcome();
@@ -57,6 +58,7 @@ public function initialize() {
/**
* Override startup
*
+ * @return void
*/
public function startup() {
$name = $path = $connection = $plugin = null;
@@ -103,6 +105,7 @@ public function startup() {
* Read and output contents of schema object
* path to read as second arg
*
+ * @return void
*/
public function view() {
$File = new File($this->Schema->path . DS . $this->params['file']);
@@ -120,6 +123,7 @@ public function view() {
* Read database and Write schema object
* accepts a connection as first arg or path to save as second arg
*
+ * @return void
*/
public function generate() {
$this->out(__d('cake_console', 'Generating Schema...'));
@@ -197,6 +201,7 @@ public function generate() {
* If -write contains a full path name the file will be saved there. If -write only
* contains no DS, that will be used as the file name, in the same dir as the schema file.
*
+ * @return string
*/
public function dump() {
$write = false;
@@ -300,6 +305,9 @@ function _loadSchema() {
* Create database from Schema object
* Should be called via the run method
*
+ * @param CakeSchema $Schema
+ * @param string $table
+ * @return void
*/
function __create($Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
@@ -342,6 +350,9 @@ function __create($Schema, $table = null) {
* Update database with Schema object
* Should be called via the run method
*
+ * @param CakeSchema $Schema
+ * @param string $table
+ * @return void
*/
function __update(&$Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
@@ -383,6 +394,10 @@ function __update(&$Schema, $table = null) {
/**
* Runs sql from __create() or __update()
*
+ * @param array $contents
+ * @param string $event
+ * @param CakeSchema $Schema
+ * @return void
*/
function __run($contents, $event, &$Schema) {
if (empty($contents)) {
View
9 lib/Cake/Console/Command/Task/ControllerTask.php
@@ -43,6 +43,7 @@ class ControllerTask extends BakeTask {
/**
* Override initialize
*
+ * @return void
*/
public function initialize() {
$this->path = current(App::path('Controller'));
@@ -51,6 +52,7 @@ public function initialize() {
/**
* Execution method always used for tasks
*
+ * @return void
*/
public function execute() {
parent::execute();
@@ -203,6 +205,10 @@ protected function _interactive() {
/**
* Confirm a to be baked controller with the user
*
+ * @param string $controllerName
+ * @param string $useDynamicScaffold
+ * @param array $helpers
+ * @param array $components
* @return void
*/
public function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
@@ -299,7 +305,6 @@ public function bakeActions($controllerName, $admin = null, $wannaUseSession = t
* @param string $actions Actions to add, or set the whole controller to use $scaffold (set $actions to 'scaffold')
* @param array $helpers Helpers to use in controller
* @param array $components Components to use in controller
- * @param array $uses Models to use in controller
* @return string Baked controller
*/
public function bake($controllerName, $actions = '', $helpers = null, $components = null) {
@@ -378,7 +383,6 @@ protected function _doPropertyChoices($prompt, $example) {
* Outputs and gets the list of possible controllers from database
*
* @param string $useDbConfig Database configuration name
- * @param boolean $interactive Whether you are using listAll interactively and want options output.
* @return array Set of controllers
*/
public function listAll($useDbConfig = null) {
@@ -462,6 +466,7 @@ public function getOptionParser() {
/**
* Displays help contents
*
+ * @return void
*/
public function help() {
$this->hr();
View
4 lib/Cake/Console/Command/Task/DbConfigTask.php
@@ -60,7 +60,7 @@ class DbConfigTask extends Shell {
/**
* initialization callback
*
- * @var string
+ * @return void
*/
public function initialize() {
$this->path = APP . 'Config' . DS;
@@ -69,6 +69,7 @@ public function initialize() {
/**
* Execution method always used for tasks
*
+ * @return void
*/
public function execute() {
if (empty($this->args)) {
@@ -197,6 +198,7 @@ protected function _interactive() {
/**
* Output verification message and bake if it looks good
*
+ * @param array $config
* @return boolean True if user says it looks good, false otherwise
*/
protected function _verify($config) {
View
5 lib/Cake/Console/Command/Task/ExtractTask.php
@@ -377,7 +377,7 @@ protected function _extractValidationMessages() {
* @param string $field the name of the field that is being processed
* @param array $rules the set of validation rules for the field
* @param string $file the file name where this validation rule was found
- * @param string domain default domain to bind the validations to
+ * @param string $domain default domain to bind the validations to
* @return void
*/
protected function _processValidationRules($field, $rules, $file, $domain) {
@@ -433,6 +433,9 @@ protected function _buildFiles() {
/**
* Prepare a file to be stored
*
+ * @param string $domain
+ * @param string $header
+ * @param string $sentence
* @return void
*/
protected function _store($domain, $header, $sentence) {
View
10 lib/Cake/Console/Command/Task/FixtureTask.php
@@ -50,6 +50,9 @@ class FixtureTask extends BakeTask {
/**
* Override initialize
*
+ * @param ConsoleOutput $stdout A ConsoleOutput object for stdout.
+ * @param ConsoleOutput $stderr A ConsoleOutput object for stderr.
+ * @param ConsoleInput $stdin A ConsoleInput object for stdin.
*/
public function __construct($stdout = null, $stderr = null, $stdin = null) {
parent::__construct($stdout, $stderr, $stdin);
@@ -236,7 +239,7 @@ public function bake($model, $useTable = false, $importOptions = array()) {
* Generate the fixture file, and write to disk
*
* @param string $model name of the model being generated
- * @param string $fixture Contents of the fixture file.
+ * @param string $otherVars Contents of the fixture file.
* @return string Content saved into fixture file.
*/
public function generateFixtureFile($model, $otherVars) {
@@ -271,7 +274,7 @@ public function getPath() {
/**
* Generates a string representation of a schema.
*
- * @param array $table Table schema array
+ * @param array $tableInfo Table schema array
* @return string fields definitions
*/
protected function _generateSchema($tableInfo) {
@@ -282,7 +285,8 @@ protected function _generateSchema($tableInfo) {
/**
* Generate String representation of Records
*
- * @param array $table Table schema array
+ * @param array $tableInfo Table schema array
+ * @param integer $recordCount
* @return array Array of records to use in the fixture.
*/
protected function _generateRecords($tableInfo, $recordCount = 1) {
View
11 lib/Cake/Console/Command/Task/ModelTask.php
@@ -66,6 +66,7 @@ class ModelTask extends BakeTask {
/**
* Override initialize
*
+ * @return void
*/
public function initialize() {
$this->path = current(App::path('Model'));
@@ -74,6 +75,7 @@ public function initialize() {
/**
* Execution method always used for tasks
*
+ * @return void
*/
public function execute() {
parent::execute();
@@ -127,7 +129,8 @@ public function all() {
* Get a model object for a class name.
*
* @param string $className Name of class you want model to be.
- * @return object Model instance
+ * @param string $table Table name
+ * @return Model Model instance
*/
protected function &_getModelObject($className, $table = null) {
if (!$table) {
@@ -166,6 +169,7 @@ public function inOptions($options, $prompt = null, $default = null) {
/**
* Handles interactive baking
*
+ * @return boolean
*/
protected function _interactive() {
$this->hr();
@@ -359,6 +363,7 @@ public function initValidations() {
*
* @param string $fieldName Name of field to be validated.
* @param array $metaData metadata for field
+ * @param string $primaryKey
* @return array Array of validation for the field.
*/
public function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
@@ -717,6 +722,7 @@ protected function _generatePossibleKeys() {
*
* @param mixed $name Model name or object
* @param mixed $data if array and $name is not an object assume bake data, otherwise boolean.
+ * @return string
*/
public function bake($name, $data = array()) {
if (is_object($name)) {
@@ -752,6 +758,7 @@ public function bake($name, $data = array()) {
* Assembles and writes a unit test file
*
* @param string $className Model class name
+ * @return string
*/
public function bakeTest($className) {
$this->Test->interactive = $this->interactive;
@@ -764,6 +771,7 @@ public function bakeTest($className) {
* outputs the a list of possible models or controllers from database
*
* @param string $useDbConfig Database configuration name
+ * @return array
*/
public function listAll($useDbConfig = null) {
$this->_tables = $this->getAllTables($useDbConfig);
@@ -843,6 +851,7 @@ public function getAllTables($useDbConfig = null) {
/**
* Forces the user to specify the model he wants to bake, and returns the selected model name.
*
+ * @param string $useDbConfig Database config name
* @return string the model name
*/
public function getName($useDbConfig = null) {
View
8 lib/Cake/Console/Command/Task/PluginTask.php
@@ -65,10 +65,11 @@ public function execute() {
/**
* Interactive interface
*
+ * @param string $plugin
* @return void
*/
protected function _interactive($plugin = null) {
- while ($plugin === null) {
+ if ($plugin === null) {
@lorenzo Owner
lorenzo added a note

What happens if the user enters an empty string twice?

@jrbasso Collaborator
jrbasso added a note

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

@markstory Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
$plugin = $this->in(__d('cake_console', 'Enter the name of the plugin in CamelCase format'));
}
@@ -80,8 +81,8 @@ protected function _interactive($plugin = null) {
/**
* Bake the plugin, create directories and files
*
- * @params $plugin name of the plugin in CamelCased format
- * @return bool
+ * @param string $plugin Name of the plugin in CamelCased format
+ * @return boolean
*/
public function bake($plugin) {
$pathOptions = App::path('plugins');
@@ -154,6 +155,7 @@ public function bake($plugin) {
/**
* find and change $this->path to the user selection
*
+ * @param array $pathOptions
* @return string plugin path
*/
public function findPath($pathOptions) {
View
3  lib/Cake/Console/Command/Task/ProjectTask.php
@@ -40,7 +40,7 @@ class ProjectTask extends Shell {
* Checks that given project path does not already exist, and
* finds the app directory in it. Then it calls bake() with that information.
*
- * @param string $project Project path
+ * @return mixed
*/
public function execute() {
$project = null;
@@ -137,6 +137,7 @@ public function execute() {
* @param string $path Project path
* @param string $skel Path to copy from
* @param string $skip array of directories to skip when copying
+ * @return mixed
*/
public function bake($path, $skel = null, $skip = array('empty')) {
if (!$skel && !empty($this->params['skel'])) {
View
11 lib/Cake/Console/Command/Task/TestTask.php
@@ -56,13 +56,14 @@ class TestTask extends BakeTask {
/**
* Internal list of fixtures that have been added so far.
*
- * @var string
+ * @var array
*/
protected $_fixtures = array();
/**
* Execution method always used for tasks
*
+ * @return void
*/
public function execute() {
parent::execute();
@@ -85,6 +86,8 @@ public function execute() {
/**
* Handles interactive baking
*
+ * @param string $type
+ * @return string|boolean
*/
protected function _interactive($type = null) {
$this->interactive = true;
@@ -110,6 +113,7 @@ protected function _interactive($type = null) {
*
* @param string $type Type of object to bake test case for ie. Model, Controller
* @param string $className the 'cake name' for the class ie. Posts for the PostsController
+ * @return string|boolean
*/
public function bake($type, $className) {
if ($this->typeCanDetectFixtures($type) && $this->isLoadableClass($type, $className)) {
@@ -215,7 +219,6 @@ public function getClassName($objectType) {
* Currently only model, and controller are supported
*
* @param string $type The Type of object you are generating tests for eg. controller
- * @param string $className the Classname of the class the test is being generated for.
* @return boolean
*/
public function typeCanDetectFixtures($type) {
@@ -227,7 +230,7 @@ public function typeCanDetectFixtures($type) {
* Check if a class with the given type is loaded or can be loaded.
*
* @param string $type The Type of object you are generating tests for eg. controller
- * @param string $className the Classname of the class the test is being generated for.
+ * @param string $class the Classname of the class the test is being generated for.
* @return boolean
*/
public function isLoadableClass($type, $class) {
@@ -398,7 +401,7 @@ public function hasMockClass($type) {
* Generate a constructor code snippet for the type and classname
*
* @param string $type The Type of object you are generating tests for eg. controller
- * @param string $className the Classname of the class the test is being generated for.
+ * @param string $fullClassName The Classname of the class the test is being generated for.
* @return string Constructor snippet for the thing you are building.
*/
public function generateConstructor($type, $fullClassName) {
View
7 lib/Cake/Console/Command/Task/ViewTask.php
@@ -72,6 +72,7 @@ class ViewTask extends BakeTask {
/**
* Override initialize
*
+ * @return void
*/
public function initialize() {
$this->path = current(App::path('View'));
@@ -80,6 +81,7 @@ public function initialize() {
/**
* Execution method always used for tasks
*
+ * @return mixed
*/
public function execute() {
parent::execute();
@@ -188,6 +190,7 @@ public function all() {
/**
* Handles interactive baking
*
+ * @return void
*/
protected function _interactive() {
$this->hr();
@@ -295,6 +298,7 @@ private function __loadController() {
* Bake a view file for each of the supplied actions
*
* @param array $actions Array of actions to make files for.
+ * @param array $vars
* @return void
*/
public function bakeActions($actions, $vars) {
@@ -436,7 +440,8 @@ public function getOptionParser() {
/**
* Returns associations for controllers models.
*
- * @return array $associations
+ * @param Model $model
+ * @return array $associations
*/
private function __associations($model) {
$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
View
6 lib/Cake/Console/ConsoleErrorHandler.php
@@ -30,16 +30,14 @@ class ConsoleErrorHandler extends ErrorHandler {
/**
* Standard error stream.
*
- * @var filehandle
- * @access public
+ * @var ConsoleOutput
*/
public static $stderr;
/**
* Get the stderr object for the console error handling.
*
- * @param Exception $error Exception to handle.
- * @param array $messages Error messages
+ * @return ConsoleOutput
*/
public static function getStderr() {
if (empty(self::$stderr)) {
View
4 lib/Cake/Console/ConsoleInputArgument.php
@@ -131,7 +131,9 @@ public function isRequired() {
/**
* Check that $value is a valid choice for this argument.
*
+ * @param string $value
* @return boolean
+ * @throws ConsoleException
*/
public function validChoice($value) {
if (empty($this->_choices)) {
@@ -149,7 +151,7 @@ public function validChoice($value) {
/**
* Append this arguments XML representation to the passed in SimpleXml object.
*
- * @param SimpleXmlElement The parent element.
+ * @param SimpleXmlElement $parent The parent element.
* @return SimpleXmlElement The parent with this argument appended.
*/
public function xml(SimpleXmlElement $parent) {
View
4 lib/Cake/Console/ConsoleInputOption.php
@@ -171,7 +171,9 @@ public function isBoolean() {
/**
* Check that a value is a valid choice for this option.
*
+ * @param string $value
* @return boolean
+ * @throws ConsoleException
*/
public function validChoice($value) {
if (empty($this->_choices)) {
@@ -189,7 +191,7 @@ public function validChoice($value) {
/**
* Append the option's xml into the parent.
*
- * @param SimpleXmlElement The parent element.
+ * @param SimpleXmlElement $parent The parent element.
* @return SimpleXmlElement The parent with this option appended.
*/
public function xml(SimpleXmlElement $parent) {
View
2  lib/Cake/Console/ConsoleInputSubcommand.php
@@ -108,7 +108,7 @@ public function parser() {
/**
* Append this subcommand to the Parent element
*
- * @param SimpleXmlElement The parent element.
+ * @param SimpleXmlElement $parent The parent element.
* @return SimpleXmlElement The parent with this subcommand appended.
*/
public function xml(SimpleXmlElement $parent) {
View
19 lib/Cake/Console/ConsoleOptionParser.php
@@ -267,8 +267,8 @@ public function epilog($text = null) {
*
* @param mixed $name The long name you want to the value to be parsed out as when options are parsed.
* Will also accept an instance of ConsoleInputOption
- * @param array $params An array of parameters that define the behavior of the option
- * @return returns $this.
+ * @param array $options An array of parameters that define the behavior of the option
+ * @return ConsoleOptionParser $this.
*/
public function addOption($name, $options = array()) {
if (is_object($name) && $name instanceof ConsoleInputOption) {
@@ -308,7 +308,7 @@ public function addOption($name, $options = array()) {
*
* @param mixed $name The name of the argument. Will also accept an instance of ConsoleInputArgument
* @param array $params Parameters for the argument, see above.
- * @return $this.
+ * @return ConsoleOptionParser $this.
*/
public function addArgument($name, $params = array()) {
if (is_object($name) && $name instanceof ConsoleInputArgument) {
@@ -337,7 +337,7 @@ public function addArgument($name, $params = array()) {
*
* @param array $args Array of arguments to add.
* @see ConsoleOptionParser::addArgument()
- * @return $this
+ * @return ConsoleOptionParser $this
*/
public function addArguments(array $args) {
foreach ($args as $name => $params) {
@@ -352,7 +352,7 @@ public function addArguments(array $args) {
*
* @param array $options Array of options to add.
* @see ConsoleOptionParser::addOption()
- * @return $this
+ * @return ConsoleOptionParser $this
*/
public function addOptions(array $options) {
foreach ($options as $name => $params) {
@@ -373,8 +373,8 @@ public function addOptions(array $options) {
* it will be used.
*
* @param mixed $name Name of the subcommand. Will also accept an instance of ConsoleInputSubcommand
- * @param array $params Array of params, see above.
- * @return $this.
+ * @param array $options Array of params, see above.
+ * @return ConsoleOptionParser $this.
*/
public function addSubcommand($name, $options = array()) {
if (is_object($name) && $name instanceof ConsoleInputSubcommand) {
@@ -397,7 +397,7 @@ public function addSubcommand($name, $options = array()) {
* Add multiple subcommands at once.
*
* @param array $commands Array of subcommands.
- * @return $this
+ * @return ConsoleOptionParser $this
*/
public function addSubcommands(array $commands) {
foreach ($commands as $name => $params) {
@@ -489,6 +489,7 @@ public function parse($argv, $command = null) {
*
* @param string $subcommand If present and a valid subcommand that has a linked parser.
* That subcommands help will be shown instead.
+ * @param string $format Define the output format, can be text or xml
* @param int $width The width to format user content to. Defaults to 72
* @return string Generated help.
*/
@@ -551,7 +552,7 @@ protected function _parseShortOption($option, $params) {
/**
* Parse an option by its name index.
*
- * @param string $option The option to parse.
+ * @param string $name The name to parse.
* @param array $params The params to append the parsed value into
* @return array Params with $option added in.
*/
View
1  lib/Cake/Console/HelpFormatter.php
@@ -134,6 +134,7 @@ protected function _generateUsage() {
/**
* Iterate over a collection and find the longest named thing.
*
+ * @param array $collection
* @return integer
*/
protected function _getMaxLength($collection) {
View
14 lib/Cake/Console/Shell.php
@@ -310,9 +310,7 @@ public function hasMethod($name) {
*
* `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');`
*
- * @param mixed $command Either an array of args similar to $argv. Or a string command, that can be
- * exploded on space to simulate argv.
- * @return mixed. The return of the other shell.
+ * @return mixed The return of the other shell.
*/
public function dispatchShell() {
$args = func_get_args();
@@ -383,6 +381,7 @@ public function runCommand($command, $argv) {
/**
* Display the help in the correct format
*
+ * @param string $command
* @return void
*/
protected function _displayHelp($command) {
@@ -410,7 +409,8 @@ public function getOptionParser() {
/**
* Overload get for lazy building of tasks
*
- * @return void
+ * @param string $name
+ * @return Shell Object of Task
*/
public function __get($name) {
if (empty($this->{$name}) && in_array($name, $this->taskNames)) {
@@ -523,7 +523,7 @@ public function wrapText($text, $options = array()) {
* @param mixed $message A string or a an array of strings to output
* @param integer $newlines Number of newlines to append
* @param integer $level The message's output level, see above.
- * @return integer Returns the number of bytes returned from writing to stdout.
+ * @return integer|boolean Returns the number of bytes returned from writing to stdout.
*/
public function out($message = null, $newlines = 1, $level = Shell::NORMAL) {
$currentLevel = Shell::NORMAL;
@@ -545,6 +545,7 @@ public function out($message = null, $newlines = 1, $level = Shell::NORMAL) {
*
* @param mixed $message A string or a an array of strings to output
* @param integer $newlines Number of newlines to append
+ * @return void
*/
public function err($message = null, $newlines = 1) {
$this->stderr->write($message, $newlines);
@@ -554,7 +555,6 @@ public function err($message = null, $newlines = 1) {
* Returns a single or multiple linefeeds sequences.
*
* @param integer $multiplier Number of times the linefeed sequence should be repeated
- * @access public
* @return string
*/
public function nl($multiplier = 1) {
@@ -566,6 +566,7 @@ public function nl($multiplier = 1) {
*
* @param integer $newlines Number of newlines to pre- and append
* @param integer $width Width of the line, defaults to 63
+ * @return void
*/
public function hr($newlines = 0, $width = 63) {
$this->out(null, $newlines);
@@ -579,6 +580,7 @@ public function hr($newlines = 0, $width = 63) {
*
* @param string $title Title of the error
* @param string $message An optional error message
+ * @return void
*/
public function error($title, $message = null) {
$this->err(__d('cake_console', '<error>Error:</error> %s', $title));
View
10 lib/Cake/Console/ShellDispatcher.php
@@ -198,8 +198,8 @@ public function dispatch() {
* All paths in the loaded shell paths are searched.
*
* @param string $shell Optionally the name of a plugin
- * @return mixed False if no shell could be found or an object on success
- * @throws MissingShellFileException, MissingShellClassException when errors are encountered.
+ * @return mixed An object
+ * @throws MissingShellFileException when errors are encountered.
*/
protected function _getShell($shell) {
list($plugin, $shell) = pluginSplit($shell, true);
@@ -221,7 +221,8 @@ protected function _getShell($shell) {
/**
* Parses command line options and extracts the directory paths from $params
*
- * @param array $params Parameters to parse
+ * @param array $args Parameters to parse
+ * @return void
*/
public function parseParams($args) {
$this->_parsePaths($args);
@@ -276,6 +277,7 @@ public function parseParams($args) {
/**
* Parses out the paths from from the argv
*
+ * @param array $args
* @return void
*/
protected function _parsePaths($args) {
@@ -316,7 +318,7 @@ public function help() {
/**
* Stop execution of the current script
*
- * @param $status see http://php.net/exit for values
+ * @param integer|string $status see http://php.net/exit for values
* @return void
*/
protected function _stop($status = 0) {
View
4 lib/Cake/Console/TaskCollection.php
@@ -27,7 +27,7 @@ class TaskCollection extends ObjectCollection {
/**
* Shell to use to set params to tasks.
*
- * @var array
+ * @var Shell
*/
protected $_Shell;
@@ -41,7 +41,7 @@ class TaskCollection extends ObjectCollection {
/**
* Constructor
*
- * @param array $paths Array of paths to search for tasks on .
+ * @param Shell $Shell
* @return void
*/
public function __construct(Shell $Shell) {
View
3  lib/Cake/Core/App.php
@@ -527,6 +527,7 @@ public static function objects($type, $path = null, $cache = true) {
*
* @param string $className the name of the class to configure package for
* @param string $location the package name
+ * @return void
*/
public static function uses($className, $location) {
self::$__classMap[$className] = $location;
@@ -539,6 +540,7 @@ public static function uses($className, $location) {
* if a class is name `MyCustomClass` the file name should be `MyCustomClass.php`
*
* @param string $className the name of the class to load
+ * @return boolean
*/
public static function load($className) {
if (!isset(self::$__classMap[$className])) {
@@ -676,7 +678,6 @@ public static function import($type = null, $name = null, $parent = true, $searc
* @param string $name unique name of the file for identifying it inside the application
* @param string $plugin camel cased plugin name if any
* @param string $type name of the packed where the class is located
- * @param string $file filename if known, the $name param will be used otherwise
* @param string $originalType type name as supplied initially by the user
* @param boolean $parent whether to load the class parent or not
* @return boolean true indicating the successful load and existence of the class
View
2  lib/Cake/Core/Object.php
@@ -122,7 +122,7 @@ public function dispatchMethod($method, $params = array()) {
* Stop execution of the current script. Wraps exit() making
* testing easier.
*
- * @param $status see http://php.net/exit for values
+ * @param integer|string $status see http://php.net/exit for values
* @return void
*/
protected function _stop($status = 0) {
View
1  lib/Cake/Error/ErrorHandler.php
@@ -103,6 +103,7 @@ class ErrorHandler {
* This will either use an AppError class if your application has one,
* or use the default ExceptionRenderer.
*
+ * @param Exception $exception
* @return void
* @see http://php.net/manual/en/function.set-exception-handler.php
*/
View
2  lib/Cake/Log/CakeLog.php
@@ -127,7 +127,7 @@ public static function configured() {
* Removes a stream from the active streams. Once a stream has been removed
* it will no longer have messages sent to it.
*
- * @param string $keyname Key name of a configured stream to remove.
+ * @param string $streamName Key name of a configured stream to remove.
* @return void
*/
public static function drop($streamName) {
View
1  lib/Cake/Utility/ObjectCollection.php
@@ -226,6 +226,7 @@ public function unload($name) {
*
* @param string $name Name of the object
* @param Object $object The object to use
+ * @return array Loaded objects
*/
public function set($name = null, $object = null) {
if (!empty($name) && !empty($object)) {
Please sign in to comment.
Something went wrong with that request. Please try again.