diff --git a/app/Config/Schema/db_acl.php b/app/Config/Schema/db_acl.php index 967abbe13..cb63df7c7 100644 --- a/app/Config/Schema/db_acl.php +++ b/app/Config/Schema/db_acl.php @@ -21,7 +21,6 @@ /** * Using the Schema command line utility * cake schema run create DbAcl - * */ class DbAclSchema extends CakeSchema { diff --git a/app/Config/Schema/i18n.php b/app/Config/Schema/i18n.php index 15a446b48..cd598b35e 100644 --- a/app/Config/Schema/i18n.php +++ b/app/Config/Schema/i18n.php @@ -27,6 +27,11 @@ */ class I18nSchema extends CakeSchema { +/** + * The name property + * + * @var string + */ public $name = 'i18n'; /** @@ -48,6 +53,11 @@ class I18nSchema extends CakeSchema { public function after($event = array()) { } +/** + * The i18n table definition + * + * @var array + */ public $i18n = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'), 'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'), diff --git a/app/Config/Schema/sessions.php b/app/Config/Schema/sessions.php index 27f76d0a0..bd7b1efc3 100644 --- a/app/Config/Schema/sessions.php +++ b/app/Config/Schema/sessions.php @@ -18,14 +18,17 @@ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -/* - * +/** * Using the Schema command line utility * cake schema run create Sessions - * */ class SessionsSchema extends CakeSchema { +/** + * Name property + * + * @var string + */ public $name = 'Sessions'; /** @@ -47,6 +50,11 @@ class SessionsSchema extends CakeSchema { public function after($event = array()) { } +/** + * The cake_sessions table definition + * + * @var array + */ public $cake_sessions = array( 'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'), 'data' => array('type' => 'text', 'null' => true, 'default' => null), diff --git a/app/Config/acl.ini.php b/app/Config/acl.ini.php index 9a4672132..5e6bfb6e0 100644 --- a/app/Config/acl.ini.php +++ b/app/Config/acl.ini.php @@ -15,7 +15,7 @@ ; * @license http://www.opensource.org/licenses/mit-license.php MIT License ; */ -; acl.ini.php - Cake ACL Configuration +; acl.ini.php - CakePHP ACL Configuration ; --------------------------------------------------------------------- ; Use this file to specify user permissions. ; aco = access control object (something in your application) diff --git a/app/Config/bootstrap.php b/app/Config/bootstrap.php index 8633326f0..03cda9cae 100644 --- a/app/Config/bootstrap.php +++ b/app/Config/bootstrap.php @@ -48,7 +48,6 @@ Cache::config('default', array('engine' => 'File')); * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'), * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'), * )); - * */ /** @@ -57,7 +56,6 @@ Cache::config('default', array('engine' => 'File')); * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); - * */ /** @@ -67,7 +65,6 @@ Cache::config('default', array('engine' => 'File')); * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit - * */ /** diff --git a/app/Config/core.php b/app/Config/core.php index d2e163418..a55347ce3 100644 --- a/app/Config/core.php +++ b/app/Config/core.php @@ -18,6 +18,9 @@ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ +//setLocale(LC_ALL, 'deu'); +//Configure::write('Config.language', 'deu'); + /** * CakePHP Debug Level: * @@ -147,13 +150,11 @@ * Enables: * `admin_index()` and `/admin/controller/index` * `manager_index()` and `/manager/controller/index` - * */ //Configure::write('Routing.prefixes', array('admin')); /** * Turn off all caching application-wide. - * */ //Configure::write('Cache.disable', true); @@ -164,7 +165,6 @@ * public $cacheAction inside your controllers to define caching settings. * You can either set it controller-wide by setting public $cacheAction = true, * or in each action using $this->cacheAction = true. - * */ //Configure::write('Cache.check', true); @@ -213,7 +213,6 @@ * * To use database sessions, run the app/Config/Schema/sessions.php schema using * the cake shell command: cake schema create Sessions - * */ Configure::write('Session', array( 'defaults' => 'php' diff --git a/app/Config/database.php.default b/app/Config/database.php.default index c8ee3088c..ebd21d475 100644 --- a/app/Config/database.php.default +++ b/app/Config/database.php.default @@ -1,7 +1,5 @@ * The origin email. See CakeEmail::from() about the valid values - * */ class EmailConfig { diff --git a/app/Config/routes.php b/app/Config/routes.php index a2b963f44..07b570032 100644 --- a/app/Config/routes.php +++ b/app/Config/routes.php @@ -19,6 +19,7 @@ * @since CakePHP(tm) v 0.2.9 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + /** * Here, we are connecting '/' (base path) to controller called 'Pages', * its action called 'display', and we pass a param to select the view file diff --git a/app/View/Elements/empty b/app/View/Elements/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/View/Layouts/rss/default.ctp b/app/View/Layouts/rss/default.ctp index 0ada29463..60a53659f 100644 --- a/app/View/Layouts/rss/default.ctp +++ b/app/View/Layouts/rss/default.ctp @@ -11,4 +11,3 @@ echo $this->Rss->document( array(), $channel, $this->fetch('content') ) ); -?> diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index 39e0e7a54..be3e40ae3 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -1,6 +1,5 @@ @charset "utf-8"; /** - * * Generic CSS for CakePHP * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -84,7 +83,7 @@ p { line-height:20px; background: #003d4c url('../img/cake.icon.png') no-repeat left; color: #fff; - padding: 0px 30px; + padding: 0 30px; } #header h1 a { color: #fff; @@ -174,7 +173,7 @@ td.actions { white-space: nowrap; } table td.actions a { - margin: 0px 6px; + margin: 0 6px; padding:2px 5px; } @@ -336,7 +335,7 @@ option { input[type=checkbox] { clear: left; float: left; - margin: 0px 6px 7px 2px; + margin: 0 6px 7px 2px; width: auto; } div.checkbox label { @@ -365,7 +364,7 @@ form .submit input[type=submit] { background-image: -moz-linear-gradient(top, #76BF6B, #3B8230); border-color: #2d6324; color: #fff; - text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px; + text-shadow: rgba(0, 0, 0, 0.5) 0 -1px 0; padding: 8px 10px; } form .submit input[type=submit]:hover { @@ -527,11 +526,11 @@ input[type=submit], -moz-border-radius: 4px; border-radius: 4px; text-decoration: none; - text-shadow: #fff 0px 1px 0px; + text-shadow: #fff 0 1px 0; min-width: 0; - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2); -webkit-user-select: none; user-select: none; } @@ -551,7 +550,7 @@ input[type=submit]:active, background-image: -ms-linear-gradient(top, #dfdfdf, #eee); background-image: -o-linear-gradient(top, #dfdfdf, #eee); background-image: linear-gradient(top, #dfdfdf, #eee); - text-shadow: #eee 0px 1px 0px; + text-shadow: #eee 0 1px 0; -moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); @@ -627,15 +626,15 @@ pre { -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; - margin: 0px 4px 10px 2px; + margin: 0 4px 10px 2px; font-family: sans-serif; font-size: 14px; line-height: 14px; display: inline-block; text-decoration: none; - -moz-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3); - -webkit-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3); - box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3); + -moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3); + -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3); + box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3); } .cake-code-dump pre { position: relative; @@ -647,13 +646,13 @@ pre { .cake-stack-trace pre { color: #000; background-color: #F0F0F0; - margin: 0px 0 10px 0; + margin: 0 0 10px 0; padding: 1em; overflow: auto; text-shadow: none; } .cake-stack-trace li { - padding: 10px 5px 0px; + padding: 10px 5px 0; margin: 0 0 4px 0; font-family: monospace; border: 1px solid #bbb; @@ -709,7 +708,7 @@ pre { } .code-coverage-results div.start { border:1px solid #aaa; - border-width:1px 1px 0px 1px; + border-width:1px 1px 0 1px; margin-top:30px; padding-top:5px; } diff --git a/app/webroot/index.php b/app/webroot/index.php index 6d4fa486b..a6481b24a 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -33,7 +33,6 @@ if (!defined('DS')) { /** * The full path to the directory which holds "app", WITHOUT a trailing DS. - * */ if (!defined('ROOT')) { define('ROOT', dirname(dirname(dirname(__FILE__)))); @@ -41,7 +40,6 @@ if (!defined('ROOT')) { /** * The actual directory name for the "app". - * */ if (!defined('APP_DIR')) { define('APP_DIR', basename(dirname(dirname(__FILE__)))); @@ -76,7 +74,6 @@ if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispat /** * Editing below this line should NOT be necessary. * Change at your own risk. - * */ if (!defined('WEBROOT_DIR')) { define('WEBROOT_DIR', basename(dirname(__FILE__))); @@ -86,7 +83,7 @@ if (!defined('WWW_ROOT')) { } // for built-in server -if (php_sapi_name() === 'cli-server') { +if (PHP_SAPI === 'cli-server') { if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) { return false; } diff --git a/app/webroot/test.php b/app/webroot/test.php index 22f1cc1e3..a41f0af74 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -34,7 +34,6 @@ if (!defined('DS')) { /** * The full path to the directory which holds "app", WITHOUT a trailing DS. - * */ if (!defined('ROOT')) { define('ROOT', dirname(dirname(dirname(__FILE__)))); @@ -42,7 +41,6 @@ if (!defined('ROOT')) { /** * The actual directory name for the "app". - * */ if (!defined('APP_DIR')) { define('APP_DIR', basename(dirname(dirname(__FILE__)))); @@ -74,7 +72,6 @@ if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispat /** * Editing below this line should not be necessary. * Change at your own risk. - * */ if (!defined('WEBROOT_DIR')) { define('WEBROOT_DIR', basename(dirname(__FILE__))); @@ -100,7 +97,7 @@ if (!empty($failed)) { } if (Configure::read('debug') < 1) { - throw new NotFoundException(__d('cake_dev', 'Debug setting does not allow access to this url.')); + throw new NotFoundException(__d('cake_dev', 'Debug setting does not allow access to this URL.')); } require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php'; diff --git a/composer.json b/composer.json index e92b8f69d..d5eae1773 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,8 @@ }, "require-dev": { "phpunit/phpunit": "3.7.*", - "cakephp/debug_kit" : "2.2.*" + "cakephp/debug_kit" : "2.2.*", + "cakephp/cakephp-codesniffer": "^1.0.0" }, "bin": [ "lib/Cake/Console/cake" diff --git a/lib/Cake/Console/Command/AclShell.php b/lib/Cake/Console/Command/AclShell.php index f5e493f7a..15536ebb6 100644 --- a/lib/Cake/Console/Command/AclShell.php +++ b/lib/Cake/Console/Command/AclShell.php @@ -558,7 +558,7 @@ class AclShell extends AppShell { * or an array of properties to use in AcoNode::node() * * @param string $class Class type you want (Aro/Aco) - * @param string|array $identifier A mixed identifier for finding the node. + * @param string|array|null $identifier A mixed identifier for finding the node, otherwise null. * @return int Integer of NodeId. Will trigger an error if nothing is found. */ protected function _getNodeId($class, $identifier) { @@ -568,7 +568,7 @@ class AclShell extends AppShell { $identifier = var_export($identifier, true); } $this->error(__d('cake_console', 'Could not find node using reference "%s"', $identifier)); - return; + return null; } return Hash::get($node, "0.{$class}.id"); } diff --git a/lib/Cake/Console/Command/Task/FixtureTask.php b/lib/Cake/Console/Command/Task/FixtureTask.php index 05caa4629..1f578d083 100644 --- a/lib/Cake/Console/Command/Task/FixtureTask.php +++ b/lib/Cake/Console/Command/Task/FixtureTask.php @@ -74,7 +74,7 @@ class FixtureTask extends BakeTask { ))->addOption('count', array( 'help' => __d('cake_console', 'When using generated data, the number of records to include in the fixture(s).'), 'short' => 'n', - 'default' => 10 + 'default' => 1 ))->addOption('connection', array( 'help' => __d('cake_console', 'Which database configuration to use for baking.'), 'short' => 'c', @@ -210,7 +210,7 @@ class FixtureTask extends BakeTask { * @param string $model Name of model to bake. * @param string $useTable Name of table to use. * @param array $importOptions Options for public $import - * @return string Baked fixture content + * @return string|null Baked fixture content, otherwise null. */ public function bake($model, $useTable = false, $importOptions = array()) { App::uses('CakeSchema', 'Model'); @@ -243,7 +243,7 @@ class FixtureTask extends BakeTask { $data = $this->_Schema->read(array('models' => false, 'connection' => $this->connection)); if (!isset($data['tables'][$useTable])) { $this->err("Warning: Could not find the '${useTable}' table for ${model}."); - return; + return null; } $tableInfo = $data['tables'][$useTable]; diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php index 2c49775dc..06ecf0013 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -89,7 +89,7 @@ class ViewTask extends BakeTask { $this->_interactive(); } if (empty($this->args[0])) { - return; + return null; } if (!isset($this->connection)) { $this->connection = 'default'; diff --git a/lib/Cake/Console/Command/TestShell.php b/lib/Cake/Console/Command/TestShell.php index 15012bfeb..fe6cfd873 100644 --- a/lib/Cake/Console/Command/TestShell.php +++ b/lib/Cake/Console/Command/TestShell.php @@ -179,11 +179,11 @@ class TestShell extends Shell { /** * Parse the CLI options into an array CakeTestDispatcher can use. * - * @return array Array of params for CakeTestDispatcher + * @return array|null Array of params for CakeTestDispatcher or null. */ protected function _parseArgs() { if (empty($this->args)) { - return; + return null; } $params = array( 'core' => false, diff --git a/lib/Cake/Console/Templates/default/classes/controller.ctp b/lib/Cake/Console/Templates/default/classes/controller.ctp index 3e5a3004e..6beb4b401 100644 --- a/lib/Cake/Console/Templates/default/classes/controller.ctp +++ b/lib/Cake/Console/Templates/default/classes/controller.ctp @@ -23,10 +23,10 @@ echo "App::uses('{$plugin}AppController', '{$pluginPath}Controller');\n"; ?> /** * Controller - * - //The Associations below have been created with all possible keys, those that are not needed can be removed + // The Associations below have been created with all possible keys, those that are not needed can be removed \n"; - + diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php index 6ab31d633..9a4f54337 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php @@ -9,11 +9,9 @@ * @since CakePHP(tm) v 0.2.9 */ -/* - * +/** * Using the Schema command line utility * cake schema run create DbAcl - * */ class DbAclSchema extends CakeSchema { diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php index 47414d77b..cd598b35e 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php @@ -4,9 +4,18 @@ * * Use it to configure database for i18n * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * For full copyright and license information, please see the LICENSE.txt + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @package app.Config.Schema * @since CakePHP(tm) v 0.2.9 + * @license http://www.opensource.org/licenses/mit-license.php MIT License */ /** @@ -26,26 +35,26 @@ class I18nSchema extends CakeSchema { public $name = 'i18n'; /** - * Before event. + * Before callback. * - * @param array $event The event data. - * @return bool success + * @param array $event Schema object properties + * @return bool Should process continue */ public function before($event = array()) { return true; } /** - * After event. + * After callback. * - * @param array $event The event data. + * @param array $event Schema object properties * @return void */ public function after($event = array()) { } /** - * The i18n table property + * The i18n table definition * * @var array */ diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php index 8ae847b3a..bd7b1efc3 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php @@ -4,15 +4,23 @@ * * Use it to configure database for Sessions * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * For full copyright and license information, please see the LICENSE.txt + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @package app.Config.Schema * @since CakePHP(tm) v 0.2.9 + * @license http://www.opensource.org/licenses/mit-license.php MIT License */ /** * Using the Schema command line utility * cake schema run create Sessions - * */ class SessionsSchema extends CakeSchema { @@ -24,26 +32,26 @@ class SessionsSchema extends CakeSchema { public $name = 'Sessions'; /** - * Before event. + * Before callback. * - * @param array $event The event data. - * @return bool Success + * @param array $event Schema object properties + * @return bool Should process continue */ public function before($event = array()) { return true; } /** - * After event. + * After callback. * - * @param array $event The event data. + * @param array $event Schema object properties * @return void */ public function after($event = array()) { } /** - * cake_sessions table definition + * The cake_sessions table definition * * @var array */ diff --git a/lib/Cake/Console/Templates/skel/Config/bootstrap.php b/lib/Cake/Console/Templates/skel/Config/bootstrap.php index 7fe55949c..8b54c36ec 100644 --- a/lib/Cake/Console/Templates/skel/Config/bootstrap.php +++ b/lib/Cake/Console/Templates/skel/Config/bootstrap.php @@ -39,7 +39,6 @@ Cache::config('default', array('engine' => 'File')); * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'), * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'), * )); - * */ /** @@ -48,7 +47,6 @@ Cache::config('default', array('engine' => 'File')); * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); - * */ /** @@ -58,7 +56,6 @@ Cache::config('default', array('engine' => 'File')); * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit - * */ /** diff --git a/lib/Cake/Console/Templates/skel/Config/core.php b/lib/Cake/Console/Templates/skel/Config/core.php index 11d8f9042..18d645a33 100644 --- a/lib/Cake/Console/Templates/skel/Config/core.php +++ b/lib/Cake/Console/Templates/skel/Config/core.php @@ -138,13 +138,11 @@ * Enables: * `admin_index()` and `/admin/controller/index` * `manager_index()` and `/manager/controller/index` - * */ //Configure::write('Routing.prefixes', array('admin')); /** * Turn off all caching application-wide. - * */ //Configure::write('Cache.disable', true); @@ -155,7 +153,6 @@ * public $cacheAction inside your controllers to define caching settings. * You can either set it controller-wide by setting public $cacheAction = true, * or in each action using $this->cacheAction = true. - * */ //Configure::write('Cache.check', true); @@ -204,7 +201,6 @@ * * To use database sessions, run the app/Config/Schema/sessions.php schema using * the cake shell command: cake schema create Sessions - * */ Configure::write('Session', array( 'defaults' => 'php' diff --git a/lib/Cake/Console/Templates/skel/Config/database.php.default b/lib/Cake/Console/Templates/skel/Config/database.php.default index 00ad15507..cc549a5f6 100644 --- a/lib/Cake/Console/Templates/skel/Config/database.php.default +++ b/lib/Cake/Console/Templates/skel/Config/database.php.default @@ -1,7 +1,5 @@ * The origin email. See CakeEmail::from() about the valid values - * */ class EmailConfig { diff --git a/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp b/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp index 63874c1cc..a1333dc19 100644 --- a/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp +++ b/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp @@ -19,5 +19,4 @@ $content = explode("\n", $content); foreach ($content as $line): echo '

' . $line . "

\n"; -endforeach; -?> \ No newline at end of file +endforeach; \ No newline at end of file diff --git a/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp b/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp index 8e4ff3d0a..6c84d88fa 100644 --- a/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp +++ b/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp @@ -17,4 +17,3 @@ if (Configure::read('debug') > 0): echo $this->element('exception_stack_trace'); endif; -?> diff --git a/lib/Cake/Console/Templates/skel/View/Errors/error500.ctp b/lib/Cake/Console/Templates/skel/View/Errors/error500.ctp index c1d5ffb55..339e140da 100644 --- a/lib/Cake/Console/Templates/skel/View/Errors/error500.ctp +++ b/lib/Cake/Console/Templates/skel/View/Errors/error500.ctp @@ -14,4 +14,3 @@ if (Configure::read('debug') > 0): echo $this->element('exception_stack_trace'); endif; -?> diff --git a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp index 0a028702e..5bac4537f 100644 --- a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp +++ b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp @@ -62,7 +62,7 @@ endif; $settings = Cache::settings(); if (!empty($settings)): echo ''; - echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', ''. $settings['engine'] . 'Engine', 'APP/Config/core.php'); + echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', '' . $settings['engine'] . 'Engine', 'APP/Config/core.php'); echo ''; else: echo ''; diff --git a/lib/Cake/Console/Templates/skel/webroot/css/cake.generic.css b/lib/Cake/Console/Templates/skel/webroot/css/cake.generic.css index 9bdf5307a..ddfda2b4b 100644 --- a/lib/Cake/Console/Templates/skel/webroot/css/cake.generic.css +++ b/lib/Cake/Console/Templates/skel/webroot/css/cake.generic.css @@ -1,6 +1,5 @@ @charset "utf-8"; /** - * * Generic CSS for CakePHP * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -84,7 +83,7 @@ p { line-height:20px; background: #003d4c url('../img/cake.icon.png') no-repeat left; color: #fff; - padding: 0px 30px; + padding: 0 30px; } #header h1 a { color: #fff; @@ -172,7 +171,7 @@ td.actions { white-space: nowrap; } table td.actions a { - margin: 0px 6px; + margin: 0 6px; padding:2px 5px; } @@ -334,7 +333,7 @@ option { input[type=checkbox] { clear: left; float: left; - margin: 0px 6px 7px 2px; + margin: 0 6px 7px 2px; width: auto; } div.checkbox label { @@ -363,7 +362,7 @@ form .submit input[type=submit] { background-image: -moz-linear-gradient(top, #76BF6B, #3B8230); border-color: #2d6324; color: #fff; - text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px; + text-shadow: rgba(0, 0, 0, 0.5) 0 -1px 0; padding: 8px 10px; } form .submit input[type=submit]:hover { @@ -525,11 +524,11 @@ input[type=submit], -moz-border-radius: 4px; border-radius: 4px; text-decoration: none; - text-shadow: #fff 0px 1px 0px; + text-shadow: #fff 0 1px 0; min-width: 0; - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2); -webkit-user-select: none; user-select: none; } @@ -549,7 +548,7 @@ input[type=submit]:active, background-image: -ms-linear-gradient(top, #dfdfdf, #eee); background-image: -o-linear-gradient(top, #dfdfdf, #eee); background-image: linear-gradient(top, #dfdfdf, #eee); - text-shadow: #eee 0px 1px 0px; + text-shadow: #eee 0 1px 0; -moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); @@ -625,15 +624,15 @@ pre { -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; - margin: 0px 4px 10px 2px; + margin: 0 4px 10px 2px; font-family: sans-serif; font-size: 14px; line-height: 14px; display: inline-block; text-decoration: none; - -moz-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3); - -webkit-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3); - box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3); + -moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3); + -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3); + box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3); } .cake-code-dump pre { position: relative; @@ -645,13 +644,13 @@ pre { .cake-stack-trace pre { color: #000; background-color: #F0F0F0; - margin: 0px 0 10px 0; + margin: 0 0 10px 0; padding: 1em; overflow: auto; text-shadow: none; } .cake-stack-trace li { - padding: 10px 5px 0px; + padding: 10px 5px 0; margin: 0 0 4px 0; font-family: monospace; border: 1px solid #bbb; @@ -707,7 +706,7 @@ pre { } .code-coverage-results div.start { border:1px solid #aaa; - border-width:1px 1px 0px 1px; + border-width:1px 1px 0 1px; margin-top:30px; padding-top:5px; } diff --git a/lib/Cake/Console/Templates/skel/webroot/index.php b/lib/Cake/Console/Templates/skel/webroot/index.php index e546e52ca..2db183b8d 100644 --- a/lib/Cake/Console/Templates/skel/webroot/index.php +++ b/lib/Cake/Console/Templates/skel/webroot/index.php @@ -24,7 +24,6 @@ if (!defined('DS')) { /** * The full path to the directory which holds "app", WITHOUT a trailing DS. - * */ if (!defined('ROOT')) { define('ROOT', dirname(dirname(dirname(__FILE__)))); @@ -32,7 +31,6 @@ if (!defined('ROOT')) { /** * The actual directory name for the "app". - * */ if (!defined('APP_DIR')) { define('APP_DIR', basename(dirname(dirname(__FILE__)))); @@ -67,7 +65,6 @@ if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispat /** * Editing below this line should NOT be necessary. * Change at your own risk. - * */ if (!defined('WEBROOT_DIR')) { define('WEBROOT_DIR', basename(dirname(__FILE__))); diff --git a/lib/Cake/Console/Templates/skel/webroot/test.php b/lib/Cake/Console/Templates/skel/webroot/test.php index 0de048175..08eb92f3a 100644 --- a/lib/Cake/Console/Templates/skel/webroot/test.php +++ b/lib/Cake/Console/Templates/skel/webroot/test.php @@ -25,7 +25,6 @@ if (!defined('DS')) { /** * The full path to the directory which holds "app", WITHOUT a trailing DS. - * */ if (!defined('ROOT')) { define('ROOT', dirname(dirname(dirname(__FILE__)))); @@ -33,7 +32,6 @@ if (!defined('ROOT')) { /** * The actual directory name for the "app". - * */ if (!defined('APP_DIR')) { define('APP_DIR', basename(dirname(dirname(__FILE__)))); @@ -65,7 +63,6 @@ if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispat /** * Editing below this line should not be necessary. * Change at your own risk. - * */ if (!defined('WEBROOT_DIR')) { define('WEBROOT_DIR', basename(dirname(__FILE__))); diff --git a/lib/Cake/Controller/Component/Acl/DbAcl.php b/lib/Cake/Controller/Component/Acl/DbAcl.php index 33dfd3e4f..7d7db6522 100644 --- a/lib/Cake/Controller/Component/Acl/DbAcl.php +++ b/lib/Cake/Controller/Component/Acl/DbAcl.php @@ -41,7 +41,6 @@ class DbAcl extends Object implements AclInterface { /** * Constructor - * */ public function __construct() { parent::__construct(); diff --git a/lib/Cake/Controller/Component/Acl/PhpAcl.php b/lib/Cake/Controller/Component/Acl/PhpAcl.php index b3b95d666..40d2a77ae 100644 --- a/lib/Cake/Controller/Component/Acl/PhpAcl.php +++ b/lib/Cake/Controller/Component/Acl/PhpAcl.php @@ -196,7 +196,6 @@ class PhpAcl extends Object implements AclInterface { /** * Access Control Object - * */ class PhpAco { @@ -361,7 +360,6 @@ class PhpAco { /** * Access Request Object - * */ class PhpAro { diff --git a/lib/Cake/Controller/Component/AclComponent.php b/lib/Cake/Controller/Component/AclComponent.php index 184e43634..cc74f24cc 100644 --- a/lib/Cake/Controller/Component/AclComponent.php +++ b/lib/Cake/Controller/Component/AclComponent.php @@ -79,7 +79,7 @@ class AclComponent extends Component { * Will call the initialize method on the adapter if setting a new one. * * @param AclInterface|string $adapter Instance of AclInterface or a string name of the class to use. (optional) - * @return AclInterface|void either null, or the adapter implementation. + * @return AclInterface|null Either null, or the adapter implementation. * @throws CakeException when the given class is not an instance of AclInterface */ public function adapter($adapter = null) { @@ -92,7 +92,7 @@ class AclComponent extends Component { } $this->_Instance = $adapter; $this->_Instance->initialize($this); - return; + return null; } return $this->_Instance; } diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index e36114419..56b6a06dd 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -481,7 +481,7 @@ class AuthComponent extends Component { */ public function constructAuthorize() { if (empty($this->authorize)) { - return; + return null; } $this->_authorizeObjects = array(); $config = Hash::normalize((array)$this->authorize); @@ -772,12 +772,12 @@ class AuthComponent extends Component { /** * Loads the configured authentication objects. * - * @return mixed either null on empty authenticate value, or an array of loaded objects. + * @return mixed Either null on empty authenticate value, or an array of loaded objects. * @throws CakeException */ public function constructAuthenticate() { if (empty($this->authenticate)) { - return; + return null; } $this->_authenticateObjects = array(); $config = Hash::normalize((array)$this->authenticate); diff --git a/lib/Cake/Controller/Component/CookieComponent.php b/lib/Cake/Controller/Component/CookieComponent.php index 6ed908d55..2bb75194d 100644 --- a/lib/Cake/Controller/Component/CookieComponent.php +++ b/lib/Cake/Controller/Component/CookieComponent.php @@ -27,7 +27,6 @@ App::uses('Hash', 'Utility'); * * @package Cake.Controller.Component * @link http://book.cakephp.org/2.0/en/core-libraries/components/cookie.html - * */ class CookieComponent extends Component { diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php index 271b56773..ea1d72704 100644 --- a/lib/Cake/Controller/Component/RequestHandlerComponent.php +++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php @@ -32,7 +32,6 @@ App::uses('Xml', 'Utility'); * * @package Cake.Controller.Component * @link http://book.cakephp.org/2.0/en/core-libraries/components/request-handling.html - * */ class RequestHandlerComponent extends Component { @@ -280,7 +279,7 @@ class RequestHandlerComponent extends Component { * "304 Not Modified" header. * * @param Controller $controller Controller instance. - * @return bool false if the render process should be aborted + * @return bool False if the render process should be aborted. */ public function beforeRender(Controller $controller) { if ($this->settings['checkHttpCache'] && $this->response->checkNotModified($this->request)) { diff --git a/lib/Cake/Controller/Component/SessionComponent.php b/lib/Cake/Controller/Component/SessionComponent.php index cb196775a..0a7dd062e 100644 --- a/lib/Cake/Controller/Component/SessionComponent.php +++ b/lib/Cake/Controller/Component/SessionComponent.php @@ -34,7 +34,7 @@ class SessionComponent extends Component { * Get / Set the userAgent * * @param string $userAgent Set the userAgent - * @return void + * @return string Current user agent. */ public function userAgent($userAgent = null) { return CakeSession::userAgent($userAgent); diff --git a/lib/Cake/Core/Object.php b/lib/Cake/Core/Object.php index 59ec9e3ef..ffc7f19dc 100644 --- a/lib/Cake/Core/Object.php +++ b/lib/Cake/Core/Object.php @@ -31,7 +31,6 @@ class Object { /** * Constructor, no-op - * */ public function __construct() { } diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php index 2cce57689..3192ed5f8 100644 --- a/lib/Cake/Error/ErrorHandler.php +++ b/lib/Cake/Error/ErrorHandler.php @@ -230,6 +230,16 @@ class ErrorHandler { } $message = $error . ' (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']'; if (!empty($errorConfig['trace'])) { + // https://bugs.php.net/bug.php?id=65322 + if (version_compare(PHP_VERSION, '5.4.21', '<')) { + if (!class_exists('Debugger')) { + App::load('Debugger'); + } + if (!class_exists('CakeText')) { + App::uses('CakeText', 'Utility'); + App::load('CakeText'); + } + } $trace = Debugger::trace(array('start' => 1, 'format' => 'log')); $message .= "\nTrace:\n" . $trace . "\n"; } diff --git a/lib/Cake/Event/CakeEvent.php b/lib/Cake/Event/CakeEvent.php index 869609283..d8ed26234 100644 --- a/lib/Cake/Event/CakeEvent.php +++ b/lib/Cake/Event/CakeEvent.php @@ -71,7 +71,6 @@ class CakeEvent { * $event = new CakeEvent('Order.afterBuy', $this, array('buyer' => $userData)); * $event = new CakeEvent('User.afterRegister', $UserModel); * ``` - * */ public function __construct($name, $subject = null, $data = null) { $this->_name = $name; diff --git a/lib/Cake/Log/Engine/FileLog.php b/lib/Cake/Log/Engine/FileLog.php index 840889466..988ed341f 100644 --- a/lib/Cake/Log/Engine/FileLog.php +++ b/lib/Cake/Log/Engine/FileLog.php @@ -182,7 +182,7 @@ class FileLog extends BaseLog { * Also if `rotate` count is reached oldest file is removed. * * @param string $filename Log file name - * @return mixed True if rotated successfully or false in case of error. + * @return mixed True if rotated successfully or false in case of error, otherwise null. * Void if file doesn't need to be rotated. */ protected function _rotateFile($filename) { @@ -196,7 +196,7 @@ class FileLog extends BaseLog { if (!file_exists($filepath) || filesize($filepath) < $this->_size ) { - return; + return null; } if ($this->_config['rotate'] === 0) { diff --git a/lib/Cake/Model/AclNode.php b/lib/Cake/Model/AclNode.php index ab73f7b1d..1080b9a22 100644 --- a/lib/Cake/Model/AclNode.php +++ b/lib/Cake/Model/AclNode.php @@ -39,7 +39,6 @@ class AclNode extends Model { /** * Constructor - * */ public function __construct() { $config = Configure::read('Acl.database'); diff --git a/lib/Cake/Model/Datasource/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php index b6c20b209..b3b471686 100644 --- a/lib/Cake/Model/Datasource/CakeSession.php +++ b/lib/Cake/Model/Datasource/CakeSession.php @@ -357,7 +357,7 @@ class CakeSession { * Get / Set the user agent * * @param string|null $userAgent Set the user agent - * @return string Current user agent + * @return string Current user agent. */ public static function userAgent($userAgent = null) { if ($userAgent) { diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index 6a6828e2f..24358c107 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -352,7 +352,7 @@ class Mysql extends DboSource { if (in_array($fields[$column->Field]['type'], $this->fieldParameters['unsigned']['types'], true)) { $fields[$column->Field]['unsigned'] = $this->_unsigned($column->Type); } - if ($fields[$column->Field]['type'] === 'timestamp' && strtoupper($column->Default) === 'CURRENT_TIMESTAMP') { + if (in_array($fields[$column->Field]['type'], array('timestamp', 'datetime')) && strtoupper($column->Default) === 'CURRENT_TIMESTAMP') { $fields[$column->Field]['default'] = null; } if (!empty($column->Key) && isset($this->index[$column->Key])) { diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index a41e88cef..a01cee654 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -284,7 +284,7 @@ class DboSource extends DataSource { if ($this->_result instanceof PDOStatement) { $this->_result->closeCursor(); } - unset($this->_connection); + $this->_connection = null; $this->connected = false; return true; } @@ -857,12 +857,16 @@ class DboSource extends DataSource { * @return bool True if the database is connected, else false */ public function isConnected() { - try { - $connected = $this->_connection->query('SELECT 1'); - } catch (Exception $e) { + if ($this->_connection === null) { $connected = false; + } else { + try { + $connected = $this->_connection->query('SELECT 1'); + } catch (Exception $e) { + $connected = false; + } } - $this->connected = ! empty($connected); + $this->connected = !empty($connected); return $this->connected; } @@ -1264,7 +1268,7 @@ class DboSource extends DataSource { $queryTemplate = $this->generateAssociationQuery($Model, $LinkModel, $type, $association, $assocData, $queryData, $external); if (empty($queryTemplate)) { - return; + return null; } if (!is_array($resultSet)) { @@ -1958,7 +1962,7 @@ class DboSource extends DataSource { * * @param string $type type of query being run. e.g select, create, update, delete, schema, alter. * @param array $data Array of data to insert into the query. - * @return string Rendered SQL expression to be run. + * @return string|null Rendered SQL expression to be run, otherwise null. */ public function renderStatement($type, $data) { extract($data); @@ -1992,7 +1996,7 @@ class DboSource extends DataSource { } return "CREATE TABLE {$table} (\n{$columns}{$indexes}) {$tableParameters};"; case 'alter': - return; + return null; } } diff --git a/lib/Cake/Model/Datasource/Session/DatabaseSession.php b/lib/Cake/Model/Datasource/Session/DatabaseSession.php index 08c398a7a..a9c6e8627 100644 --- a/lib/Cake/Model/Datasource/Session/DatabaseSession.php +++ b/lib/Cake/Model/Datasource/Session/DatabaseSession.php @@ -43,7 +43,6 @@ class DatabaseSession implements CakeSessionHandlerInterface { /** * Constructor. Looks at Session configuration information and * sets up the session model. - * */ public function __construct() { $modelName = Configure::read('Session.handler.model'); diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 9ded1b59e..23f39d7cc 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -1190,12 +1190,12 @@ class Model extends Object implements CakeEventListener { * * @param string|array|SimpleXmlElement|DomNode $one Array or string of data * @param string $two Value string for the alternative indata method - * @return array Data with all of $one's keys and values + * @return array|null Data with all of $one's keys and values, otherwise null. * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html */ public function set($one, $two = null) { if (!$one) { - return; + return null; } if (is_object($one)) { @@ -1835,7 +1835,12 @@ class Model extends Object implements CakeEventListener { $now = time(); foreach ($dateFields as $updateCol) { - if (in_array($updateCol, $fields) || !$this->hasField($updateCol)) { + $fieldHasValue = in_array($updateCol, $fields); + $fieldInWhitelist = ( + count($this->whitelist) === 0 || + in_array($updateCol, $this->whitelist) + ); + if (($fieldHasValue && $fieldInWhitelist) || !$this->hasField($updateCol)) { continue; } diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index a19299228..6815c8c11 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -452,7 +452,7 @@ class CakeResponse { /** * Formats the Content-Type header based on the configured contentType and charset - * the charset will only be set in the header if the response is of type text/* + * the charset will only be set in the header if the response is of type text * * @return void */ @@ -832,7 +832,7 @@ class CakeResponse { if (!$public && !$private && !$noCache) { return null; } - $sharable = $public || ! ($private || $noCache); + $sharable = $public || !($private || $noCache); return $sharable; } if ($public) { diff --git a/lib/Cake/Network/CakeSocket.php b/lib/Cake/Network/CakeSocket.php index b4c378900..aebdee191 100644 --- a/lib/Cake/Network/CakeSocket.php +++ b/lib/Cake/Network/CakeSocket.php @@ -216,7 +216,7 @@ class CakeSocket { */ public function context() { if (!$this->connection) { - return; + return null; } return stream_context_get_options($this->connection); } diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php index 13e2a2248..35a2df21e 100644 --- a/lib/Cake/Routing/Dispatcher.php +++ b/lib/Cake/Routing/Dispatcher.php @@ -137,7 +137,7 @@ class Dispatcher implements CakeEventListener { * @param CakeRequest $request Request object to dispatch. * @param CakeResponse $response Response object to put the results of the dispatch into. * @param array $additionalParams Settings array ("bare", "return") which is melded with the GET and POST params - * @return string|void if `$request['return']` is set then it returns response body, null otherwise + * @return string|null if `$request['return']` is set then it returns response body, null otherwise * @triggers Dispatcher.beforeDispatch $this, compact('request', 'response', 'additionalParams') * @triggers Dispatcher.afterDispatch $this, compact('request', 'response') * @throws MissingControllerException When the controller is missing. @@ -152,7 +152,7 @@ class Dispatcher implements CakeEventListener { return $beforeEvent->result->body(); } $beforeEvent->result->send(); - return; + return null; } $controller = $this->_getController($request, $response); diff --git a/lib/Cake/Routing/Filter/AssetDispatcher.php b/lib/Cake/Routing/Filter/AssetDispatcher.php index 3a4908bcf..c90a8235c 100644 --- a/lib/Cake/Routing/Filter/AssetDispatcher.php +++ b/lib/Cake/Routing/Filter/AssetDispatcher.php @@ -42,7 +42,7 @@ class AssetDispatcher extends DispatcherFilter { public function beforeDispatch(CakeEvent $event) { $url = urldecode($event->data['request']->url); if (strpos($url, '..') !== false || strpos($url, '.') === false) { - return; + return null; } if ($result = $this->_filterAsset($event)) { diff --git a/lib/Cake/Routing/Filter/CacheDispatcher.php b/lib/Cake/Routing/Filter/CacheDispatcher.php index 9219005bb..24361bf3b 100644 --- a/lib/Cake/Routing/Filter/CacheDispatcher.php +++ b/lib/Cake/Routing/Filter/CacheDispatcher.php @@ -39,7 +39,7 @@ class CacheDispatcher extends DispatcherFilter { */ public function beforeDispatch(CakeEvent $event) { if (Configure::read('Cache.check') !== true) { - return; + return null; } $path = $event->data['request']->here(); diff --git a/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php b/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php index 0b68f999a..5a194db08 100644 --- a/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php +++ b/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php @@ -37,7 +37,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $this->assertEquals($parser, $result, 'Setting description is not chainable'); $this->assertEquals('A test', $parser->description(), 'getting value is wrong.'); - $result = $parser->description(array('A test', 'something')); + $parser->description(array('A test', 'something')); $this->assertEquals("A test\nsomething", $parser->description(), 'getting value is wrong.'); } @@ -53,7 +53,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $this->assertEquals($parser, $result, 'Setting epilog is not chainable'); $this->assertEquals('A test', $parser->epilog(), 'getting value is wrong.'); - $result = $parser->epilog(array('A test', 'something')); + $parser->epilog(array('A test', 'something')); $this->assertEquals("A test\nsomething", $parser->epilog(), 'getting value is wrong.'); } @@ -294,7 +294,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $expected = array('name' => 'mark', 'help' => false); $this->assertEquals($expected, $result[0], 'Got the correct value.'); - $result = $parser->parse(array('--name', 'jimmy')); + $parser->parse(array('--name', 'jimmy')); } /** @@ -384,7 +384,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $result = $parser->parse($expected); $this->assertEquals($expected, $result[1], 'Arguments are not as expected'); - $result = $parser->parse(array('one', 'two', 'three')); + $parser->parse(array('one', 'two', 'three')); } /** @@ -430,7 +430,7 @@ class ConsoleOptionParserTest extends CakeTestCase { $expected = array('mark', 'samurai', 'sword'); $this->assertEquals($expected, $result[1], 'Got the correct value.'); - $result = $parser->parse(array('jose', 'coder')); + $parser->parse(array('jose', 'coder')); } /** diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php index d4f2b6347..b1f927a58 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php @@ -155,7 +155,6 @@ class DbAclTwoTest extends DbAcl { /** * construct method - * */ public function __construct() { $this->Aro = new AroTwoTest(); diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php index 8c57c6e76..80bb5c258 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php @@ -45,6 +45,8 @@ class ControllerAuthorizeTest extends CakeTestCase { } /** + * testControllerTypeError + * * @expectedException PHPUnit_Framework_Error * @return void */ @@ -53,6 +55,8 @@ class ControllerAuthorizeTest extends CakeTestCase { } /** + * testControllerErrorOnMissingMethod + * * @expectedException CakeException * @return void */ diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index b66252f24..8faae470a 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -176,7 +176,6 @@ class AuthTestController extends Controller { /** * construct method - * */ public function __construct($request, $response) { $request->addParams(Router::parse('/auth_test')); @@ -1319,7 +1318,7 @@ class AuthComponentTest extends CakeTestCase { ->with('HTTP/1.1 403 Forbidden', null); $this->Auth->initialize($this->Controller); - $result = $this->Auth->startup($this->Controller); + $this->Auth->startup($this->Controller); $this->assertArrayNotHasKey('Location', $this->Controller->response->header()); $this->assertNull($this->Controller->testUrl, 'redirect() not called'); diff --git a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php index 234d2dac3..fbcccc266 100644 --- a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php @@ -486,7 +486,7 @@ class PaginatorComponentTest extends CakeTestCase { $Controller->request->params['named'] = array('limit' => 12); $Controller->Paginator->settings = array('limit' => 30, 'maxLimit' => 100, 'paramType' => 'named'); - $result = $Controller->Paginator->paginate('PaginatorControllerPost'); + $Controller->Paginator->paginate('PaginatorControllerPost'); $paging = $Controller->params['paging']['PaginatorControllerPost']; $this->assertEquals(12, $Controller->PaginatorControllerPost->lastQueries[0]['limit']); @@ -504,7 +504,7 @@ class PaginatorComponentTest extends CakeTestCase { 'paramType' => 'named' ) ); - $result = $Controller->Paginator->paginate('ControllerPaginateModel'); + $Controller->Paginator->paginate('ControllerPaginateModel'); $expected = array( 'contain' => array('ControllerPaginateModel'), 'group' => 'Comment.author_id', diff --git a/lib/Cake/Test/Case/Controller/ControllerTest.php b/lib/Cake/Test/Case/Controller/ControllerTest.php index f319bd167..a8abc2bdd 100644 --- a/lib/Cake/Test/Case/Controller/ControllerTest.php +++ b/lib/Cake/Test/Case/Controller/ControllerTest.php @@ -653,7 +653,7 @@ class ControllerTest extends CakeTestCase { $expected = $Controller->ControllerComment->validationErrors; $Controller->viewPath = 'Posts'; - $result = $Controller->render('index'); + $Controller->render('index'); $View = $Controller->View; $this->assertTrue(isset($View->validationErrors['ControllerComment'])); $this->assertEquals($expected, $View->validationErrors['ControllerComment']); diff --git a/lib/Cake/Test/Case/Core/CakePluginTest.php b/lib/Cake/Test/Case/Core/CakePluginTest.php index 94bc3c5ac..3398d1661 100644 --- a/lib/Cake/Test/Case/Core/CakePluginTest.php +++ b/lib/Cake/Test/Case/Core/CakePluginTest.php @@ -20,7 +20,6 @@ App::uses('CakePlugin', 'Core'); /** * CakePluginTest class - * */ class CakePluginTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Core/ConfigureTest.php b/lib/Cake/Test/Case/Core/ConfigureTest.php index a0c321e1a..744932dac 100644 --- a/lib/Cake/Test/Case/Core/ConfigureTest.php +++ b/lib/Cake/Test/Case/Core/ConfigureTest.php @@ -69,6 +69,7 @@ class ConfigureTest extends CakeTestCase { /** * Test to ensure bootrapping doesn't overwrite prior configs set under 'App' key + * * @return void */ public function testBootstrap() { @@ -469,6 +470,8 @@ class ConfigureTest extends CakeTestCase { } /** + * testDumpNoAdapter + * * @expectedException ConfigureException * @return void */ diff --git a/lib/Cake/Test/Case/Core/ObjectTest.php b/lib/Cake/Test/Case/Core/ObjectTest.php index c44291a3f..1556baa89 100644 --- a/lib/Cake/Test/Case/Core/ObjectTest.php +++ b/lib/Cake/Test/Case/Core/ObjectTest.php @@ -73,7 +73,7 @@ class RequestActionController extends Controller { /** * normal_request_action method * - * @return void + * @return string Hello World! */ public function normal_request_action() { return 'Hello World'; @@ -82,7 +82,7 @@ class RequestActionController extends Controller { /** * returns $this->here * - * @return void + * @return string $this->here. */ public function return_here() { return $this->here; @@ -91,7 +91,7 @@ class RequestActionController extends Controller { /** * paginate_request_action method * - * @return void + * @return true */ public function paginate_request_action() { $this->paginate(); @@ -251,8 +251,9 @@ class TestObject extends Object { } /** - * undocumented function + * Set properties. * + * @param array $properties The $properties. * @return void */ public function set($properties = array()) { diff --git a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php index 5eb8d3a2c..db16e6b7f 100644 --- a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php +++ b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php @@ -88,7 +88,6 @@ class CustomTestEventListener extends CakeEventTestListener implements CakeEvent /** * Tests the CakeEventManager class functionality - * */ class CakeEventManagerTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Event/CakeEventTest.php b/lib/Cake/Test/Case/Event/CakeEventTest.php index 9ba28d3a9..3bb4771f9 100644 --- a/lib/Cake/Test/Case/Event/CakeEventTest.php +++ b/lib/Cake/Test/Case/Event/CakeEventTest.php @@ -22,7 +22,6 @@ App::uses('CakeEvent', 'Event'); /** * Tests the CakeEvent class functionality - * */ class CakeEventTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Model/AclNodeTest.php b/lib/Cake/Test/Case/Model/AclNodeTest.php index 391ccd79b..ca40243e6 100644 --- a/lib/Cake/Test/Case/Model/AclNodeTest.php +++ b/lib/Cake/Test/Case/Model/AclNodeTest.php @@ -181,8 +181,7 @@ class DbAroUserTest extends CakeTestModel { class TestDbAcl extends DbAcl { /** - * construct method - * + * Constructor */ public function __construct() { $this->Aro = new DbAroTest(); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 6c52c06d3..6ad52f539 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -926,6 +926,44 @@ SQL; $this->assertContains('`limit_date` timestamp NOT NULL,', $result); } +/** + * Test that describe() ignores `default current_timestamp` in datetime columns. + * This is for MySQL >= 5.6. + * + * @return void + */ + public function testDescribeHandleCurrentTimestampDatetime() { + $mysqlVersion = $this->Dbo->query('SELECT VERSION() as version', array('log' => false)); + $this->skipIf(version_compare($mysqlVersion[0][0]['version'], '5.6.0', '<')); + + $name = $this->Dbo->fullTableName('timestamp_default_values'); + $sql = <<Dbo->execute($sql); + $model = new Model(array( + 'table' => 'timestamp_default_values', + 'ds' => 'test', + 'alias' => 'TimestampDefaultValue' + )); + $result = $this->Dbo->describe($model); + $this->Dbo->execute('DROP TABLE ' . $name); + + $this->assertNull($result['limit_date']['default']); + + $schema = new CakeSchema(array( + 'connection' => 'test', + 'testdescribes' => $result + )); + $result = $this->Dbo->createSchema($schema); + $this->assertContains('`limit_date` datetime NOT NULL,', $result); + } + /** * test that a describe() gets additional fieldParameters * @@ -4092,4 +4130,17 @@ SQL; $this->assertEquals("'a'", $result); } +/** + * Test isConnected + * + * @return void + */ + public function testIsConnected() { + $this->Dbo->disconnect(); + $this->assertFalse($this->Dbo->isConnected(), 'Not connected now.'); + + $this->Dbo->connect(); + $this->assertTrue($this->Dbo->isConnected(), 'Should be connected.'); + } + } diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 7974fa7cc..70ca570e9 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -387,6 +387,34 @@ class ModelWriteTest extends BaseModelTest { $this->assertEquals($whitelist, $model->whitelist); } +/** + * Test that save() with a fieldList continues to write + * updated in all cases. + * + * @return void + */ + public function testSaveUpdatedWithFieldList() { + $this->loadFixtures('Post', 'Author'); + $model = ClassRegistry::init('Post'); + $original = $model->find('first', array( + 'conditions' => array('Post.id' => 1) + )); + $data = array( + 'Post' => array( + 'id' => 1, + 'title' => 'New title', + 'updated' => '1999-01-01 00:00:00', + ) + ); + $model->save($data, array( + 'fieldList' => array('title') + )); + $new = $model->find('first', array( + 'conditions' => array('Post.id' => 1) + )); + $this->assertGreaterThan($original['Post']['updated'], $new['Post']['updated']); + } + /** * Test save() resets the whitelist after afterSave * @@ -1960,8 +1988,8 @@ class ModelWriteTest extends BaseModelTest { 'title' => 'New Article With Tags and fieldList', 'body' => '', 'published' => 'N', - 'created' => '', - 'updated' => '' + 'created' => static::date(), + 'updated' => static::date(), ), 'Tag' => array( 0 => array( diff --git a/lib/Cake/Test/Case/Model/models.php b/lib/Cake/Test/Case/Model/models.php index 33a0cda21..ea8d36426 100644 --- a/lib/Cake/Test/Case/Model/models.php +++ b/lib/Cake/Test/Case/Model/models.php @@ -4781,7 +4781,6 @@ class MysqlTestModel extends Model { /** * Test model for datasource prefixes - * */ class PrefixTestModel extends CakeTestModel { } diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index 2dfdfea4e..b588565a5 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -318,12 +318,6 @@ class CakeRequestTest extends CakeTestCase { $request->reConstruct(); $this->assertEquals($data, $request->data); - $data = array( - 'data' => array( - 'Article' => array('title' => 'Testing'), - ), - 'action' => 'update' - ); $request = $this->getMock('TestCakeRequest', array('_readInput')); $request->expects($this->at(0))->method('_readInput') ->will($this->returnValue('data[Article][title]=Testing&action=update')); @@ -2261,7 +2255,7 @@ class CakeRequestTest extends CakeTestCase { // Checking if requested $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'es_mx,en_ca'; - $result = CakeRequest::acceptLanguage(); + CakeRequest::acceptLanguage(); $result = CakeRequest::acceptLanguage('en-ca'); $this->assertTrue($result); diff --git a/lib/Cake/Test/Case/Network/CakeResponseTest.php b/lib/Cake/Test/Case/Network/CakeResponseTest.php index 6abe8c97b..cbbe1c7c6 100644 --- a/lib/Cake/Test/Case/Network/CakeResponseTest.php +++ b/lib/Cake/Test/Case/Network/CakeResponseTest.php @@ -566,7 +566,7 @@ class CakeResponseTest extends CakeTestCase { $response->send(); ob_start(); - $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); + $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $goofyOutput = 'I am goofily sending output in the controller'; echo $goofyOutput; $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); @@ -1746,7 +1746,7 @@ class CakeResponseTest extends CakeTestCase { ); $this->assertEquals(416, $response->statusCode()); - $result = $response->send(); + $response->send(); } /** @@ -1787,7 +1787,7 @@ class CakeResponseTest extends CakeTestCase { ); ob_start(); - $result = $response->send(); + $response->send(); ob_get_clean(); } @@ -1876,7 +1876,7 @@ class CakeResponseTest extends CakeTestCase { ); $this->assertEquals(416, $response->statusCode()); - $result = $response->send(); + $response->send(); } /** diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index 7945f7481..a86412ce6 100644 --- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php +++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php @@ -21,7 +21,6 @@ App::uses('File', 'Utility'); /** * Help to test CakeEmail - * */ class TestCakeEmail extends CakeEmail { @@ -36,7 +35,6 @@ class TestCakeEmail extends CakeEmail { /** * Config - * */ protected $_config = array(); @@ -89,7 +87,6 @@ class TestCakeEmail extends CakeEmail { /** * EmailConfig class - * */ class TestEmailConfig { @@ -135,7 +132,6 @@ class TestEmailConfig { /** * ExtendTransport class * test class to ensure the class has send() method - * */ class ExtendTransport { @@ -217,7 +213,7 @@ class CakeEmailTest extends CakeTestCase { $this->assertSame($this->CakeEmail, $result); $this->setExpectedException('SocketException'); - $result = $this->CakeEmail->from(array('cake@cakephp.org' => 'CakePHP', 'fail@cakephp.org' => 'From can only be one address')); + $this->CakeEmail->from(array('cake@cakephp.org' => 'CakePHP', 'fail@cakephp.org' => 'From can only be one address')); } /** @@ -866,7 +862,7 @@ class CakeEmailTest extends CakeTestCase { $this->setExpectedException('SocketException'); $this->CakeEmail->transport('Invalid'); - $result = $this->CakeEmail->transportClass(); + $this->CakeEmail->transportClass(); } /** @@ -955,7 +951,7 @@ class CakeEmailTest extends CakeTestCase { $this->assertEquals($expected, $this->CakeEmail->transportClass()->config()); $this->CakeEmail->config(array('log' => true)); - $result = $this->CakeEmail->transportClass()->config(); + $this->CakeEmail->transportClass()->config(); $expected += array('log' => true); $this->assertEquals($expected, $this->CakeEmail->transportClass()->config()); @@ -2028,7 +2024,7 @@ class CakeEmailTest extends CakeTestCase { $this->assertEquals('html', $result); $this->setExpectedException('SocketException'); - $result = $this->CakeEmail->emailFormat('invalid'); + $this->CakeEmail->emailFormat('invalid'); } /** @@ -2288,10 +2284,10 @@ class CakeEmailTest extends CakeTestCase { protected function _getEmailByOldStyleCharset($charset, $headerCharset) { $email = new CakeEmail(array('transport' => 'Debug')); - if (! empty($charset)) { + if (!empty($charset)) { $email->charset = $charset; } - if (! empty($headerCharset)) { + if (!empty($headerCharset)) { $email->headerCharset = $headerCharset; } @@ -2312,10 +2308,10 @@ class CakeEmailTest extends CakeTestCase { protected function _getEmailByNewStyleCharset($charset, $headerCharset) { $email = new CakeEmail(array('transport' => 'Debug')); - if (! empty($charset)) { + if (!empty($charset)) { $email->charset($charset); } - if (! empty($headerCharset)) { + if (!empty($headerCharset)) { $email->headerCharset($headerCharset); } @@ -2385,7 +2381,6 @@ class CakeEmailTest extends CakeTestCase { style="font-weight: bold">The tag is across multiple lines HTML; - $length = strlen($str); $message = $str . str_repeat('x', CakeEmail::LINE_LENGTH_MUST + 1); $this->CakeEmail->reset(); diff --git a/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php b/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php index ca5653b49..9c6061c36 100644 --- a/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php @@ -22,7 +22,6 @@ App::uses('DebugTransport', 'Network/Email'); /** * Test case - * */ class DebugTransportTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php index bccc95439..dde5eaa90 100644 --- a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php @@ -22,7 +22,6 @@ App::uses('MailTransport', 'Network/Email'); /** * Test case - * */ class MailTransportTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php index 7c4076439..478de6b98 100644 --- a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php @@ -22,14 +22,13 @@ App::uses('SmtpTransport', 'Network/Email'); /** * Help to test SmtpTransport - * */ class SmtpTestTransport extends SmtpTransport { /** * Helper to change the socket * - * @param object $socket + * @param CakeSocket $socket A socket. * @return void */ public function setSocket(CakeSocket $socket) { @@ -39,7 +38,7 @@ class SmtpTestTransport extends SmtpTransport { /** * Helper to change the CakeEmail * - * @param object $cakeEmail + * @param object $cakeEmail An email object. * @return void */ public function setCakeEmail($cakeEmail) { @@ -57,8 +56,8 @@ class SmtpTestTransport extends SmtpTransport { /** * Magic function to call protected methods * - * @param string $method - * @param string $args + * @param string $method The method to call. + * @param string $args The arguments. * @return mixed */ public function __call($method, $args) { @@ -70,7 +69,6 @@ class SmtpTestTransport extends SmtpTransport { /** * Test case - * */ class SmtpTransportTest extends CakeTestCase { diff --git a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php index 6ff788348..318e43401 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php @@ -29,8 +29,8 @@ class TestAuthentication { /** * authentication method * - * @param HttpSocket $http - * @param array $authInfo + * @param HttpSocket $http A HTTP socket. + * @param array &$authInfo Some auth info. * @return void */ public static function authentication(HttpSocket $http, &$authInfo) { @@ -40,8 +40,8 @@ class TestAuthentication { /** * proxyAuthentication method * - * @param HttpSocket $http - * @param array $proxyInfo + * @param HttpSocket $http A HTTP socket. + * @param array &$proxyInfo Some proxy info. * @return void */ public static function proxyAuthentication(HttpSocket $http, &$proxyInfo) { @@ -52,7 +52,6 @@ class TestAuthentication { /** * CustomResponse - * */ class CustomResponse { @@ -66,6 +65,7 @@ class CustomResponse { /** * Constructor * + * @param string $message A message. */ public function __construct($message) { $this->first10 = substr($message, 0, 10); @@ -75,7 +75,6 @@ class CustomResponse { /** * TestHttpSocket - * */ class TestHttpSocket extends HttpSocket { @@ -135,7 +134,6 @@ class TestHttpSocket extends HttpSocket { * Convenience method for testing protected method * * @param array $request Needs to contain a 'uri' key. Should also contain a 'method' key, otherwise defaults to GET. - * @param string $versionToken The version token to use, defaults to HTTP/1.1 * @return string Request line */ public function buildRequestLine($request = array()) { @@ -583,7 +581,7 @@ class HttpSocketTest extends CakeTestCase { $this->Socket->reset(); $request = array('method' => 'POST', 'uri' => 'http://www.cakephp.org/posts/add', 'body' => array('name' => 'HttpSocket-is-released', 'date' => 'today')); - $response = $this->Socket->request($request); + $this->Socket->request($request); $this->assertEquals("name=HttpSocket-is-released&date=today", $this->Socket->request['body']); } diff --git a/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php b/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php index e9e5b5ddd..c67cba384 100644 --- a/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php @@ -258,7 +258,6 @@ class AssetDispatcherTest extends CakeTestCase { $file = file_get_contents($path); $this->assertEquals($file, $result); - $expected = filesize($path); $headers = $response->header(); $this->assertFalse($headers['Content-Length']); } diff --git a/lib/Cake/Test/Case/Routing/Route/RedirectRouteTest.php b/lib/Cake/Test/Case/Routing/Route/RedirectRouteTest.php index fe3b41ab8..4eb654047 100644 --- a/lib/Cake/Test/Case/Routing/Route/RedirectRouteTest.php +++ b/lib/Cake/Test/Case/Routing/Route/RedirectRouteTest.php @@ -47,14 +47,14 @@ class RedirectRouteTest extends CakeTestCase { $route = new RedirectRoute('/home', array('controller' => 'posts')); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/home'); + $route->parse('/home'); $header = $route->response->header(); $this->assertEquals(Router::url('/posts', true), $header['Location']); $route = new RedirectRoute('/home', array('controller' => 'posts', 'action' => 'index')); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/home'); + $route->parse('/home'); $header = $route->response->header(); $this->assertEquals(Router::url('/posts', true), $header['Location']); $this->assertEquals(301, $route->response->statusCode()); @@ -62,14 +62,14 @@ class RedirectRouteTest extends CakeTestCase { $route = new RedirectRoute('/google', 'http://google.com'); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/google'); + $route->parse('/google'); $header = $route->response->header(); $this->assertEquals('http://google.com', $header['Location']); $route = new RedirectRoute('/posts/*', array('controller' => 'posts', 'action' => 'view'), array('status' => 302)); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/posts/2'); + $route->parse('/posts/2'); $header = $route->response->header(); $this->assertEquals(Router::url('/posts/view', true), $header['Location']); $this->assertEquals(302, $route->response->statusCode()); @@ -77,35 +77,35 @@ class RedirectRouteTest extends CakeTestCase { $route = new RedirectRoute('/posts/*', array('controller' => 'posts', 'action' => 'view'), array('persist' => true)); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/posts/2'); + $route->parse('/posts/2'); $header = $route->response->header(); $this->assertEquals(Router::url('/posts/view/2', true), $header['Location']); $route = new RedirectRoute('/posts/*', '/test', array('persist' => true)); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/posts/2'); + $route->parse('/posts/2'); $header = $route->response->header(); $this->assertEquals(Router::url('/test', true), $header['Location']); $route = new RedirectRoute('/my_controllers/:action/*', array('controller' => 'tags', 'action' => 'add'), array('persist' => true)); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/my_controllers/do_something/passme/named:param'); + $route->parse('/my_controllers/do_something/passme/named:param'); $header = $route->response->header(); $this->assertEquals(Router::url('/tags/add/passme/named:param', true), $header['Location']); $route = new RedirectRoute('/my_controllers/:action/*', array('controller' => 'tags', 'action' => 'add')); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/my_controllers/do_something/passme/named:param'); + $route->parse('/my_controllers/do_something/passme/named:param'); $header = $route->response->header(); $this->assertEquals(Router::url('/tags/add', true), $header['Location']); $route = new RedirectRoute('/:lang/my_controllers', array('controller' => 'tags', 'action' => 'add'), array('lang' => '(nl|en)', 'persist' => array('lang'))); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/nl/my_controllers/'); + $route->parse('/nl/my_controllers/'); $header = $route->response->header(); $this->assertEquals(Router::url('/tags/add/lang:nl', true), $header['Location']); @@ -114,7 +114,7 @@ class RedirectRouteTest extends CakeTestCase { $route = new RedirectRoute('/:lang/my_controllers', array('controller' => 'tags', 'action' => 'add'), array('lang' => '(nl|en)', 'persist' => array('lang'))); $route->stop = false; $route->response = $this->getMock('CakeResponse', array('_sendHeader')); - $result = $route->parse('/nl/my_controllers/'); + $route->parse('/nl/my_controllers/'); $header = $route->response->header(); $this->assertEquals(Router::url('/nl/preferred_controllers', true), $header['Location']); } diff --git a/lib/Cake/Test/Case/Routing/RouterTest.php b/lib/Cake/Test/Case/Routing/RouterTest.php index 0a78cdedc..20d493bfe 100644 --- a/lib/Cake/Test/Case/Routing/RouterTest.php +++ b/lib/Cake/Test/Case/Routing/RouterTest.php @@ -201,7 +201,7 @@ class RouterTest extends CakeTestCase { )); CakePlugin::load('TestPlugin'); App::uses('TestRoute', 'TestPlugin.Routing/Route'); - $resources = Router::mapResources('Posts', array( + Router::mapResources('Posts', array( 'connectOptions' => array( 'routeClass' => 'TestPlugin.TestRoute', 'foo' => '^(bar)$', @@ -238,7 +238,7 @@ class RouterTest extends CakeTestCase { $this->assertEquals($expected, $result); $this->assertEquals(array('test_plugin'), $resources); - $resources = Router::mapResources('Posts', array('prefix' => 'api')); + Router::mapResources('Posts', array('prefix' => 'api')); $_SERVER['REQUEST_METHOD'] = 'GET'; $result = Router::parse('/api/posts'); @@ -1579,7 +1579,7 @@ class RouterTest extends CakeTestCase { $request->base = '/'; Router::setRequestInfo($request); - $result = Router::parse('/admin/controller/index/type:whatever'); + Router::parse('/admin/controller/index/type:whatever'); $result = Router::url(array('type' => 'new')); $expected = "/admin/controller/index/type:new"; $this->assertEquals($expected, $result); diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php index d5cee102e..da97150c3 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php @@ -327,7 +327,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextStartsWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; $this->assertStringStartsWith("some\nstring", $stringDirty); $this->assertStringStartsNotWith("some\r\nstring\r\nwith", $stringDirty); @@ -344,8 +343,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextStartsNotWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertTextStartsNotWith("some\nstring\nwithout", $stringDirty); } @@ -356,8 +353,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextEndsWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertTextEndsWith("string\nwith\r\ndifferent\rline endings!", $stringDirty); $this->assertTextEndsWith("string\r\nwith\ndifferent\nline endings!", $stringDirty); } @@ -369,8 +364,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextEndsNotWith() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertStringEndsNotWith("different\nline endings", $stringDirty); $this->assertTextEndsNotWith("different\rline endings", $stringDirty); } @@ -382,11 +375,8 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextContains() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertContains("different", $stringDirty); $this->assertNotContains("different\rline", $stringDirty); - $this->assertTextContains("different\rline", $stringDirty); } @@ -397,8 +387,6 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextNotContains() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $stringClean = "some\nstring\nwith\ndifferent\nline endings!"; - $this->assertTextNotContains("different\rlines", $stringDirty); } @@ -460,7 +448,7 @@ class CakeTestCaseTest extends CakeTestCase { ), App::RESET); CakePlugin::load('TestPlugin'); $this->getMockForModel('TestPlugin.TestPluginAppModel'); - $TestPluginComment = $this->getMockForModel('TestPlugin.TestPluginComment'); + $this->getMockForModel('TestPlugin.TestPluginComment'); $result = ClassRegistry::init('TestPlugin.TestPluginComment'); $this->assertInstanceOf('TestPluginComment', $result); diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php index 1a04dae0f..b50e21926 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php @@ -534,7 +534,7 @@ class CakeTestFixtureTest extends CakeTestCase { */ public function testInsertInvalid() { $Fixture = new InvalidTestFixture(); - $return = $Fixture->insert($this->criticDb); + $Fixture->insert($this->criticDb); } /** diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index bade7e034..efd8878d8 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -276,7 +276,7 @@ class ControllerTestCaseTest extends CakeTestCase { * @return void */ public function testTestAction() { - $Controller = $this->Case->generate('TestsApps'); + $this->Case->generate('TestsApps'); $this->Case->testAction('/tests_apps/index'); $this->assertInternalType('array', $this->Case->controller->viewVars); @@ -306,7 +306,7 @@ class ControllerTestCaseTest extends CakeTestCase { * @return void */ public function testTestActionArrayUrls() { - $Controller = $this->Case->generate('TestsApps'); + $this->Case->generate('TestsApps'); $this->Case->testAction(array('controller' => 'tests_apps', 'action' => 'index')); $this->assertInternalType('array', $this->Case->controller->viewVars); } @@ -452,7 +452,7 @@ class ControllerTestCaseTest extends CakeTestCase { public function testTestActionGetData() { $this->Case->autoMock = true; - $result = $this->Case->testAction('/tests_apps_posts/url_var', array( + $this->Case->testAction('/tests_apps_posts/url_var', array( 'method' => 'get', 'data' => array( 'some' => 'var', @@ -474,7 +474,7 @@ class ControllerTestCaseTest extends CakeTestCase { )); $this->assertEquals(array('gogo', 'val2'), $result['params']['pass']); - $result = $this->Case->testAction('/tests_apps_posts/url_var', array( + $this->Case->testAction('/tests_apps_posts/url_var', array( 'return' => 'vars', 'method' => 'get', 'data' => array( diff --git a/lib/Cake/Test/Case/Utility/FolderTest.php b/lib/Cake/Test/Case/Utility/FolderTest.php index 67ab0cce9..552922818 100644 --- a/lib/Cake/Test/Case/Utility/FolderTest.php +++ b/lib/Cake/Test/Case/Utility/FolderTest.php @@ -1026,7 +1026,7 @@ class FolderTest extends CakeTestCase { extract($this->_setupFilesystem()); $Folder = new Folder($folderOne); - $result = $Folder->copy(array('to' => $folderThree, 'scheme' => Folder::OVERWRITE)); + $Folder->copy(array('to' => $folderThree, 'scheme' => Folder::OVERWRITE)); $this->assertTrue(file_exists($folderThree . DS . 'file1.php')); $this->assertTrue(file_exists($folderThree . DS . 'folderA' . DS . 'fileA.php')); diff --git a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php index 4d768d0d8..7d2eade79 100644 --- a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php +++ b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php @@ -27,8 +27,8 @@ class GenericObject { /** * Constructor * - * @param GenericObjectCollection $collection - * @param array $settings + * @param GenericObjectCollection $collection A collection. + * @param array $settings Settings. */ public function __construct(GenericObjectCollection $collection, $settings = array()) { $this->_Collection = $collection; diff --git a/lib/Cake/Test/Case/Utility/SanitizeTest.php b/lib/Cake/Test/Case/Utility/SanitizeTest.php index 524e8ab49..b6112c124 100644 --- a/lib/Cake/Test/Case/Utility/SanitizeTest.php +++ b/lib/Cake/Test/Case/Utility/SanitizeTest.php @@ -154,7 +154,7 @@ class SanitizeTest extends CakeTestCase { $string = ''; $expected = ''; $result = Sanitize::clean($string, array('connection' => 'test')); - $this->assertEquals($expected, $string); + $this->assertEquals($expected, $result); $data = array( 'Grant' => array( diff --git a/lib/Cake/Test/Case/Utility/SecurityTest.php b/lib/Cake/Test/Case/Utility/SecurityTest.php index bc81aecfe..90ea96c86 100644 --- a/lib/Cake/Test/Case/Utility/SecurityTest.php +++ b/lib/Cake/Test/Case/Utility/SecurityTest.php @@ -324,7 +324,7 @@ class SecurityTest extends CakeTestCase { public function testDecryptKeyFailure() { $txt = 'The quick brown fox'; $key = 'This key is longer than 32 bytes long.'; - $result = Security::encrypt($txt, $key); + Security::encrypt($txt, $key); $key = 'Not the same key. This one will fail'; $this->assertFalse(Security::decrypt($txt, $key), 'Modified key will fail.'); diff --git a/lib/Cake/Test/Case/Utility/SetTest.php b/lib/Cake/Test/Case/Utility/SetTest.php index f55afd106..6097191db 100644 --- a/lib/Cake/Test/Case/Utility/SetTest.php +++ b/lib/Cake/Test/Case/Utility/SetTest.php @@ -2763,7 +2763,6 @@ class SetTest extends CakeTestCase { /** * testSetApply method * @return void - * */ public function testApply() { $data = array( diff --git a/lib/Cake/Test/Case/Utility/ValidationTest.php b/lib/Cake/Test/Case/Utility/ValidationTest.php index f501e4f6b..7c5dca576 100644 --- a/lib/Cake/Test/Case/Utility/ValidationTest.php +++ b/lib/Cake/Test/Case/Utility/ValidationTest.php @@ -28,7 +28,7 @@ class CustomValidator { /** * Makes sure that a given $email address is valid and unique * - * @param string $email + * @param string $check Email to check. * @return bool */ public static function customValidate($check) { diff --git a/lib/Cake/Test/Case/Utility/XmlTest.php b/lib/Cake/Test/Case/Utility/XmlTest.php index 614a22a05..5cb62d0f8 100644 --- a/lib/Cake/Test/Case/Utility/XmlTest.php +++ b/lib/Cake/Test/Case/Utility/XmlTest.php @@ -175,7 +175,7 @@ class XmlTest extends CakeTestCase { */ public function testBuildFromFileWhenDisabled() { $xml = CAKE . 'Test' . DS . 'Fixture' . DS . 'sample.xml'; - $obj = Xml::build($xml, array('readFile' => false)); + Xml::build($xml, array('readFile' => false)); } /** @@ -186,7 +186,7 @@ class XmlTest extends CakeTestCase { */ public function testBuildFromUrlWhenDisabled() { $xml = 'http://www.google.com'; - $obj = Xml::build($xml, array('readFile' => false)); + Xml::build($xml, array('readFile' => false)); } /** @@ -222,7 +222,7 @@ class XmlTest extends CakeTestCase { */ public function testBuildInvalidDataSimpleXml() { $input = ' 'simplexml')); + Xml::build($input, array('return' => 'simplexml')); } /** diff --git a/lib/Cake/Test/bake_compare/Controller/Scaffold.ctp b/lib/Cake/Test/bake_compare/Controller/Scaffold.ctp index 325fdb991..757e0eabd 100644 --- a/lib/Cake/Test/bake_compare/Controller/Scaffold.ctp +++ b/lib/Cake/Test/bake_compare/Controller/Scaffold.ctp @@ -2,7 +2,6 @@ App::uses('AppController', 'Controller'); /** * Articles Controller - * */ class ArticlesController extends AppController { diff --git a/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php b/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php index e7b5f9f30..2ba874dba 100644 --- a/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php +++ b/lib/Cake/Test/test_app/Model/Datasource/Session/TestAppLibSession.php @@ -1,7 +1,6 @@ 0): echo $this->element('exception_stack_trace'); endif; -?> diff --git a/lib/Cake/Test/test_app/View/Elements/html_call.ctp b/lib/Cake/Test/test_app/View/Elements/html_call.ctp index 8c2c08978..fb5122dd2 100644 --- a/lib/Cake/Test/test_app/View/Elements/html_call.ctp +++ b/lib/Cake/Test/test_app/View/Elements/html_call.ctp @@ -1,3 +1,2 @@ Html->link('Test', 'http://example.com'); -?> \ No newline at end of file +echo $this->Html->link('Test', 'http://example.com'); \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Emails/html/default.ctp b/lib/Cake/Test/test_app/View/Emails/html/default.ctp index 5d6eabd09..538e907f5 100644 --- a/lib/Cake/Test/test_app/View/Emails/html/default.ctp +++ b/lib/Cake/Test/test_app/View/Emails/html/default.ctp @@ -3,5 +3,4 @@ $content = explode("\n", $content); foreach ($content as $line): echo '

' . $line . '

'; -endforeach; -?> \ No newline at end of file +endforeach; \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Layouts/ajax2.ctp b/lib/Cake/Test/test_app/View/Layouts/ajax2.ctp index 433315990..25c20f425 100644 --- a/lib/Cake/Test/test_app/View/Layouts/ajax2.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/ajax2.ctp @@ -1,2 +1,3 @@ Ajax! -fetch('content'); ?> \ No newline at end of file +fetch('content'); \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Layouts/rss/default.ctp b/lib/Cake/Test/test_app/View/Layouts/rss/default.ctp index df2f0ab19..f0af9c0d8 100644 --- a/lib/Cake/Test/test_app/View/Layouts/rss/default.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/rss/default.ctp @@ -12,6 +12,4 @@ echo $this->Rss->document( $this->Rss->channel( array(), $channel, $this->fetch('content') ) -); - -?> \ No newline at end of file +); \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Posts/helper_overwrite.ctp b/lib/Cake/Test/test_app/View/Posts/helper_overwrite.ctp index 100c5f51b..610d33ad9 100644 --- a/lib/Cake/Test/test_app/View/Posts/helper_overwrite.ctp +++ b/lib/Cake/Test/test_app/View/Posts/helper_overwrite.ctp @@ -1,4 +1,3 @@ Html->link('Test link', '#'); -?> \ No newline at end of file +echo $this->Html->link('Test link', '#'); \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Posts/parent_view.ctp b/lib/Cake/Test/test_app/View/Posts/parent_view.ctp index e338b784f..ee4689544 100644 --- a/lib/Cake/Test/test_app/View/Posts/parent_view.ctp +++ b/lib/Cake/Test/test_app/View/Posts/parent_view.ctp @@ -1,2 +1,2 @@ Parent View. -fetch('content') ?> +fetch('content'); ?> diff --git a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp index c0b2ac283..19a88e339 100644 --- a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp +++ b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp @@ -47,7 +47,7 @@ Html->image('test.jpg') ?> \ No newline at end of file +Html->image('test.jpg'); ?> \ No newline at end of file diff --git a/lib/Cake/Test/test_app/View/Themed/TestTheme/Layouts/default.ctp b/lib/Cake/Test/test_app/View/Themed/TestTheme/Layouts/default.ctp index 9f2aa062d..d4e3dd586 100644 --- a/lib/Cake/Test/test_app/View/Themed/TestTheme/Layouts/default.ctp +++ b/lib/Cake/Test/test_app/View/Themed/TestTheme/Layouts/default.ctp @@ -1,2 +1,2 @@ default test_theme layout -fetch('content') ?> +fetch('content'); ?> diff --git a/lib/Cake/TestSuite/CakeTestCase.php b/lib/Cake/TestSuite/CakeTestCase.php index bcecc45a3..c375717fe 100644 --- a/lib/Cake/TestSuite/CakeTestCase.php +++ b/lib/Cake/TestSuite/CakeTestCase.php @@ -643,9 +643,9 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase { /** * Compatibility wrapper function for setExpectedException * - * @param mixed $expected the name of the Exception + * @param mixed $name The name of the expected Exception. * @param string $message the text to display if the assertion is not correct - * @deprecated 3.0.0 This is a compatiblity wrapper for 1.x. It will be removed in 3.0 + * @deprecated 3.0.0 This is a compatibility wrapper for 1.x. It will be removed in 3.0. * @return void */ protected function expectException($name = 'Exception', $message = '') { diff --git a/lib/Cake/TestSuite/CakeTestLoader.php b/lib/Cake/TestSuite/CakeTestLoader.php index c1fa85f10..3fe681bde 100644 --- a/lib/Cake/TestSuite/CakeTestLoader.php +++ b/lib/Cake/TestSuite/CakeTestLoader.php @@ -42,9 +42,9 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader { /** * Convert path fragments used by CakePHP's test runner to absolute paths that can be fed to PHPUnit. * - * @param string $filePath The file path to load - * @param string $params Additional parameters - * @return void + * @param string $filePath The file path to load. + * @param string $params Additional parameters. + * @return string Converted path fragments. */ protected function _resolveTestFile($filePath, $params) { $basePath = $this->_basePath($params) . DS . $filePath; diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php index 17620ae08..03d78011a 100644 --- a/lib/Cake/TestSuite/ControllerTestCase.php +++ b/lib/Cake/TestSuite/ControllerTestCase.php @@ -258,7 +258,7 @@ abstract class ControllerTestCase extends CakeTestCase { $Dispatch->parseParams(new CakeEvent('ControllerTestCase', $Dispatch, array('request' => $request))); if (!isset($request->params['controller']) && Router::currentRoute()) { $this->headers = Router::currentRoute()->response->header(); - return; + return null; } if ($this->_dirtyController) { $this->controller = null; diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php index 3e68005f3..d877d556f 100644 --- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php @@ -58,7 +58,7 @@ class CakeHtmlReporter extends CakeBaseReporter { */ public function paintDocumentStart() { ob_start(); - $baseDir = $this->params['baseDir']; + $this->params['baseDir']; include CAKE . 'TestSuite' . DS . 'templates' . DS . 'header.php'; } @@ -69,7 +69,7 @@ class CakeHtmlReporter extends CakeBaseReporter { * @return void */ public function paintTestMenu() { - $cases = $this->baseUrl() . '?show=cases'; + $this->baseUrl() . '?show=cases'; $plugins = App::objects('plugin', null, false); sort($plugins); include CAKE . 'TestSuite' . DS . 'templates' . DS . 'menu.php'; diff --git a/lib/Cake/TestSuite/templates/header.php b/lib/Cake/TestSuite/templates/header.php index 616bc179f..60afa7559 100644 --- a/lib/Cake/TestSuite/templates/header.php +++ b/lib/Cake/TestSuite/templates/header.php @@ -106,7 +106,7 @@ div.code-coverage-results span.line-num strong { color:#666; } div.code-coverage-results div.start { border:1px solid #aaa; - border-width:1px 1px 0px 1px; + border-width:1px 1px 0 1px; margin-top:30px; padding-top:5px; } diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index b6fccf2aa..ec29a4d6e 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -91,7 +91,6 @@ class Debugger { /** * Constructor. - * */ public function __construct() { $docRef = ini_get('docref_root'); @@ -200,7 +199,7 @@ class Debugger { * @param string $file File on which error occurred * @param int $line Line that triggered the error * @param array $context Context - * @return bool true if error was handled + * @return bool|null True if error was handled, otherwise null. * @deprecated 3.0.0 Will be removed in 3.0. This function is superseded by Debugger::outputError(). */ public static function showError($code, $description, $file = null, $line = null, $context = null) { @@ -217,7 +216,7 @@ class Debugger { if (!in_array($info, $self->errors)) { $self->errors[] = $info; } else { - return; + return null; } switch ($code) { @@ -247,7 +246,7 @@ class Debugger { $level = LOG_NOTICE; break; default: - return; + return null; } $data = compact( diff --git a/lib/Cake/Utility/Hash.php b/lib/Cake/Utility/Hash.php index 8ef89c677..2c9dd5f0b 100644 --- a/lib/Cake/Utility/Hash.php +++ b/lib/Cake/Utility/Hash.php @@ -465,7 +465,7 @@ class Hash { $count = count($paths); if (!$count) { - return; + return null; } for ($i = 0; $i < $count; $i++) { diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php index d52c8d7ad..10750c1c6 100644 --- a/lib/Cake/Utility/Set.php +++ b/lib/Cake/Utility/Set.php @@ -228,7 +228,7 @@ class Set { * @param array $data Source array from which to extract the data * @param string $format Format string into which values will be inserted, see sprintf() * @param array $keys An array containing one or more Set::extract()-style key paths - * @return array An array of strings extracted from $keys and formatted with $format + * @return array|null An array of strings extracted from $keys and formatted with $format, otherwise null. * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::format */ public static function format($data, $format, $keys) { @@ -236,7 +236,7 @@ class Set { $count = count($keys); if (!$count) { - return; + return null; } for ($i = 0; $i < $count; $i++) { diff --git a/lib/Cake/View/Errors/fatal_error.ctp b/lib/Cake/View/Errors/fatal_error.ctp index 0871555b8..8749a8f5a 100644 --- a/lib/Cake/View/Errors/fatal_error.ctp +++ b/lib/Cake/View/Errors/fatal_error.ctp @@ -36,4 +36,4 @@ if (extension_loaded('xdebug')) { xdebug_print_function_stack(); } -?> +?> \ No newline at end of file diff --git a/lib/Cake/View/Errors/missing_action.ctp b/lib/Cake/View/Errors/missing_action.ctp index 5876e9304..edc831124 100644 --- a/lib/Cake/View/Errors/missing_action.ctp +++ b/lib/Cake/View/Errors/missing_action.ctp @@ -38,4 +38,6 @@ class extends AppController { :

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> \ No newline at end of file diff --git a/lib/Cake/View/Errors/missing_behavior.ctp b/lib/Cake/View/Errors/missing_behavior.ctp index e8024ebf3..e018ae73b 100644 --- a/lib/Cake/View/Errors/missing_behavior.ctp +++ b/lib/Cake/View/Errors/missing_behavior.ctp @@ -36,4 +36,6 @@ class extends ModelBehavior {

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> \ No newline at end of file diff --git a/lib/Cake/View/Errors/missing_component.ctp b/lib/Cake/View/Errors/missing_component.ctp index ab5d77cf9..3ecc31554 100644 --- a/lib/Cake/View/Errors/missing_component.ctp +++ b/lib/Cake/View/Errors/missing_component.ctp @@ -36,4 +36,6 @@ class extends Component {

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/missing_controller.ctp b/lib/Cake/View/Errors/missing_controller.ctp index 7f31ff8f4..8bfc90b7e 100644 --- a/lib/Cake/View/Errors/missing_controller.ctp +++ b/lib/Cake/View/Errors/missing_controller.ctp @@ -36,4 +36,6 @@ class AppController {

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/missing_database.ctp b/lib/Cake/View/Errors/missing_database.ctp index 0432b7424..adca10936 100644 --- a/lib/Cake/View/Errors/missing_database.ctp +++ b/lib/Cake/View/Errors/missing_database.ctp @@ -28,4 +28,6 @@

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/missing_datasource.ctp b/lib/Cake/View/Errors/missing_datasource.ctp index 9a16d508c..e8558e57c 100644 --- a/lib/Cake/View/Errors/missing_datasource.ctp +++ b/lib/Cake/View/Errors/missing_datasource.ctp @@ -20,7 +20,7 @@ $pluginDot = empty($plugin) ? null : $plugin . '.';

: ' . h($pluginDot . $class) . ''); ?> - +

@@ -29,4 +29,6 @@ $pluginDot = empty($plugin) ? null : $plugin . '.';

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/missing_datasource_config.ctp b/lib/Cake/View/Errors/missing_datasource_config.ctp index 0fe5929a6..115bdc7ba 100644 --- a/lib/Cake/View/Errors/missing_datasource_config.ctp +++ b/lib/Cake/View/Errors/missing_datasource_config.ctp @@ -24,4 +24,6 @@

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/missing_helper.ctp b/lib/Cake/View/Errors/missing_helper.ctp index 93fa54ed2..6e2dc0d67 100644 --- a/lib/Cake/View/Errors/missing_helper.ctp +++ b/lib/Cake/View/Errors/missing_helper.ctp @@ -36,4 +36,6 @@ class extends AppHelper {

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/missing_layout.ctp b/lib/Cake/View/Errors/missing_layout.ctp index b8c5d81cf..cf1b53e10 100644 --- a/lib/Cake/View/Errors/missing_layout.ctp +++ b/lib/Cake/View/Errors/missing_layout.ctp @@ -41,4 +41,6 @@

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/missing_plugin.ctp b/lib/Cake/View/Errors/missing_plugin.ctp index 0d5592e71..3e7b4d1c3 100644 --- a/lib/Cake/View/Errors/missing_plugin.ctp +++ b/lib/Cake/View/Errors/missing_plugin.ctp @@ -40,4 +40,6 @@ CakePlugin::loadAll();

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/missing_table.ctp b/lib/Cake/View/Errors/missing_table.ctp index 7c308a864..5fcf2ac32 100644 --- a/lib/Cake/View/Errors/missing_table.ctp +++ b/lib/Cake/View/Errors/missing_table.ctp @@ -17,11 +17,13 @@

: - ' . h($table) . '', '' . h($class) . '', '' . h($ds) . ''); ?> + ' . h($table) . '', '' . h($class) . '', '' . h($ds) . ''); ?>

:

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/missing_view.ctp b/lib/Cake/View/Errors/missing_view.ctp index b2579d578..208afffe7 100644 --- a/lib/Cake/View/Errors/missing_view.ctp +++ b/lib/Cake/View/Errors/missing_view.ctp @@ -41,4 +41,6 @@

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/pdo_error.ctp b/lib/Cake/View/Errors/pdo_error.ctp index b9c7a0ca3..2f8d4aa2b 100644 --- a/lib/Cake/View/Errors/pdo_error.ctp +++ b/lib/Cake/View/Errors/pdo_error.ctp @@ -33,4 +33,6 @@ :

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/private_action.ctp b/lib/Cake/View/Errors/private_action.ctp index 11a18a3b8..0fd185855 100644 --- a/lib/Cake/View/Errors/private_action.ctp +++ b/lib/Cake/View/Errors/private_action.ctp @@ -24,4 +24,6 @@

-element('exception_stack_trace'); ?> +element('exception_stack_trace'); +?> diff --git a/lib/Cake/View/Errors/scaffold_error.ctp b/lib/Cake/View/Errors/scaffold_error.ctp index ce1eea8e6..9cfe10490 100644 --- a/lib/Cake/View/Errors/scaffold_error.ctp +++ b/lib/Cake/View/Errors/scaffold_error.ctp @@ -33,6 +33,6 @@ function _scaffoldError() {
element('exception_stack_trace'); + echo $this->element('exception_stack_trace'); } -?> +?> \ No newline at end of file diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php index a6c7f47e3..ed5560a52 100644 --- a/lib/Cake/View/Helper/CacheHelper.php +++ b/lib/Cake/View/Helper/CacheHelper.php @@ -271,8 +271,8 @@ class CacheHelper extends AppHelper { * * @param string $content view content to write to a cache file. * @param string $timestamp Duration to set for cache file. - * @param bool $useCallbacks Whether to include statements in cached file which - * run callbacks. + * @param bool|null $useCallbacks Whether to include statements in cached file which + * run callbacks, otherwise null. * @return bool success of caching view. */ protected function _writeFile($content, $timestamp, $useCallbacks = false) { @@ -294,7 +294,7 @@ class CacheHelper extends AppHelper { $cache = strtolower(Inflector::slug($path)); if (empty($cache)) { - return; + return null; } $cache = $cache . '.php'; $file = '_getModel($model); if (!$object) { - return; + return null; } if ($key === 'key') { @@ -561,12 +561,12 @@ class FormHelper extends AppHelper { * generating the hash, else $this->fields is being used. * @param array $secureAttributes will be passed as html attributes into the hidden * input elements generated for the Security Component. - * @return string A hidden input field with a security hash + * @return string|null A hidden input field with a security hash, otherwise null. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::secure */ public function secure($fields = array(), $secureAttributes = array()) { if (!isset($this->request['_Token']) || empty($this->request['_Token'])) { - return; + return null; } $locked = array(); $unlockedFields = $this->_unlockedFields; diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php index a9c99e0cc..5098cec86 100644 --- a/lib/Cake/View/Helper/HtmlHelper.php +++ b/lib/Cake/View/Helper/HtmlHelper.php @@ -446,7 +446,7 @@ class HtmlHelper extends AppHelper { if (empty($options['block'])) { return $out . "\n"; } - return; + return ''; } if ($options['once'] && isset($this->_includedAssets[__METHOD__][$path])) { diff --git a/lib/Cake/View/Helper/SessionHelper.php b/lib/Cake/View/Helper/SessionHelper.php index e1fd1a201..1670c84e9 100644 --- a/lib/Cake/View/Helper/SessionHelper.php +++ b/lib/Cake/View/Helper/SessionHelper.php @@ -156,6 +156,7 @@ class SessionHelper extends AppHelper { } $tmpVars = $flash['params']; $tmpVars['message'] = $message; + $tmpVars['key'] = $key; $out = $this->_View->element($flash['element'], $tmpVars, $options); } } diff --git a/lib/Cake/View/Scaffolds/form.ctp b/lib/Cake/View/Scaffolds/form.ctp index 2f2face1d..0a6b5ddea 100644 --- a/lib/Cake/View/Scaffolds/form.ctp +++ b/lib/Cake/View/Scaffolds/form.ctp @@ -35,9 +35,9 @@
  • Html->link(__d('cake', 'List') . ' ' . $pluralHumanName, array('action' => 'index')); ?>
  • $_data) { - foreach ($_data as $_alias => $_details) { - if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { + foreach ($associations as $_type => $_data): + foreach ($_data as $_alias => $_details): + if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)): echo "\t\t
  • " . $this->Html->link( __d('cake', 'List %s', Inflector::humanize($_details['controller'])), array('plugin' => $_details['plugin'], 'controller' => $_details['controller'], 'action' => 'index') @@ -47,9 +47,9 @@ array('plugin' => $_details['plugin'], 'controller' => $_details['controller'], 'action' => 'add') ) . "
  • \n"; $done[] = $_details['controller']; - } - } - } + endif; + endforeach; + endforeach; ?> diff --git a/lib/Cake/View/Scaffolds/index.ctp b/lib/Cake/View/Scaffolds/index.ctp index dbae19167..e0219f4f0 100644 --- a/lib/Cake/View/Scaffolds/index.ctp +++ b/lib/Cake/View/Scaffolds/index.ctp @@ -26,21 +26,21 @@ '; - foreach ($scaffoldFields as $_field) { + foreach ($scaffoldFields as $_field): $isKey = false; - if (!empty($associations['belongsTo'])) { - foreach ($associations['belongsTo'] as $_alias => $_details) { - if ($_field === $_details['foreignKey']) { + if (!empty($associations['belongsTo'])): + foreach ($associations['belongsTo'] as $_alias => $_details): + if ($_field === $_details['foreignKey']): $isKey = true; echo '' . $this->Html->link(${$singularVar}[$_alias][$_details['displayField']], array('controller' => $_details['controller'], 'action' => 'view', ${$singularVar}[$_alias][$_details['primaryKey']])) . ''; break; - } - } - } - if ($isKey !== true) { + endif; + endforeach; + endif; + if ($isKey !== true): echo '' . h(${$singularVar}[$modelClass][$_field]) . ''; - } - } + endif; + endforeach; echo ''; echo $this->Html->link(__d('cake', 'View'), array('action' => 'view', ${$singularVar}[$modelClass][$primaryKey])); @@ -67,7 +67,7 @@ endforeach; Paginator->prev('< ' . __d('cake', 'previous'), array(), null, array('class' => 'prev disabled')); echo $this->Paginator->numbers(array('separator' => '')); - echo $this->Paginator->next(__d('cake', 'next') .' >', array(), null, array('class' => 'next disabled')); + echo $this->Paginator->next(__d('cake', 'next') . ' >', array(), null, array('class' => 'next disabled')); ?> diff --git a/lib/Cake/View/Scaffolds/view.ctp b/lib/Cake/View/Scaffolds/view.ctp index 8ec83432f..64a3e31f1 100644 --- a/lib/Cake/View/Scaffolds/view.ctp +++ b/lib/Cake/View/Scaffolds/view.ctp @@ -95,10 +95,10 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?>
    " . Inflector::humanize($_field) . "\n"; echo "\t\t
    \n\t" . ${$singularVar}[$_alias][$_field] . "\n 
    \n"; - } + endforeach; ?>
    diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index e1014fad3..12434f7d2 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -464,7 +464,7 @@ class View extends Object { */ public function render($view = null, $layout = null) { if ($this->hasRendered) { - return; + return null; } if ($view !== false && $viewFileName = $this->_getViewFileName($view)) { diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index 51afffa18..e1edb6ea1 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -580,7 +580,7 @@ if (!function_exists('__')) { */ function __($singular, $args = null) { if (!$singular) { - return; + return null; } App::uses('I18n', 'I18n'); @@ -600,13 +600,13 @@ if (!function_exists('__n')) { * @param string $singular Singular text to translate * @param string $plural Plural text * @param int $count Count - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return mixed plural form of translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__n */ function __n($singular, $plural, $count, $args = null) { if (!$singular) { - return; + return null; } App::uses('I18n', 'I18n'); @@ -624,13 +624,13 @@ if (!function_exists('__d')) { * * @param string $domain Domain * @param string $msg String to translate - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__d */ function __d($domain, $msg, $args = null) { if (!$msg) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($msg, null, $domain); @@ -651,13 +651,13 @@ if (!function_exists('__dn')) { * @param string $singular Singular string to translate * @param string $plural Plural * @param int $count Count - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string plural form of translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__dn */ function __dn($domain, $singular, $plural, $count, $args = null) { if (!$singular) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($singular, $plural, $domain, I18n::LC_MESSAGES, $count); @@ -689,13 +689,13 @@ if (!function_exists('__dc')) { * @param string $domain Domain * @param string $msg Message to translate * @param int $category Category - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__dc */ function __dc($domain, $msg, $category, $args = null) { if (!$msg) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($msg, null, $domain, $category); @@ -731,13 +731,13 @@ if (!function_exists('__dcn')) { * @param string $plural Plural * @param int $count Count * @param int $category Category - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string plural form of translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__dcn */ function __dcn($domain, $singular, $plural, $count, $category, $args = null) { if (!$singular) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($singular, $plural, $domain, $category, $count); @@ -765,13 +765,13 @@ if (!function_exists('__c')) { * * @param string $msg String to translate * @param int $category Category - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__c */ function __c($msg, $category, $args = null) { if (!$msg) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($msg, null, null, $category); @@ -788,13 +788,13 @@ if (!function_exists('__x')) { * * @param string $context Context of the text * @param string $singular Text to translate - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return mixed translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__ */ function __x($context, $singular, $args = null) { if (!$singular) { - return; + return null; } App::uses('I18n', 'I18n'); @@ -815,13 +815,13 @@ if (!function_exists('__xn')) { * @param string $singular Singular text to translate * @param string $plural Plural text * @param int $count Count - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return mixed plural form of translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__n */ function __xn($context, $singular, $plural, $count, $args = null) { if (!$singular) { - return; + return null; } App::uses('I18n', 'I18n'); @@ -840,13 +840,13 @@ if (!function_exists('__dx')) { * @param string $domain Domain * @param string $context Context of the text * @param string $msg String to translate - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__d */ function __dx($domain, $context, $msg, $args = null) { if (!$msg) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($msg, null, $domain, null, null, null, $context); @@ -868,13 +868,13 @@ if (!function_exists('__dxn')) { * @param string $singular Singular string to translate * @param string $plural Plural * @param int $count Count - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string plural form of translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__dn */ function __dxn($domain, $context, $singular, $plural, $count, $args = null) { if (!$singular) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($singular, $plural, $domain, I18n::LC_MESSAGES, $count, null, $context); @@ -907,13 +907,13 @@ if (!function_exists('__dxc')) { * @param string $context Context of the text * @param string $msg Message to translate * @param int $category Category - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__dc */ function __dxc($domain, $context, $msg, $category, $args = null) { if (!$msg) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($msg, null, $domain, $category, null, null, $context); @@ -950,13 +950,13 @@ if (!function_exists('__dxcn')) { * @param string $plural Plural * @param int $count Count * @param int $category Category - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string plural form of translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__dcn */ function __dxcn($domain, $context, $singular, $plural, $count, $category, $args = null) { if (!$singular) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($singular, $plural, $domain, $category, $count, null, $context); @@ -985,13 +985,13 @@ if (!function_exists('__xc')) { * @param string $context Context of the text * @param string $msg String to translate * @param int $category Category - * @param mixed $args Array with arguments or multiple arguments in function + * @param mixed $args Array with arguments or multiple arguments in function, otherwise null. * @return string translated string * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__c */ function __xc($context, $msg, $category, $args = null) { if (!$msg) { - return; + return null; } App::uses('I18n', 'I18n'); $translated = I18n::translate($msg, null, null, $category, null, null, $context);