From 06fc8dbfc1c708109e8fabbee37ce46720476170 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 4 Jul 2013 22:05:00 -0400 Subject: [PATCH 01/13] Update version number to 2.3.7 --- lib/Cake/VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/VERSION.txt b/lib/Cake/VERSION.txt index 696d59d77..9c4a9f56d 100644 --- a/lib/Cake/VERSION.txt +++ b/lib/Cake/VERSION.txt @@ -17,4 +17,4 @@ // @license http://www.opensource.org/licenses/mit-license.php MIT License // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -2.3.6 +2.3.7 From c989624f8053f28d2ac37f5e84dc436965235177 Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 5 Jul 2013 14:15:18 +0200 Subject: [PATCH 02/13] whitespace coding standards --- .../Component/Auth/BlowfishAuthenticate.php | 6 +++--- lib/Cake/Core/Object.php | 2 +- lib/Cake/Model/Behavior/ContainableBehavior.php | 2 +- lib/Cake/Model/Behavior/TreeBehavior.php | 2 +- lib/Cake/Model/Datasource/Database/Postgres.php | 2 +- lib/Cake/Model/Datasource/Database/Sqlite.php | 2 +- lib/Cake/Model/Datasource/DboSource.php | 2 +- lib/Cake/TestSuite/CakeTestCase.php | 2 +- lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php | 3 ++- lib/Cake/Utility/CakeNumber.php | 2 +- lib/Cake/Utility/ClassRegistry.php | 6 +++--- lib/Cake/View/Helper.php | 2 +- lib/Cake/View/Helper/FormHelper.php | 8 ++++---- lib/Cake/View/Helper/NumberHelper.php | 2 +- lib/Cake/basics.php | 14 +++++++------- 15 files changed, 29 insertions(+), 28 deletions(-) diff --git a/lib/Cake/Controller/Component/Auth/BlowfishAuthenticate.php b/lib/Cake/Controller/Component/Auth/BlowfishAuthenticate.php index b18b008d4..a44b30aac 100644 --- a/lib/Cake/Controller/Component/Auth/BlowfishAuthenticate.php +++ b/lib/Cake/Controller/Component/Auth/BlowfishAuthenticate.php @@ -34,9 +34,9 @@ App::uses('FormAuthenticate', 'Controller/Component/Auth'); * For initial password hashing/creation see Security::hash(). Other than how the password is initially hashed, * BlowfishAuthenticate works exactly the same way as FormAuthenticate. * - * @package Cake.Controller.Component.Auth - * @since CakePHP(tm) v 2.3 - * @see AuthComponent::$authenticate + * @package Cake.Controller.Component.Auth + * @since CakePHP(tm) v 2.3 + * @see AuthComponent::$authenticate */ class BlowfishAuthenticate extends FormAuthenticate { diff --git a/lib/Cake/Core/Object.php b/lib/Cake/Core/Object.php index ed740659a..bfeaf59d6 100644 --- a/lib/Cake/Core/Object.php +++ b/lib/Cake/Core/Object.php @@ -112,7 +112,7 @@ class Object { * * @param string $method Name of the method to call * @param array $params Parameter list to use when calling $method - * @return mixed Returns the result of the method call + * @return mixed Returns the result of the method call */ public function dispatchMethod($method, $params = array()) { switch (count($params)) { diff --git a/lib/Cake/Model/Behavior/ContainableBehavior.php b/lib/Cake/Model/Behavior/ContainableBehavior.php index 18d430a63..6fb2121cd 100644 --- a/lib/Cake/Model/Behavior/ContainableBehavior.php +++ b/lib/Cake/Model/Behavior/ContainableBehavior.php @@ -88,7 +88,7 @@ class ContainableBehavior extends ModelBehavior { * ))); * }}} * - * @param Model $Model Model using the behavior + * @param Model $Model Model using the behavior * @param array $query Query parameters as set by cake * @return array */ diff --git a/lib/Cake/Model/Behavior/TreeBehavior.php b/lib/Cake/Model/Behavior/TreeBehavior.php index 1faeec819..bcb5e511b 100644 --- a/lib/Cake/Model/Behavior/TreeBehavior.php +++ b/lib/Cake/Model/Behavior/TreeBehavior.php @@ -105,7 +105,7 @@ class TreeBehavior extends ModelBehavior { /** * Runs before a find() operation * - * @param Model $Model Model using the behavior + * @param Model $Model Model using the behavior * @param array $query Query parameters as set by cake * @return array */ diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index 743feb35e..6a34064d3 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/lib/Cake/Model/Datasource/Database/Postgres.php @@ -328,7 +328,7 @@ class Postgres extends DboSource { * @param string|Model $table A string or model class representing the table to be truncated * @param boolean $reset true for resetting the sequence, false to leave it as is. * and if 1, sequences are not modified - * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. + * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. */ public function truncate($table, $reset = false) { $table = $this->fullTableName($table, false, false); diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index eabcb0876..613aeeefe 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/lib/Cake/Model/Datasource/Database/Sqlite.php @@ -227,7 +227,7 @@ class Sqlite extends DboSource { * primary key, where applicable. * * @param string|Model $table A string or model class representing the table to be truncated - * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. + * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. */ public function truncate($table) { $this->_execute('DELETE FROM sqlite_sequence where name=' . $this->startQuote . $this->fullTableName($table, false, false) . $this->endQuote); diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index db80a4fa4..abdad2437 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -2031,7 +2031,7 @@ class DboSource extends DataSource { * primary key, where applicable. * * @param Model|string $table A string or model class representing the table to be truncated - * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. + * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. */ public function truncate($table) { return $this->execute('TRUNCATE TABLE ' . $this->fullTableName($table)); diff --git a/lib/Cake/TestSuite/CakeTestCase.php b/lib/Cake/TestSuite/CakeTestCase.php index a7364e8fb..467b6ba10 100644 --- a/lib/Cake/TestSuite/CakeTestCase.php +++ b/lib/Cake/TestSuite/CakeTestCase.php @@ -73,7 +73,7 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase { * If no TestResult object is passed a new one will be created. * This method is run for each test method in this class * - * @param PHPUnit_Framework_TestResult $result + * @param PHPUnit_Framework_TestResult $result * @return PHPUnit_Framework_TestResult * @throws InvalidArgumentException */ diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php index 91677bac0..c226790b5 100644 --- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php @@ -372,7 +372,8 @@ class CakeHtmlReporter extends CakeBaseReporter { /** * A test suite started. * - * @param PHPUnit_Framework_TestSuite $suite + * @param PHPUnit_Framework_TestSuite $suite + * @return void */ public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { if (!$this->_headerSent) { diff --git a/lib/Cake/Utility/CakeNumber.php b/lib/Cake/Utility/CakeNumber.php index 2a71088f9..c3ceb4878 100644 --- a/lib/Cake/Utility/CakeNumber.php +++ b/lib/Cake/Utility/CakeNumber.php @@ -371,7 +371,7 @@ class CakeNumber { /** * Getter/setter for default currency * - * @param string $currency Default currency string used by currency() if $currency argument is not provided + * @param string $currency Default currency string used by currency() if $currency argument is not provided * @return string Currency */ public static function defaultCurrency($currency = null) { diff --git a/lib/Cake/Utility/ClassRegistry.php b/lib/Cake/Utility/ClassRegistry.php index 6e39fb794..1f0108940 100644 --- a/lib/Cake/Utility/ClassRegistry.php +++ b/lib/Cake/Utility/ClassRegistry.php @@ -203,8 +203,8 @@ class ClassRegistry { /** * Add $object to the registry, associating it with the name $key. * - * @param string $key Key for the object in registry - * @param object $object Object to store + * @param string $key Key for the object in registry + * @param object $object Object to store * @return boolean True if the object was written, false if $key already exists */ public static function addObject($key, $object) { @@ -220,7 +220,7 @@ class ClassRegistry { /** * Remove object which corresponds to given key. * - * @param string $key Key of object to remove from registry + * @param string $key Key of object to remove from registry * @return void */ public static function removeObject($key) { diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index cc3638aed..6ad4ed380 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -247,7 +247,7 @@ class Helper extends Object { * an array of url parameters. Using an array for URLs will allow you to leverage * the reverse routing features of CakePHP. * @param boolean $full If true, the full base URL will be prepended to the result - * @return string Full translated URL with base path. + * @return string Full translated URL with base path. * @link http://book.cakephp.org/2.0/en/views/helpers.html */ public function url($url = null, $full = false) { diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 1f6773bd3..d2860d9c0 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -649,14 +649,14 @@ class FormHelper extends AppHelper { * * ### Options: * - * - `escape` bool Whether or not to html escape the contents of the error. - * - `wrap` mixed Whether or not the error message should be wrapped in a div. If a + * - `escape` bool - Whether or not to html escape the contents of the error. + * - `wrap` mixed - Whether or not the error message should be wrapped in a div. If a * string, will be used as the HTML tag to use. - * - `class` string The classname for the error message + * - `class` string - The classname for the error message * * @param string $field A field name, like "Modelname.fieldname" * @param string|array $text Error message as string or array of messages. - * If array contains `attributes` key it will be used as options for error container + * If array contains `attributes` key it will be used as options for error container * @param array $options Rendering options for
wrapper tag * @return string If there are errors this method returns an error message, otherwise null. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::error diff --git a/lib/Cake/View/Helper/NumberHelper.php b/lib/Cake/View/Helper/NumberHelper.php index 7f359a5f9..79fcc9946 100644 --- a/lib/Cake/View/Helper/NumberHelper.php +++ b/lib/Cake/View/Helper/NumberHelper.php @@ -76,7 +76,7 @@ class NumberHelper extends AppHelper { /** * @see CakeNumber::precision() * - * @param float $number A floating point number. + * @param float $number A floating point number. * @param integer $precision The precision of the returned number. * @return float Formatted float. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::precision diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index 14b31cb14..c9c0cb3f3 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -233,7 +233,7 @@ if (!function_exists('pr')) { * Print_r convenience function, which prints out
 tags around
  * the output of given array. Similar to debug().
  *
- * @see	debug()
+ * @see debug()
  * @param array $var Variable to print out
  * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#pr
  */
@@ -281,7 +281,7 @@ if (!function_exists('env')) {
  * IIS, or SCRIPT_NAME in CGI mode). Also exposes some additional custom
  * environment information.
  *
- * @param  string $key Environment variable name.
+ * @param string $key Environment variable name.
  * @return string Environment variable setting.
  * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#env
  */
@@ -382,11 +382,11 @@ if (!function_exists('cache')) {
 /**
  * Reads/writes temporary data to cache files or session.
  *
- * @param  string $path	File path within /tmp to save the file.
- * @param  mixed  $data	The data to save to the temporary file.
- * @param  mixed  $expires A valid strtotime string when the data expires.
- * @param  string $target  The target of the cached data; either 'cache' or 'public'.
- * @return mixed  The contents of the temporary file.
+ * @param string $path File path within /tmp to save the file.
+ * @param mixed $data The data to save to the temporary file.
+ * @param mixed $expires A valid strtotime string when the data expires.
+ * @param string $target The target of the cached data; either 'cache' or 'public'.
+ * @return mixed The contents of the temporary file.
  * @deprecated Please use Cache::write() instead
  */
 	function cache($path, $data = null, $expires = '+1 day', $target = 'cache') {

From e7f380d2b796b3ebc6874a4dcd1c3c36fcd669d1 Mon Sep 17 00:00:00 2001
From: euromark 
Date: Fri, 5 Jul 2013 14:36:40 +0200
Subject: [PATCH 03/13] doublespace to single space

---
 lib/Cake/Console/Shell.php                           |  2 +-
 lib/Cake/Console/Templates/default/views/view.ctp    |  2 +-
 .../Component/Auth/BlowfishAuthenticate.php          |  2 +-
 .../Controller/Component/Auth/DigestAuthenticate.php |  2 +-
 lib/Cake/Controller/Component/CookieComponent.php    |  2 +-
 lib/Cake/Core/Object.php                             |  4 ++--
 lib/Cake/Error/ErrorHandler.php                      |  2 +-
 lib/Cake/Error/ExceptionRenderer.php                 |  2 +-
 lib/Cake/Model/Datasource/DataSource.php             |  2 +-
 lib/Cake/Model/Model.php                             |  2 +-
 lib/Cake/Network/CakeRequest.php                     |  2 +-
 lib/Cake/Network/CakeResponse.php                    | 12 ++++++------
 .../Controller/Component/PaginatorComponentTest.php  |  2 +-
 lib/Cake/Test/Case/Core/AppTest.php                  |  2 +-
 .../Case/Model/Datasource/Database/PostgresTest.php  |  2 +-
 .../Test/Case/Model/Datasource/DboSourceTest.php     |  2 +-
 lib/Cake/Test/Case/Model/ModelWriteTest.php          |  4 ++--
 lib/Cake/Utility/Debugger.php                        |  2 +-
 lib/Cake/Utility/Set.php                             |  2 +-
 lib/Cake/View/View.php                               |  2 +-
 lib/Cake/basics.php                                  |  2 +-
 21 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php
index dde22dfed..e129b78f6 100644
--- a/lib/Cake/Console/Shell.php
+++ b/lib/Cake/Console/Shell.php
@@ -542,7 +542,7 @@ class Shell extends Object {
  *
  * There are 3 built-in output level. Shell::QUIET, Shell::NORMAL, Shell::VERBOSE.
  * The verbose and quiet output levels, map to the `verbose` and `quiet` output switches
- * present in  most shells. Using Shell::QUIET for a message means it will always display.
+ * present in most shells. Using Shell::QUIET for a message means it will always display.
  * While using Shell::VERBOSE means it will only display when verbose output is toggled.
  *
  * @param string|array $message A string or a an array of strings to output
diff --git a/lib/Cake/Console/Templates/default/views/view.ctp b/lib/Cake/Console/Templates/default/views/view.ctp
index 2703202c6..f5009d718 100644
--- a/lib/Cake/Console/Templates/default/views/view.ctp
+++ b/lib/Cake/Console/Templates/default/views/view.ctp
@@ -18,7 +18,7 @@
  */
 ?>
 
-

"; ?>

+

"; ?>

Cookie->path = '/'; * * The path on the server in which the cookie will be available on. - * If public $cookiePath is set to '/foo/', the cookie will only be available + * If public $cookiePath is set to '/foo/', the cookie will only be available * within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. * The default value is the entire domain. * diff --git a/lib/Cake/Core/Object.php b/lib/Cake/Core/Object.php index bfeaf59d6..997678def 100644 --- a/lib/Cake/Core/Object.php +++ b/lib/Cake/Core/Object.php @@ -110,8 +110,8 @@ class Object { * Calls a method on this object with the given parameters. Provides an OO wrapper * for `call_user_func_array` * - * @param string $method Name of the method to call - * @param array $params Parameter list to use when calling $method + * @param string $method Name of the method to call + * @param array $params Parameter list to use when calling $method * @return mixed Returns the result of the method call */ public function dispatchMethod($method, $params = array()) { diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php index edb043bd7..1791c7d4b 100644 --- a/lib/Cake/Error/ErrorHandler.php +++ b/lib/Cake/Error/ErrorHandler.php @@ -32,7 +32,7 @@ App::uses('Router', 'Routing'); * * ### Uncaught exceptions * - * When debug < 1 a CakeException will render 404 or 500 errors. If an uncaught exception is thrown + * When debug < 1 a CakeException will render 404 or 500 errors. If an uncaught exception is thrown * and it is a type that ErrorHandler does not know about it will be treated as a 500 error. * * ### Implementing application specific exception handling diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 5166cef53..09ee6db08 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -30,7 +30,7 @@ App::uses('Controller', 'Controller'); * Exception Renderer. * * Captures and handles all unhandled exceptions. Displays helpful framework errors when debug > 1. - * When debug < 1 a CakeException will render 404 or 500 errors. If an uncaught exception is thrown + * When debug < 1 a CakeException will render 404 or 500 errors. If an uncaught exception is thrown * and it is a type that ExceptionHandler does not know about it will be treated as a 500 error. * * ### Implementing application specific exception rendering diff --git a/lib/Cake/Model/Datasource/DataSource.php b/lib/Cake/Model/Datasource/DataSource.php index e30353fd5..94380d7a7 100644 --- a/lib/Cake/Model/Datasource/DataSource.php +++ b/lib/Cake/Model/Datasource/DataSource.php @@ -173,7 +173,7 @@ class DataSource extends Object { /** * Converts column types to basic types * - * @param string $real Real column type (i.e. "varchar(255)") + * @param string $real Real column type (i.e. "varchar(255)") * @return string Abstract column type (i.e. "string") */ public function column($real) { diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index d90f9e52a..36f651467 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -948,7 +948,7 @@ class Model extends Object implements CakeEventListener { * unbound models that are not made permanent will reset with the next call to Model::find() * * @param array $params Set of bindings to unbind (indexed by binding type) - * @param boolean $reset Set to false to make the unbinding permanent + * @param boolean $reset Set to false to make the unbinding permanent * @return boolean Success * @link http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#creating-and-destroying-associations-on-the-fly */ diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index fe47d48fe..41f2ee786 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -559,7 +559,7 @@ class CakeRequest implements ArrayAccess { * e.g `addDetector('post', array('param' => 'requested', 'value' => 1)` * * @param string $name The name of the detector. - * @param array $options The options for the detector definition. See above. + * @param array $options The options for the detector definition. See above. * @return void */ public function addDetector($name, $options) { diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index 8d59cf0fc..cc629d672 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -778,9 +778,9 @@ class CakeResponse { * This method controls the `public` or `private` directive in the Cache-Control * header * - * @param boolean $public if set to true, the Cache-Control header will be set as public - * if set to false, the response will be set to private - * if no value is provided, it will return whether the response is sharable or not + * @param boolean $public If set to true, the Cache-Control header will be set as public + * if set to false, the response will be set to private + * if no value is provided, it will return whether the response is sharable or not * @param integer $time time in seconds after which the response should no longer be considered fresh * @return boolean */ @@ -858,7 +858,7 @@ class CakeResponse { * If called with no parameters, this function will return whether must-revalidate is present. * * @param integer $seconds if null, the method will return the current - * must-revalidate value + * must-revalidate value * @return boolean */ public function mustRevalidate($enable = null) { @@ -968,7 +968,7 @@ class CakeResponse { * value is returned * * @param string|array $cacheVariances a single Vary string or a array - * containing the list for variances. + * containing the list for variances. * @return array */ public function vary($cacheVariances = null) { @@ -1000,7 +1000,7 @@ class CakeResponse { * * @param string $hash the unique has that identifies this response * @param boolean $weak whether the response is semantically the same as - * other with the same hash or not + * other with the same hash or not * @return string */ public function etag($tag = null, $weak = false) { diff --git a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php index 61206f173..42778a494 100644 --- a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php @@ -578,7 +578,7 @@ class PaginatorComponentTest extends CakeTestCase { } /** - * test paginate() and model default order + * test paginate() and model default order * * @return void */ diff --git a/lib/Cake/Test/Case/Core/AppTest.php b/lib/Cake/Test/Case/Core/AppTest.php index 30c1b7901..88bc6e0c9 100644 --- a/lib/Cake/Test/Case/Core/AppTest.php +++ b/lib/Cake/Test/Case/Core/AppTest.php @@ -813,7 +813,7 @@ class AppTest extends CakeTestCase { } /** - * Tests that App::location() returns the defined path for a class + * Tests that App::location() returns the defined path for a class * * @return void */ diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php index 00eb1fa98..4cf7d507d 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php @@ -738,7 +738,7 @@ class PostgresTest extends CakeTestCase { } /** - * Test the alterSchema RENAME statements + * Test the alterSchema RENAME statements * * @return void */ diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index bedc1d258..2cbfaa749 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -861,7 +861,7 @@ class DboSourceTest extends CakeTestCase { $Comment->find('all', array('recursive' => 2)); // ensure Model descriptions are saved $this->db->getLog(); - // case: Comment belongsTo User and Article + // case: Comment belongsTo User and Article $Comment->unbindModel(array( 'hasOne' => array('Attachment') )); diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 7d4639248..c9955d9a9 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -4573,7 +4573,7 @@ class ModelWriteTest extends BaseModelTest { $result = $model->saveAll(array( 'Article' => array( 'title' => 'Post with Author', - 'body' => 'This post will be saved author' + 'body' => 'This post will be saved author' ), 'Comment' => array( array('comment' => 'First new comment'), @@ -5977,7 +5977,7 @@ class ModelWriteTest extends BaseModelTest { $result = $model->saveAssociated(array( 'Article' => array( 'title' => 'Post with Author', - 'body' => 'This post will be saved author' + 'body' => 'This post will be saved author' ), 'Comment' => array( array('comment' => 'First new comment'), diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index 871bd31b7..e1b5c2aec 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -701,7 +701,7 @@ class Debugger { * straight HTML output, or 'txt' for unformatted text. * @param array $strings Template strings to be used for the output format. * @return string - * @deprecated Use Debugger::outputAs() and Debugger::addFormat(). Will be removed + * @deprecated Use Debugger::outputAs() and Debugger::addFormat(). Will be removed * in 3.0 */ public function output($format = null, $strings = array()) { diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php index 9baa26534..5f668dd0c 100644 --- a/lib/Cake/Utility/Set.php +++ b/lib/Cake/Utility/Set.php @@ -457,7 +457,7 @@ class Set { * This function can be used to see if a single item or a given xpath match certain conditions. * * @param string|array $conditions An array of condition strings or an XPath expression - * @param array $data An array of data to execute the match on + * @param array $data An array of data to execute the match on * @param integer $i Optional: The 'nth'-number of the item being matched. * @param integer $length * @return boolean diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index 962d8168f..d4595ed35 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -583,7 +583,7 @@ class View extends Object { * * @param string $var The view var you want the contents of. * @return mixed The content of the named var if its set, otherwise null. - * @deprecated Will be removed in 3.0 Use View::get() instead. + * @deprecated Will be removed in 3.0. Use View::get() instead. */ public function getVar($var) { return $this->get($var); diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index c9c0cb3f3..816f42794 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -127,7 +127,7 @@ if (!function_exists('sortByKey')) { * * @param array $array Array to sort * @param string $sortby Sort by this key - * @param string $order Sort order asc/desc (ascending or descending). + * @param string $order Sort order asc/desc (ascending or descending). * @param integer $type Type of sorting to perform * @return mixed Sorted array * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#sortByKey From c478d60e79ea8b23387a353427a0f7ac72cdb54d Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 5 Jul 2013 16:07:29 +0200 Subject: [PATCH 04/13] bool to boolean --- lib/Cake/Network/CakeRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index 41f2ee786..f939ffee2 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -478,7 +478,7 @@ class CakeRequest implements ArrayAccess { * on routing parameters. * * @param string $name The property being accessed. - * @return bool Existence + * @return boolean Existence */ public function __isset($name) { return isset($this->params[$name]); From ba026786934cc934535028036b86947aa00d186b Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 5 Jul 2013 16:17:23 +0200 Subject: [PATCH 05/13] doc block corrections --- lib/Cake/Log/CakeLog.php | 8 ++++---- lib/Cake/Network/CakeRequest.php | 2 +- lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php | 2 +- lib/Cake/Test/Case/Model/BehaviorCollectionTest.php | 6 +++--- lib/Cake/Test/Case/Model/models.php | 2 +- lib/Cake/Test/Case/Network/CakeRequestTest.php | 4 +++- lib/Cake/Test/Case/Utility/FileTest.php | 2 +- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/Cake/Log/CakeLog.php b/lib/Cake/Log/CakeLog.php index de7098b31..17ad88ca2 100644 --- a/lib/Cake/Log/CakeLog.php +++ b/lib/Cake/Log/CakeLog.php @@ -255,8 +255,8 @@ class CakeLog { * }}} * * @param array $levels array - * @param bool $append true to append, false to replace - * @return array active log levels + * @param boolean $append true to append, false to replace + * @return array Active log levels */ public static function levels($levels = array(), $append = true) { if (empty(self::$_Collection)) { @@ -278,7 +278,7 @@ class CakeLog { /** * Reset log levels to the original value * - * @return array default log levels + * @return array Default log levels */ public static function defaultLevels() { self::$_levelMap = self::$_defaultLevels; @@ -304,7 +304,7 @@ class CakeLog { * Checks whether $streamName is enabled * * @param string $streamName to check - * @return bool + * @return boolean * @throws CakeLogException */ public static function enabled($streamName) { diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index f939ffee2..2dac6cdec 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -673,7 +673,7 @@ class CakeRequest implements ArrayAccess { * * @param integer $tldLength Number of segments your tld contains. For example: `example.com` contains 1 tld. * While `example.co.uk` contains 2. - * @return array of subdomains. + * @return array An array of subdomains. */ public function subdomains($tldLength = 1) { $segments = explode('.', $this->host()); diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php index e4d936963..a04cb593c 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php @@ -498,7 +498,7 @@ class DbAclTest extends CakeTestCase { * Generates a list of the current aro and aco structures and a grid dump of the permissions that are defined * Only designed to work with the db based ACL * - * @param bool $treesToo + * @param boolean $treesToo * @return void */ protected function _debug($printTreesToo = false) { diff --git a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php index 58a667baa..b84260dec 100644 --- a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php +++ b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php @@ -184,7 +184,7 @@ class TestBehavior extends ModelBehavior { * afterValidate method * * @param Model $model - * @param bool $cascade + * @param boolean $cascade * @return void */ public function afterValidate(Model $model) { @@ -205,7 +205,7 @@ class TestBehavior extends ModelBehavior { * beforeDelete method * * @param Model $model - * @param bool $cascade + * @param boolean $cascade * @return void */ public function beforeDelete(Model $model, $cascade = true) { @@ -277,7 +277,7 @@ class TestBehavior extends ModelBehavior { * testMethod method * * @param Model $model - * @param bool $param + * @param boolean $param * @return void */ public function testMethod(Model $model, $param = true) { diff --git a/lib/Cake/Test/Case/Model/models.php b/lib/Cake/Test/Case/Model/models.php index 85e6b9715..1f6c8799b 100644 --- a/lib/Cake/Test/Case/Model/models.php +++ b/lib/Cake/Test/Case/Model/models.php @@ -2547,7 +2547,7 @@ class NumberTree extends CakeTestModel { * @param mixed $currentLevel * @param mixed $parent_id * @param string $prefix - * @param bool $hierarchal + * @param boolean $hierarchal * @return void */ public function initialize($levelLimit = 3, $childLimit = 3, $currentLevel = null, $parentId = null, $prefix = '1', $hierarchal = true) { diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index ec70970c3..b9ff23bee 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -33,7 +33,8 @@ class TestCakeRequest extends CakeRequest { * reConstruct method * * @param string $url - * @param bool $parseEnvironment + * @param boolean $parseEnvironment + * @return void */ public function reConstruct($url = 'some/path', $parseEnvironment = true) { $this->_base(); @@ -2105,6 +2106,7 @@ XML; /** * Test onlyAllow throwing exception * + * @return void */ public function testOnlyAllowException() { $_SERVER['REQUEST_METHOD'] = 'PUT'; diff --git a/lib/Cake/Test/Case/Utility/FileTest.php b/lib/Cake/Test/Case/Utility/FileTest.php index 9e15cf562..26958a8db 100644 --- a/lib/Cake/Test/Case/Utility/FileTest.php +++ b/lib/Cake/Test/Case/Utility/FileTest.php @@ -543,7 +543,7 @@ class FileTest extends CakeTestCase { /** * getTmpFile method * - * @param bool $paintSkip + * @param boolean $paintSkip * @return void */ protected function _getTmpFile($paintSkip = true) { From af455b41214f240a40c6805bc74d0d0b0cfbc7ab Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 5 Jul 2013 17:19:22 +0200 Subject: [PATCH 06/13] correct return types in doc blocks --- lib/Cake/Console/Command/Task/ExtractTask.php | 1 + lib/Cake/Console/ConsoleErrorHandler.php | 1 + lib/Cake/Controller/Component/Acl/AclInterface.php | 2 ++ lib/Cake/Model/Behavior/TranslateBehavior.php | 1 + lib/Cake/Model/Validator/CakeValidationSet.php | 1 + lib/Cake/Network/CakeSocket.php | 1 + lib/Cake/Test/Case/Core/ConfigureTest.php | 2 +- lib/Cake/Test/Case/I18n/I18nTest.php | 2 +- lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php | 2 +- lib/Cake/Test/Case/Model/ModelReadTest.php | 3 ++- lib/Cake/Test/Case/Utility/SecurityTest.php | 2 +- lib/Cake/Test/Case/View/HelperTest.php | 2 +- lib/Cake/View/XmlView.php | 4 ++-- lib/Cake/basics.php | 2 ++ 14 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index 4648c1e47..fbc963894 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -247,6 +247,7 @@ class ExtractTask extends AppShell { * @param string $domain * @param string $msgid * @param array $details + * @return void */ protected function _addTranslation($domain, $msgid, $details = array()) { if (empty($this->_translations[$domain][$msgid])) { diff --git a/lib/Cake/Console/ConsoleErrorHandler.php b/lib/Cake/Console/ConsoleErrorHandler.php index 1165031d9..e249ccfe3 100644 --- a/lib/Cake/Console/ConsoleErrorHandler.php +++ b/lib/Cake/Console/ConsoleErrorHandler.php @@ -96,6 +96,7 @@ class ConsoleErrorHandler { * Wrapper for exit(), used for testing. * * @param int $code The exit code. + * @return void */ protected function _stop($code = 0) { exit($code); diff --git a/lib/Cake/Controller/Component/Acl/AclInterface.php b/lib/Cake/Controller/Component/Acl/AclInterface.php index 6ad29ae47..f6794e9e2 100644 --- a/lib/Cake/Controller/Component/Acl/AclInterface.php +++ b/lib/Cake/Controller/Component/Acl/AclInterface.php @@ -28,6 +28,7 @@ interface AclInterface { * @param string $aro ARO The requesting object identifier. * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) + * @return boolean Success */ public function check($aro, $aco, $action = "*"); @@ -65,6 +66,7 @@ interface AclInterface { * Initialization method for the Acl implementation * * @param AclComponent $component + * @return void */ public function initialize(Component $component); diff --git a/lib/Cake/Model/Behavior/TranslateBehavior.php b/lib/Cake/Model/Behavior/TranslateBehavior.php index eff7b4060..1335f06a8 100644 --- a/lib/Cake/Model/Behavior/TranslateBehavior.php +++ b/lib/Cake/Model/Behavior/TranslateBehavior.php @@ -628,6 +628,7 @@ class TranslateBehavior extends ModelBehavior { * * @param Model $Model Model instance * @param string $field The field to update. + * @return void */ protected function _removeField(Model $Model, $field) { if (array_key_exists($field, $this->settings[$Model->alias])) { diff --git a/lib/Cake/Model/Validator/CakeValidationSet.php b/lib/Cake/Model/Validator/CakeValidationSet.php index 208d0582a..e17e0213a 100644 --- a/lib/Cake/Model/Validator/CakeValidationSet.php +++ b/lib/Cake/Model/Validator/CakeValidationSet.php @@ -331,6 +331,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable { * * @param string $index name of the rule * @param CakeValidationRule|array rule to add to $index + * @return void */ public function offsetSet($index, $rule) { $this->setRule($index, $rule); diff --git a/lib/Cake/Network/CakeSocket.php b/lib/Cake/Network/CakeSocket.php index 43f5318c4..3fcebad6e 100644 --- a/lib/Cake/Network/CakeSocket.php +++ b/lib/Cake/Network/CakeSocket.php @@ -186,6 +186,7 @@ class CakeSocket { * * @param int $code * @param string $message + * @return void */ protected function _connectionErrorHandler($code, $message) { $this->_connectionErrors[] = $message; diff --git a/lib/Cake/Test/Case/Core/ConfigureTest.php b/lib/Cake/Test/Case/Core/ConfigureTest.php index 0376632cf..65e7717ca 100644 --- a/lib/Cake/Test/Case/Core/ConfigureTest.php +++ b/lib/Cake/Test/Case/Core/ConfigureTest.php @@ -447,7 +447,7 @@ class ConfigureTest extends CakeTestCase { /** * Test dumping only some of the data. * - * @return + * @return void */ public function testDumpPartial() { Configure::config('test_reader', new PhpReader(TMP)); diff --git a/lib/Cake/Test/Case/I18n/I18nTest.php b/lib/Cake/Test/Case/I18n/I18nTest.php index ff4f562ff..80303e2c5 100644 --- a/lib/Cake/Test/Case/I18n/I18nTest.php +++ b/lib/Cake/Test/Case/I18n/I18nTest.php @@ -194,7 +194,7 @@ class I18nTest extends CakeTestCase { /** * Assertions for rules zero. * - * @return + * @return void */ public function assertRulesZero() { $singular = $this->__singular(); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 29a8bc671..2fd7bed05 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -2508,7 +2508,7 @@ class MysqlTest extends CakeTestCase { /** * Test that array conditions with only one element work. * - * @return + * @return void */ public function testArrayConditionsOneElement() { $conditions = array('id' => array(1)); diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index 620afcd5d..0ecbec7e8 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -3765,7 +3765,7 @@ class ModelReadTest extends BaseModelTest { /** * Test find(neighbors) with missing fields so no neighbors are found. * - * @return + * @return void */ public function testFindNeighborsNoPrev() { $this->loadFixtures('User', 'Article', 'Comment', 'Tag', 'ArticlesTag', 'Attachment'); @@ -3786,6 +3786,7 @@ class ModelReadTest extends BaseModelTest { ); $this->assertEquals($expected, $result); } + /** * testFindCombinedRelations method * diff --git a/lib/Cake/Test/Case/Utility/SecurityTest.php b/lib/Cake/Test/Case/Utility/SecurityTest.php index 850042985..f1a0e33f8 100644 --- a/lib/Cake/Test/Case/Utility/SecurityTest.php +++ b/lib/Cake/Test/Case/Utility/SecurityTest.php @@ -265,7 +265,7 @@ class SecurityTest extends CakeTestCase { /** * Test that rijndael() can still decrypt values with a fixed iv. * - * @return + * @return void */ public function testRijndaelBackwardCompatibility() { $this->skipIf(!function_exists('mcrypt_encrypt')); diff --git a/lib/Cake/Test/Case/View/HelperTest.php b/lib/Cake/Test/Case/View/HelperTest.php index af95a8549..e3d6db33c 100644 --- a/lib/Cake/Test/Case/View/HelperTest.php +++ b/lib/Cake/Test/Case/View/HelperTest.php @@ -309,7 +309,7 @@ class HelperTest extends CakeTestCase { /** * test setEntity with setting a scope. * - * @return + * @return void */ public function testSetEntityScoped() { $this->Helper->setEntity('HelperTestPost', true); diff --git a/lib/Cake/View/XmlView.php b/lib/Cake/View/XmlView.php index e77698eec..6fcfb0b3f 100644 --- a/lib/Cake/View/XmlView.php +++ b/lib/Cake/View/XmlView.php @@ -94,9 +94,9 @@ class XmlView extends View { } /** - * Serialize view vars + * Serialize view vars. * - * @param array $serialize The viewVars that need to be serialized + * @param array $serialize The viewVars that need to be serialized. * @return string The serialized data */ protected function _serialize($serialize) { diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index 816f42794..ebeff8c1b 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -68,6 +68,7 @@ if (!function_exists('debug')) { * @param boolean $var Variable to show debug information for. * @param boolean $showHtml If set to true, the method prints the debug data in a browser-friendly way. * @param boolean $showFrom If set to true, the method prints from where the function was called. + * @return void * @link http://book.cakephp.org/2.0/en/development/debugging.html#basic-debugging * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#debug */ @@ -235,6 +236,7 @@ if (!function_exists('pr')) { * * @see debug() * @param array $var Variable to print out + * @return void * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#pr */ function pr($var) { From 85a75906d4d809150ca79d9f01ae4841ed8538bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Sat, 6 Jul 2013 00:27:23 +0200 Subject: [PATCH 07/13] Minor doc block improvements http://ch1.php.net/manual/de/exception.construct.php Second parameter gets only passed by. Exception constructor uses an int for the second parameter,not a string. Replaced text by docblock @see http://www.phpdoc.org/docs/latest/for-users/phpdoc/tags/see.html --- lib/Cake/Error/exceptions.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/Cake/Error/exceptions.php b/lib/Cake/Error/exceptions.php index 5ebeead97..469132493 100644 --- a/lib/Cake/Error/exceptions.php +++ b/lib/Cake/Error/exceptions.php @@ -36,13 +36,12 @@ class CakeBaseException extends RuntimeException { /** * Get/set the response header to be used * - * See also CakeResponse::header() - * * @param string|array $header. An array of header strings or a single header string * - an associative array of "header name" => "header value" * - an array of string headers is also accepted * @param string $value. The header value. * @return array + * @see CakeResponse::header() See also */ public function responseHeader($header = null, $value = null) { if ($header) { @@ -79,7 +78,7 @@ class BadRequestException extends HttpException { * Constructor * * @param string $message If no message is given 'Bad Request' will be the message - * @param string $code Status code, defaults to 400 + * @param int $code Status code, defaults to 400 */ public function __construct($message = null, $code = 400) { if (empty($message)) { @@ -101,7 +100,7 @@ class UnauthorizedException extends HttpException { * Constructor * * @param string $message If no message is given 'Unauthorized' will be the message - * @param string $code Status code, defaults to 401 + * @param int $code Status code, defaults to 401 */ public function __construct($message = null, $code = 401) { if (empty($message)) { @@ -123,7 +122,7 @@ class ForbiddenException extends HttpException { * Constructor * * @param string $message If no message is given 'Forbidden' will be the message - * @param string $code Status code, defaults to 403 + * @param int $code Status code, defaults to 403 */ public function __construct($message = null, $code = 403) { if (empty($message)) { @@ -145,7 +144,7 @@ class NotFoundException extends HttpException { * Constructor * * @param string $message If no message is given 'Not Found' will be the message - * @param string $code Status code, defaults to 404 + * @param int $code Status code, defaults to 404 */ public function __construct($message = null, $code = 404) { if (empty($message)) { @@ -167,7 +166,7 @@ class MethodNotAllowedException extends HttpException { * Constructor * * @param string $message If no message is given 'Method Not Allowed' will be the message - * @param string $code Status code, defaults to 405 + * @param int $code Status code, defaults to 405 */ public function __construct($message = null, $code = 405) { if (empty($message)) { @@ -189,7 +188,7 @@ class InternalErrorException extends HttpException { * Constructor * * @param string $message If no message is given 'Internal Server Error' will be the message - * @param string $code Status code, defaults to 500 + * @param int $code Status code, defaults to 500 */ public function __construct($message = null, $code = 500) { if (empty($message)) { @@ -231,7 +230,7 @@ class CakeException extends CakeBaseException { * * @param string|array $message Either the string of the error message, or an array of attributes * that are made available in the view, and sprintf()'d into CakeException::$_messageTemplate - * @param string $code The code of the error, is also the HTTP status code for the error. + * @param int $code The code of the error, is also the HTTP status code for the error. */ public function __construct($message, $code = 500) { if (is_array($message)) { From a7213b2e6451b45a9801e8ca4060641c6848a196 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 5 Jul 2013 21:25:06 -0400 Subject: [PATCH 08/13] Update doc block. --- lib/Cake/Error/exceptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Error/exceptions.php b/lib/Cake/Error/exceptions.php index 469132493..ef14bbf03 100644 --- a/lib/Cake/Error/exceptions.php +++ b/lib/Cake/Error/exceptions.php @@ -41,7 +41,7 @@ class CakeBaseException extends RuntimeException { * - an array of string headers is also accepted * @param string $value. The header value. * @return array - * @see CakeResponse::header() See also + * @see CakeResponse::header() */ public function responseHeader($header = null, $value = null) { if ($header) { From d9882fcc08d778a958b537e9980f8fe7969bdccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Sat, 6 Jul 2013 16:12:13 +0200 Subject: [PATCH 09/13] Fixed three @param data types --- lib/Cake/Utility/String.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Utility/String.php b/lib/Cake/Utility/String.php index 5b3092fe2..b3457cecb 100644 --- a/lib/Cake/Utility/String.php +++ b/lib/Cake/Utility/String.php @@ -191,9 +191,9 @@ class String { * - clean: A boolean or array with instructions for String::cleanInsert * * @param string $str A string containing variable placeholders - * @param string $data A key => val array where each key stands for a placeholder variable name + * @param array $data A key => val array where each key stands for a placeholder variable name * to be replaced with val - * @param string $options An array of options, see description above + * @param array $options An array of options, see description above * @return string */ public static function insert($str, $data, $options = array()) { @@ -256,7 +256,7 @@ class String { * by String::insert(). * * @param string $str - * @param string $options + * @param array $options * @return string * @see String::insert() */ From 11eeb33644c63f1049ed56c7608abe84144f5fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Sat, 6 Jul 2013 19:04:06 +0200 Subject: [PATCH 10/13] Some minor CS improvements to FormHelper Replaced use of deprecated method getVar by get. Improved DocBocks, mostly data types Removed deprecated DocBock tag because it's an invalid use of such. This makes the method look like it was deprecated but in reality it's only one of the possible values of one of its parameters. --- lib/Cake/View/Helper/FormHelper.php | 35 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index d2860d9c0..4b1ec6c1d 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -599,9 +599,9 @@ class FormHelper extends AppHelper { * * @param boolean $lock Whether this field should be part of the validation * or excluded as part of the unlockedFields. - * @param string|array $field Reference to field to be secured. Should be dot separated to indicate nesting. + * @param string $field Reference to field to be secured. Should be dot separated to indicate nesting. * @param mixed $value Field value, if value should not be tampered with. - * @return void + * @return mixed|null Not used yet */ protected function _secure($lock, $field = null, $value = null) { if (!$field) { @@ -1029,8 +1029,8 @@ class FormHelper extends AppHelper { /** * Generates an input element * - * @param type $args - * @return type + * @param array $args The options for the input element + * @return string The generated input element */ protected function _getInput($args) { extract($args); @@ -1069,7 +1069,7 @@ class FormHelper extends AppHelper { /** * Generates input options array * - * @param type $options + * @param array $options * @return array Options */ protected function _parseOptions($options) { @@ -1100,7 +1100,7 @@ class FormHelper extends AppHelper { /** * Generates list of options for multiple select * - * @param type $options + * @param array $options * @return array */ protected function _optionsOptions($options) { @@ -1110,7 +1110,7 @@ class FormHelper extends AppHelper { $varName = Inflector::variable( Inflector::pluralize(preg_replace('/_id$/', '', $this->field())) ); - $varOptions = $this->_View->getVar($varName); + $varOptions = $this->_View->get($varName); if (!is_array($varOptions)) { return $options; } @@ -1124,7 +1124,7 @@ class FormHelper extends AppHelper { /** * Magically set option type and corresponding options * - * @param type $options + * @param array $options * @return array */ protected function _magicOptions($options) { @@ -1192,7 +1192,7 @@ class FormHelper extends AppHelper { /** * Generate format options * - * @param type $options + * @param array $options * @return array */ protected function _getFormat($options) { @@ -1211,8 +1211,8 @@ class FormHelper extends AppHelper { /** * Generate label for input * - * @param type $fieldName - * @param type $options + * @param string $fieldName + * @param array $options * @return boolean|string false or Generated label element */ protected function _getLabel($fieldName, $options) { @@ -1234,7 +1234,7 @@ class FormHelper extends AppHelper { /** * Calculates maxlength option * - * @param type $options + * @param array $options * @return array */ protected function _maxLength($options) { @@ -1310,9 +1310,8 @@ class FormHelper extends AppHelper { * * @param string $fieldName * @param string $label - * @param array $options Options for the label element. + * @param array $options Options for the label element. 'NONE' option is deprecated and will be removed in 3.0 * @return string Generated label element - * @deprecated 'NONE' option is deprecated and will be removed in 3.0 */ protected function _inputLabel($fieldName, $label, $options) { $labelAttributes = $this->domId(array(), 'for'); @@ -1739,7 +1738,7 @@ class FormHelper extends AppHelper { * @param string $title The content to be wrapped by tags. * @param string|array $url Cake-relative URL or array of URL parameters, or external URL (starts with http://) * @param array $options Array of HTML attributes. - * @param string $confirmMessage JavaScript confirmation message. + * @param bool|string $confirmMessage JavaScript confirmation message. * @return string An `` element. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::postLink */ @@ -2234,7 +2233,7 @@ class FormHelper extends AppHelper { * - `value` The selected value of the input. * * @param string $fieldName Prefix name for the SELECT element - * @param string $attributes Array of Attributes + * @param array $attributes Array of Attributes * @return string Completed minute select input. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::minute */ @@ -2294,7 +2293,7 @@ class FormHelper extends AppHelper { * - `value` The selected value of the input. * * @param string $fieldName Prefix name for the SELECT element - * @param string $attributes Array of Attributes + * @param array|string $attributes Array of Attributes * @return string Completed meridian select input * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::meridian */ @@ -2344,7 +2343,7 @@ class FormHelper extends AppHelper { * @param string $fieldName Prefix name for the SELECT element * @param string $dateFormat DMY, MDY, YMD, or null to not generate date inputs. * @param string $timeFormat 12, 24, or null to not generate time inputs. - * @param string $attributes array of Attributes + * @param array|string $attributes array of Attributes * @return string Generated set of select boxes for the date and time formats chosen. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::dateTime */ From a397f034e67364bb8802c74862c95e175e350e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Sat, 6 Jul 2013 19:50:26 +0200 Subject: [PATCH 11/13] Some love for a deprecated class Whitespace and wording. Optionally we could include a version number until when this class will work. I assumed this will be 3.0... http://www.phpdoc.org/docs/latest/for-users/phpdoc/tags/deprecated.html I treid that but after I let apigen generate the doc and I saw it did nothing special about it ;-/ --- lib/Cake/Controller/Component/EmailComponent.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Controller/Component/EmailComponent.php b/lib/Cake/Controller/Component/EmailComponent.php index 4b966df76..f8ebd6fb2 100644 --- a/lib/Cake/Controller/Component/EmailComponent.php +++ b/lib/Cake/Controller/Component/EmailComponent.php @@ -29,9 +29,9 @@ App::uses('CakeEmail', 'Network/Email'); * based on the standard outlined in http://www.rfc-editor.org/rfc/rfc2822.txt * * @package Cake.Controller.Component - * @link http://book.cakephp.org/2.0/en/core-libraries/components/email.html - * @link http://book.cakephp.org/2.0/en/core-utility-libraries/email.html - * @deprecated Use Network/CakeEmail + * @link http://book.cakephp.org/2.0/en/core-libraries/components/email.html + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/email.html + * @deprecated Will be removed in 3.0. Use Network/CakeEmail instead */ class EmailComponent extends Component { From 4bb0a1228a0d2f1063b41be1c4b186ec60372523 Mon Sep 17 00:00:00 2001 From: Rachman Chavik Date: Sat, 6 Jul 2013 19:58:38 +0700 Subject: [PATCH 12/13] Fix I18n to extract plugin model validation messages --- lib/Cake/Console/Command/Task/ExtractTask.php | 26 ++++++++++++++++--- .../Console/Command/Task/ExtractTaskTest.php | 3 ++- .../TestPlugin/Model/TestPluginAuthors.php | 9 +++++++ 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index fbc963894..fad4639d0 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -441,11 +441,29 @@ class ExtractTask extends AppShell { return; } + $plugins = array(null); + if (empty($this->params['exclude-plugins'])) { + $plugins = array_merge($plugins, App::objects('plugins')); + } + foreach ($plugins as $plugin) { + $this->_extractPluginValidationMessages($plugin); + } + } + +/** + * Extract validation messages from application or plugin models + * + * @param string $plugin Plugin name or `null` to process application models + * @return void + */ + protected function _extractPluginValidationMessages($plugin = null) { App::uses('AppModel', 'Model'); - $plugin = null; - if (!empty($this->params['plugin'])) { - App::uses($this->params['plugin'] . 'AppModel', $this->params['plugin'] . '.Model'); - $plugin = $this->params['plugin'] . '.'; + if (!empty($plugin)) { + if (!CakePlugin::loaded($plugin)) { + return; + } + App::uses($plugin . 'AppModel', $plugin . '.Model'); + $plugin = $plugin . '.'; } $models = App::objects($plugin . 'Model', null, false); diff --git a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php index d4aa46433..485268928 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php @@ -268,7 +268,7 @@ class ExtractTaskTest extends CakeTestCase { $this->out = $this->getMock('ConsoleOutput', array(), array(), '', false); $this->in = $this->getMock('ConsoleInput', array(), array(), '', false); $this->Task = $this->getMock('ExtractTask', - array('_isExtractingApp', '_extractValidationMessages', 'in', 'out', 'err', 'clear', '_stop'), + array('_isExtractingApp', 'in', 'out', 'err', 'clear', '_stop'), array($this->out, $this->out, $this->in) ); @@ -280,6 +280,7 @@ class ExtractTaskTest extends CakeTestCase { $this->assertNotRegExp('#Pages#', $result); $this->assertContains('translate.ctp:1', $result); $this->assertContains('This is a translatable string', $result); + $this->assertContains('I can haz plugin model validation message', $result); } /** diff --git a/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/TestPluginAuthors.php b/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/TestPluginAuthors.php index 5f0480d67..2708e1622 100644 --- a/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/TestPluginAuthors.php +++ b/lib/Cake/Test/test_app/Plugin/TestPlugin/Model/TestPluginAuthors.php @@ -32,4 +32,13 @@ class TestPluginAuthors extends TestPluginAppModel { public $name = 'TestPluginAuthors'; + public $validate = array( + 'field' => array( + 'notEmpty' => array( + 'rule' => 'notEmpty', + 'message' => 'I can haz plugin model validation message', + ), + ), + ); + } From 0555895de3587d5a29b88b5976c6f609a81ef0e9 Mon Sep 17 00:00:00 2001 From: Rachman Chavik Date: Sun, 7 Jul 2013 00:08:09 +0700 Subject: [PATCH 13/13] Remove leftover temp file --- lib/Cake/Test/test_app/tmp/dir_map | 2 -- lib/Cake/Test/test_app/tmp/empty | 0 2 files changed, 2 deletions(-) delete mode 100644 lib/Cake/Test/test_app/tmp/dir_map create mode 100644 lib/Cake/Test/test_app/tmp/empty diff --git a/lib/Cake/Test/test_app/tmp/dir_map b/lib/Cake/Test/test_app/tmp/dir_map deleted file mode 100644 index 1f8b2ba67..000000000 --- a/lib/Cake/Test/test_app/tmp/dir_map +++ /dev/null @@ -1,2 +0,0 @@ -1845415352 -a:4:{s:27:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs";a:24:{i:0;s:27:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs";i:1;s:32:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view";i:2;s:42:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\scaffolds";i:3;s:38:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\pages";i:4;s:40:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\layouts";i:5;s:44:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\layouts\\\\xml";i:6;s:44:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\layouts\\\\rss";i:7;s:43:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\layouts\\\\js";i:8;s:46:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\layouts\\\\email";i:9;s:51:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\layouts\\\\email\\\\text";i:10;s:51:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\layouts\\\\email\\\\html";i:11;s:40:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\helpers";i:12;s:39:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\errors";i:13;s:41:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\elements";i:14;s:47:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\elements\\\\email";i:15;s:52:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\elements\\\\email\\\\text";i:16;s:52:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\view\\\\elements\\\\email\\\\html";i:17;s:33:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\model";i:18;s:45:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\model\\\\datasources";i:19;s:49:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\model\\\\datasources\\\\dbo";i:20;s:43:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\model\\\\behaviors";i:21;s:38:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\controller";i:22;s:49:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\controller\\\\components";i:23;s:33:"C:\\\\dev\\\\prj2\\\\sites\\\\cake\\\\libs\\\\cache";}s:35:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\vendors";a:7:{i:0;s:35:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\vendors";i:1;s:42:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\vendors\\\\shells";i:2;s:52:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\vendors\\\\shells\\\\templates";i:3;s:64:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\vendors\\\\shells\\\\templates\\\\cdc_project";i:4;s:48:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\vendors\\\\shells\\\\tasks";i:5;s:38:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\vendors\\\\js";i:6;s:39:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\vendors\\\\css";}s:25:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors";a:10:{i:0;s:25:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors";i:1;s:36:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors\\\\simpletest";i:2;s:41:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors\\\\simpletest\\\\test";i:3;s:49:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors\\\\simpletest\\\\test\\\\support";i:4;s:59:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors\\\\simpletest\\\\test\\\\support\\\\collector";i:5;s:47:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors\\\\simpletest\\\\extensions";i:6;s:55:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors\\\\simpletest\\\\extensions\\\\testdox";i:7;s:41:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors\\\\simpletest\\\\docs";i:8;s:44:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors\\\\simpletest\\\\docs\\\\fr";i:9;s:44:"C:\\\\dev\\\\prj2\\\\sites\\\\vendors\\\\simpletest\\\\docs\\\\en";}s:41:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\views\\\\helpers";a:1:{i:0;s:41:"C:\\\\dev\\\\prj2\\\\sites\\\\main_site\\\\views\\\\helpers";}} diff --git a/lib/Cake/Test/test_app/tmp/empty b/lib/Cake/Test/test_app/tmp/empty new file mode 100644 index 000000000..e69de29bb