Merge pull request #328 from shama/patch-doc

Add @link to Shell docblocks
This commit is contained in:
Renan Gonçalves aka renan.saddam 2011-11-22 01:37:23 -08:00
commit f68d0f95e1

View file

@ -83,6 +83,7 @@ class Shell extends Object {
* Contains tasks to load and instantiate * Contains tasks to load and instantiate
* *
* @var array * @var array
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$tasks
*/ */
public $tasks = array(); public $tasks = array();
@ -97,6 +98,7 @@ class Shell extends Object {
* Contains models to load and instantiate * Contains models to load and instantiate
* *
* @var array * @var array
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$uses
*/ */
public $uses = array(); public $uses = array();
@ -141,6 +143,7 @@ class Shell extends Object {
* @param ConsoleOutput $stdout A ConsoleOutput object for stdout. * @param ConsoleOutput $stdout A ConsoleOutput object for stdout.
* @param ConsoleOutput $stderr A ConsoleOutput object for stderr. * @param ConsoleOutput $stderr A ConsoleOutput object for stderr.
* @param ConsoleInput $stdin A ConsoleInput object for stdin. * @param ConsoleInput $stdin A ConsoleInput object for stdin.
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell
*/ */
public function __construct($stdout = null, $stderr = null, $stdin = null) { public function __construct($stdout = null, $stderr = null, $stdin = null) {
if ($this->name == null) { if ($this->name == null) {
@ -176,6 +179,7 @@ class Shell extends Object {
* allows configuration of tasks prior to shell execution * allows configuration of tasks prior to shell execution
* *
* @return void * @return void
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::initialize
*/ */
public function initialize() { public function initialize() {
$this->_loadModels(); $this->_loadModels();
@ -189,6 +193,7 @@ class Shell extends Object {
* or otherwise modify the pre-command flow. * or otherwise modify the pre-command flow.
* *
* @return void * @return void
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup
*/ */
public function startup() { public function startup() {
$this->_welcome(); $this->_welcome();
@ -261,6 +266,7 @@ class Shell extends Object {
* *
* @param string $task The task name to check. * @param string $task The task name to check.
* @return boolean Success * @return boolean Success
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask
*/ */
public function hasTask($task) { public function hasTask($task) {
return isset($this->_taskMap[Inflector::camelize($task)]); return isset($this->_taskMap[Inflector::camelize($task)]);
@ -271,6 +277,7 @@ class Shell extends Object {
* *
* @param string $name The method name to check. * @param string $name The method name to check.
* @return boolean * @return boolean
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod
*/ */
public function hasMethod($name) { public function hasMethod($name) {
try { try {
@ -306,6 +313,7 @@ class Shell extends Object {
* `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');` * `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');`
* *
* @return mixed The return of the other shell. * @return mixed The return of the other shell.
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::dispatchShell
*/ */
public function dispatchShell() { public function dispatchShell() {
$args = func_get_args(); $args = func_get_args();
@ -334,6 +342,7 @@ class Shell extends Object {
* and the shell has a `main()` method, that will be called instead. * and the shell has a `main()` method, that will be called instead.
* @param array $argv Array of arguments to run the shell with. This array should be missing the shell name. * @param array $argv Array of arguments to run the shell with. This array should be missing the shell name.
* @return void * @return void
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand
*/ */
public function runCommand($command, $argv) { public function runCommand($command, $argv) {
$isTask = $this->hasTask($command); $isTask = $this->hasTask($command);
@ -397,6 +406,7 @@ class Shell extends Object {
* By overriding this method you can configure the ConsoleOptionParser before returning it. * By overriding this method you can configure the ConsoleOptionParser before returning it.
* *
* @return ConsoleOptionParser * @return ConsoleOptionParser
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::getOptionParser
*/ */
public function getOptionParser() { public function getOptionParser() {
$parser = new ConsoleOptionParser($this->name); $parser = new ConsoleOptionParser($this->name);
@ -428,6 +438,7 @@ class Shell extends Object {
* @param mixed $options Array or string of options. * @param mixed $options Array or string of options.
* @param string $default Default input value. * @param string $default Default input value.
* @return mixed Either the default value, or the user-provided input. * @return mixed Either the default value, or the user-provided input.
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::in
*/ */
public function in($prompt, $options = null, $default = null) { public function in($prompt, $options = null, $default = null) {
if (!$this->interactive) { if (!$this->interactive) {
@ -499,6 +510,7 @@ class Shell extends Object {
* @param mixed $options Array of options to use, or an integer to wrap the text to. * @param mixed $options Array of options to use, or an integer to wrap the text to.
* @return string Wrapped / indented text * @return string Wrapped / indented text
* @see String::wrap() * @see String::wrap()
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText
*/ */
public function wrapText($text, $options = array()) { public function wrapText($text, $options = array()) {
return String::wrap($text, $options); return String::wrap($text, $options);
@ -519,6 +531,7 @@ class Shell extends Object {
* @param integer $newlines Number of newlines to append * @param integer $newlines Number of newlines to append
* @param integer $level The message's output level, see above. * @param integer $level The message's output level, see above.
* @return integer|boolean Returns the number of bytes returned from writing to stdout. * @return integer|boolean Returns the number of bytes returned from writing to stdout.
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out
*/ */
public function out($message = null, $newlines = 1, $level = Shell::NORMAL) { public function out($message = null, $newlines = 1, $level = Shell::NORMAL) {
$currentLevel = Shell::NORMAL; $currentLevel = Shell::NORMAL;
@ -541,6 +554,7 @@ class Shell extends Object {
* @param mixed $message A string or a an array of strings to output * @param mixed $message A string or a an array of strings to output
* @param integer $newlines Number of newlines to append * @param integer $newlines Number of newlines to append
* @return void * @return void
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err
*/ */
public function err($message = null, $newlines = 1) { public function err($message = null, $newlines = 1) {
$this->stderr->write($message, $newlines); $this->stderr->write($message, $newlines);
@ -551,6 +565,7 @@ class Shell extends Object {
* *
* @param integer $multiplier Number of times the linefeed sequence should be repeated * @param integer $multiplier Number of times the linefeed sequence should be repeated
* @return string * @return string
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl
*/ */
public function nl($multiplier = 1) { public function nl($multiplier = 1) {
return str_repeat(ConsoleOutput::LF, $multiplier); return str_repeat(ConsoleOutput::LF, $multiplier);
@ -562,6 +577,7 @@ class Shell extends Object {
* @param integer $newlines Number of newlines to pre- and append * @param integer $newlines Number of newlines to pre- and append
* @param integer $width Width of the line, defaults to 63 * @param integer $width Width of the line, defaults to 63
* @return void * @return void
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr
*/ */
public function hr($newlines = 0, $width = 63) { public function hr($newlines = 0, $width = 63) {
$this->out(null, $newlines); $this->out(null, $newlines);
@ -576,6 +592,7 @@ class Shell extends Object {
* @param string $title Title of the error * @param string $title Title of the error
* @param string $message An optional error message * @param string $message An optional error message
* @return void * @return void
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error
*/ */
public function error($title, $message = null) { public function error($title, $message = null) {
$this->err(__d('cake_console', '<error>Error:</error> %s', $title)); $this->err(__d('cake_console', '<error>Error:</error> %s', $title));
@ -590,6 +607,7 @@ class Shell extends Object {
* Clear the console * Clear the console
* *
* @return void * @return void
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::clear
*/ */
public function clear() { public function clear() {
if (empty($this->params['noclear'])) { if (empty($this->params['noclear'])) {
@ -607,6 +625,7 @@ class Shell extends Object {
* @param string $path Where to put the file. * @param string $path Where to put the file.
* @param string $contents Content to put in the file. * @param string $contents Content to put in the file.
* @return boolean Success * @return boolean Success
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile
*/ */
public function createFile($path, $contents) { public function createFile($path, $contents) {
$path = str_replace(DS . DS, DS, $path); $path = str_replace(DS . DS, DS, $path);
@ -668,6 +687,7 @@ class Shell extends Object {
* *
* @param string $file Absolute file path * @param string $file Absolute file path
* @return string short path * @return string short path
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::shortPath
*/ */
public function shortPath($file) { public function shortPath($file) {
$shortPath = str_replace(ROOT, null, $file); $shortPath = str_replace(ROOT, null, $file);