Skip to content

Commit

Permalink
Add @link to Shell docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Nov 22, 2011
1 parent 0e6697d commit bb51b0f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/Cake/Console/Shell.php
Expand Up @@ -83,6 +83,7 @@ class Shell extends Object {
* Contains tasks to load and instantiate
*
* @var array
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$tasks
*/
public $tasks = array();

Expand All @@ -97,6 +98,7 @@ class Shell extends Object {
* Contains models to load and instantiate
*
* @var array
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$uses
*/
public $uses = array();

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

0 comments on commit bb51b0f

Please sign in to comment.