From ba026786934cc934535028036b86947aa00d186b Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 5 Jul 2013 16:17:23 +0200 Subject: [PATCH 1/2] doc block corrections --- lib/Cake/Log/CakeLog.php | 8 ++++---- lib/Cake/Network/CakeRequest.php | 2 +- lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php | 2 +- lib/Cake/Test/Case/Model/BehaviorCollectionTest.php | 6 +++--- lib/Cake/Test/Case/Model/models.php | 2 +- lib/Cake/Test/Case/Network/CakeRequestTest.php | 4 +++- lib/Cake/Test/Case/Utility/FileTest.php | 2 +- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/Cake/Log/CakeLog.php b/lib/Cake/Log/CakeLog.php index de7098b31..17ad88ca2 100644 --- a/lib/Cake/Log/CakeLog.php +++ b/lib/Cake/Log/CakeLog.php @@ -255,8 +255,8 @@ class CakeLog { * }}} * * @param array $levels array - * @param bool $append true to append, false to replace - * @return array active log levels + * @param boolean $append true to append, false to replace + * @return array Active log levels */ public static function levels($levels = array(), $append = true) { if (empty(self::$_Collection)) { @@ -278,7 +278,7 @@ class CakeLog { /** * Reset log levels to the original value * - * @return array default log levels + * @return array Default log levels */ public static function defaultLevels() { self::$_levelMap = self::$_defaultLevels; @@ -304,7 +304,7 @@ class CakeLog { * Checks whether $streamName is enabled * * @param string $streamName to check - * @return bool + * @return boolean * @throws CakeLogException */ public static function enabled($streamName) { diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index f939ffee2..2dac6cdec 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -673,7 +673,7 @@ class CakeRequest implements ArrayAccess { * * @param integer $tldLength Number of segments your tld contains. For example: `example.com` contains 1 tld. * While `example.co.uk` contains 2. - * @return array of subdomains. + * @return array An array of subdomains. */ public function subdomains($tldLength = 1) { $segments = explode('.', $this->host()); diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php index e4d936963..a04cb593c 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php @@ -498,7 +498,7 @@ class DbAclTest extends CakeTestCase { * Generates a list of the current aro and aco structures and a grid dump of the permissions that are defined * Only designed to work with the db based ACL * - * @param bool $treesToo + * @param boolean $treesToo * @return void */ protected function _debug($printTreesToo = false) { diff --git a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php index 58a667baa..b84260dec 100644 --- a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php +++ b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php @@ -184,7 +184,7 @@ class TestBehavior extends ModelBehavior { * afterValidate method * * @param Model $model - * @param bool $cascade + * @param boolean $cascade * @return void */ public function afterValidate(Model $model) { @@ -205,7 +205,7 @@ class TestBehavior extends ModelBehavior { * beforeDelete method * * @param Model $model - * @param bool $cascade + * @param boolean $cascade * @return void */ public function beforeDelete(Model $model, $cascade = true) { @@ -277,7 +277,7 @@ class TestBehavior extends ModelBehavior { * testMethod method * * @param Model $model - * @param bool $param + * @param boolean $param * @return void */ public function testMethod(Model $model, $param = true) { diff --git a/lib/Cake/Test/Case/Model/models.php b/lib/Cake/Test/Case/Model/models.php index 85e6b9715..1f6c8799b 100644 --- a/lib/Cake/Test/Case/Model/models.php +++ b/lib/Cake/Test/Case/Model/models.php @@ -2547,7 +2547,7 @@ class NumberTree extends CakeTestModel { * @param mixed $currentLevel * @param mixed $parent_id * @param string $prefix - * @param bool $hierarchal + * @param boolean $hierarchal * @return void */ public function initialize($levelLimit = 3, $childLimit = 3, $currentLevel = null, $parentId = null, $prefix = '1', $hierarchal = true) { diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index ec70970c3..b9ff23bee 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -33,7 +33,8 @@ class TestCakeRequest extends CakeRequest { * reConstruct method * * @param string $url - * @param bool $parseEnvironment + * @param boolean $parseEnvironment + * @return void */ public function reConstruct($url = 'some/path', $parseEnvironment = true) { $this->_base(); @@ -2105,6 +2106,7 @@ XML; /** * Test onlyAllow throwing exception * + * @return void */ public function testOnlyAllowException() { $_SERVER['REQUEST_METHOD'] = 'PUT'; diff --git a/lib/Cake/Test/Case/Utility/FileTest.php b/lib/Cake/Test/Case/Utility/FileTest.php index 9e15cf562..26958a8db 100644 --- a/lib/Cake/Test/Case/Utility/FileTest.php +++ b/lib/Cake/Test/Case/Utility/FileTest.php @@ -543,7 +543,7 @@ class FileTest extends CakeTestCase { /** * getTmpFile method * - * @param bool $paintSkip + * @param boolean $paintSkip * @return void */ protected function _getTmpFile($paintSkip = true) { From af455b41214f240a40c6805bc74d0d0b0cfbc7ab Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 5 Jul 2013 17:19:22 +0200 Subject: [PATCH 2/2] correct return types in doc blocks --- lib/Cake/Console/Command/Task/ExtractTask.php | 1 + lib/Cake/Console/ConsoleErrorHandler.php | 1 + lib/Cake/Controller/Component/Acl/AclInterface.php | 2 ++ lib/Cake/Model/Behavior/TranslateBehavior.php | 1 + lib/Cake/Model/Validator/CakeValidationSet.php | 1 + lib/Cake/Network/CakeSocket.php | 1 + lib/Cake/Test/Case/Core/ConfigureTest.php | 2 +- lib/Cake/Test/Case/I18n/I18nTest.php | 2 +- lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php | 2 +- lib/Cake/Test/Case/Model/ModelReadTest.php | 3 ++- lib/Cake/Test/Case/Utility/SecurityTest.php | 2 +- lib/Cake/Test/Case/View/HelperTest.php | 2 +- lib/Cake/View/XmlView.php | 4 ++-- lib/Cake/basics.php | 2 ++ 14 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index 4648c1e47..fbc963894 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -247,6 +247,7 @@ class ExtractTask extends AppShell { * @param string $domain * @param string $msgid * @param array $details + * @return void */ protected function _addTranslation($domain, $msgid, $details = array()) { if (empty($this->_translations[$domain][$msgid])) { diff --git a/lib/Cake/Console/ConsoleErrorHandler.php b/lib/Cake/Console/ConsoleErrorHandler.php index 1165031d9..e249ccfe3 100644 --- a/lib/Cake/Console/ConsoleErrorHandler.php +++ b/lib/Cake/Console/ConsoleErrorHandler.php @@ -96,6 +96,7 @@ class ConsoleErrorHandler { * Wrapper for exit(), used for testing. * * @param int $code The exit code. + * @return void */ protected function _stop($code = 0) { exit($code); diff --git a/lib/Cake/Controller/Component/Acl/AclInterface.php b/lib/Cake/Controller/Component/Acl/AclInterface.php index 6ad29ae47..f6794e9e2 100644 --- a/lib/Cake/Controller/Component/Acl/AclInterface.php +++ b/lib/Cake/Controller/Component/Acl/AclInterface.php @@ -28,6 +28,7 @@ interface AclInterface { * @param string $aro ARO The requesting object identifier. * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) + * @return boolean Success */ public function check($aro, $aco, $action = "*"); @@ -65,6 +66,7 @@ interface AclInterface { * Initialization method for the Acl implementation * * @param AclComponent $component + * @return void */ public function initialize(Component $component); diff --git a/lib/Cake/Model/Behavior/TranslateBehavior.php b/lib/Cake/Model/Behavior/TranslateBehavior.php index eff7b4060..1335f06a8 100644 --- a/lib/Cake/Model/Behavior/TranslateBehavior.php +++ b/lib/Cake/Model/Behavior/TranslateBehavior.php @@ -628,6 +628,7 @@ class TranslateBehavior extends ModelBehavior { * * @param Model $Model Model instance * @param string $field The field to update. + * @return void */ protected function _removeField(Model $Model, $field) { if (array_key_exists($field, $this->settings[$Model->alias])) { diff --git a/lib/Cake/Model/Validator/CakeValidationSet.php b/lib/Cake/Model/Validator/CakeValidationSet.php index 208d0582a..e17e0213a 100644 --- a/lib/Cake/Model/Validator/CakeValidationSet.php +++ b/lib/Cake/Model/Validator/CakeValidationSet.php @@ -331,6 +331,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable { * * @param string $index name of the rule * @param CakeValidationRule|array rule to add to $index + * @return void */ public function offsetSet($index, $rule) { $this->setRule($index, $rule); diff --git a/lib/Cake/Network/CakeSocket.php b/lib/Cake/Network/CakeSocket.php index 43f5318c4..3fcebad6e 100644 --- a/lib/Cake/Network/CakeSocket.php +++ b/lib/Cake/Network/CakeSocket.php @@ -186,6 +186,7 @@ class CakeSocket { * * @param int $code * @param string $message + * @return void */ protected function _connectionErrorHandler($code, $message) { $this->_connectionErrors[] = $message; diff --git a/lib/Cake/Test/Case/Core/ConfigureTest.php b/lib/Cake/Test/Case/Core/ConfigureTest.php index 0376632cf..65e7717ca 100644 --- a/lib/Cake/Test/Case/Core/ConfigureTest.php +++ b/lib/Cake/Test/Case/Core/ConfigureTest.php @@ -447,7 +447,7 @@ class ConfigureTest extends CakeTestCase { /** * Test dumping only some of the data. * - * @return + * @return void */ public function testDumpPartial() { Configure::config('test_reader', new PhpReader(TMP)); diff --git a/lib/Cake/Test/Case/I18n/I18nTest.php b/lib/Cake/Test/Case/I18n/I18nTest.php index ff4f562ff..80303e2c5 100644 --- a/lib/Cake/Test/Case/I18n/I18nTest.php +++ b/lib/Cake/Test/Case/I18n/I18nTest.php @@ -194,7 +194,7 @@ class I18nTest extends CakeTestCase { /** * Assertions for rules zero. * - * @return + * @return void */ public function assertRulesZero() { $singular = $this->__singular(); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 29a8bc671..2fd7bed05 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -2508,7 +2508,7 @@ class MysqlTest extends CakeTestCase { /** * Test that array conditions with only one element work. * - * @return + * @return void */ public function testArrayConditionsOneElement() { $conditions = array('id' => array(1)); diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index 620afcd5d..0ecbec7e8 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -3765,7 +3765,7 @@ class ModelReadTest extends BaseModelTest { /** * Test find(neighbors) with missing fields so no neighbors are found. * - * @return + * @return void */ public function testFindNeighborsNoPrev() { $this->loadFixtures('User', 'Article', 'Comment', 'Tag', 'ArticlesTag', 'Attachment'); @@ -3786,6 +3786,7 @@ class ModelReadTest extends BaseModelTest { ); $this->assertEquals($expected, $result); } + /** * testFindCombinedRelations method * diff --git a/lib/Cake/Test/Case/Utility/SecurityTest.php b/lib/Cake/Test/Case/Utility/SecurityTest.php index 850042985..f1a0e33f8 100644 --- a/lib/Cake/Test/Case/Utility/SecurityTest.php +++ b/lib/Cake/Test/Case/Utility/SecurityTest.php @@ -265,7 +265,7 @@ class SecurityTest extends CakeTestCase { /** * Test that rijndael() can still decrypt values with a fixed iv. * - * @return + * @return void */ public function testRijndaelBackwardCompatibility() { $this->skipIf(!function_exists('mcrypt_encrypt')); diff --git a/lib/Cake/Test/Case/View/HelperTest.php b/lib/Cake/Test/Case/View/HelperTest.php index af95a8549..e3d6db33c 100644 --- a/lib/Cake/Test/Case/View/HelperTest.php +++ b/lib/Cake/Test/Case/View/HelperTest.php @@ -309,7 +309,7 @@ class HelperTest extends CakeTestCase { /** * test setEntity with setting a scope. * - * @return + * @return void */ public function testSetEntityScoped() { $this->Helper->setEntity('HelperTestPost', true); diff --git a/lib/Cake/View/XmlView.php b/lib/Cake/View/XmlView.php index e77698eec..6fcfb0b3f 100644 --- a/lib/Cake/View/XmlView.php +++ b/lib/Cake/View/XmlView.php @@ -94,9 +94,9 @@ class XmlView extends View { } /** - * Serialize view vars + * Serialize view vars. * - * @param array $serialize The viewVars that need to be serialized + * @param array $serialize The viewVars that need to be serialized. * @return string The serialized data */ protected function _serialize($serialize) { diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index 816f42794..ebeff8c1b 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -68,6 +68,7 @@ if (!function_exists('debug')) { * @param boolean $var Variable to show debug information for. * @param boolean $showHtml If set to true, the method prints the debug data in a browser-friendly way. * @param boolean $showFrom If set to true, the method prints from where the function was called. + * @return void * @link http://book.cakephp.org/2.0/en/development/debugging.html#basic-debugging * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#debug */ @@ -235,6 +236,7 @@ if (!function_exists('pr')) { * * @see debug() * @param array $var Variable to print out + * @return void * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#pr */ function pr($var) {