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("
' . $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 = <<' . $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() {