From a691e70065847ba2cedd6a281c16dfa2c2b31a34 Mon Sep 17 00:00:00 2001 From: ADmad Date: Mon, 29 Jul 2013 13:35:55 +0530 Subject: [PATCH] Docblock and return type fixes --- lib/Cake/Controller/Controller.php | 22 +++++++++++++--------- lib/Cake/View/Helper.php | 14 ++++++++------ lib/Cake/View/Helper/CacheHelper.php | 3 ++- lib/Cake/View/View.php | 12 ++++++------ 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index aefc83f01..edf05e425 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -347,7 +347,7 @@ class Controller extends Object implements CakeEventListener { * Lazy loads models using the loadModel() method if declared in $uses * * @param string $name - * @return void + * @return boolean */ public function __isset($name) { switch ($name) { @@ -384,8 +384,8 @@ class Controller extends Object implements CakeEventListener { * Provides backwards compatibility access to the request object properties. * Also provides the params alias. * - * @param string $name - * @return void + * @param string $name The name of the requested value + * @return mixed The requested value for valid variables/aliases else null */ public function __get($name) { switch ($name) { @@ -422,15 +422,19 @@ class Controller extends Object implements CakeEventListener { case 'here': case 'webroot': case 'data': - return $this->request->{$name} = $value; + $this->request->{$name} = $value; + return; case 'action': - return $this->request->params['action'] = $value; + $this->request->params['action'] = $value; + return; case 'params': - return $this->request->params = $value; + $this->request->params = $value; + return; case 'paginate': - return $this->Components->load('Paginator')->settings = $value; + $this->Components->load('Paginator')->settings = $value; + return; } - return $this->{$name} = $value; + $this->{$name} = $value; } /** @@ -714,7 +718,7 @@ class Controller extends Object implements CakeEventListener { * * @param string $modelClass Name of model class to load * @param integer|string $id Initial ID the instanced model class should have - * @return mixed true when single model found and instance created, error returned if model not found. + * @return bool True if the model was found * @throws MissingModelException if the model class cannot be found. */ public function loadModel($modelClass = null, $id = null) { diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index 6ad4ed380..1382d34a7 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -223,7 +223,7 @@ class Helper extends Object { * * @param string $name Name of the property being accessed. * @param mixed $value - * @return mixed Return the $value + * @return void */ public function __set($name, $value) { switch ($name) { @@ -231,11 +231,13 @@ class Helper extends Object { case 'here': case 'webroot': case 'data': - return $this->request->{$name} = $value; + $this->request->{$name} = $value; + return; case 'action': - return $this->request->params['action'] = $value; + $this->request->params['action'] = $value; + return; } - return $this->{$name} = $value; + $this->{$name} = $value; } /** @@ -834,7 +836,7 @@ class Helper extends Object { * @param string $viewFile The file about to be rendered. * @return void */ - public function beforeRenderFile($viewfile) { + public function beforeRenderFile($viewFile) { } /** @@ -847,7 +849,7 @@ class Helper extends Object { * @param string $content The content that was rendered. * @return void */ - public function afterRenderFile($viewfile, $content) { + public function afterRenderFile($viewFile, $content) { } /** diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php index 5538b49de..f2cd3dbce 100644 --- a/lib/Cake/View/Helper/CacheHelper.php +++ b/lib/Cake/View/Helper/CacheHelper.php @@ -67,7 +67,8 @@ class CacheHelper extends AppHelper { * Parses the view file and stores content for cache file building. * * @param string $viewFile - * @return void + * @param string $output The output for the file. + * @return string Updated content. */ public function afterRenderFile($viewFile, $output) { if ($this->_enabled()) { diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index d4595ed35..7e98108a7 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -621,7 +621,7 @@ class View extends Object { * @see ViewBlock::start() */ public function start($name) { - return $this->Blocks->start($name); + $this->Blocks->start($name); } /** @@ -632,7 +632,7 @@ class View extends Object { * @see ViewBlock::startIfEmpty() */ public function startIfEmpty($name) { - return $this->Blocks->startIfEmpty($name); + $this->Blocks->startIfEmpty($name); } /** @@ -646,7 +646,7 @@ class View extends Object { * @see ViewBlock::concat() */ public function append($name, $value = null) { - return $this->Blocks->concat($name, $value); + $this->Blocks->concat($name, $value); } /** @@ -660,7 +660,7 @@ class View extends Object { * @see ViewBlock::concat() */ public function prepend($name, $value = null) { - return $this->Blocks->concat($name, $value, ViewBlock::PREPEND); + $this->Blocks->concat($name, $value, ViewBlock::PREPEND); } /** @@ -674,7 +674,7 @@ class View extends Object { * @see ViewBlock::set() */ public function assign($name, $value) { - return $this->Blocks->set($name, $value); + $this->Blocks->set($name, $value); } /** @@ -697,7 +697,7 @@ class View extends Object { * @see ViewBlock::end() */ public function end() { - return $this->Blocks->end(); + $this->Blocks->end(); } /**