diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php index a75f0acfd..60c7973b8 100644 --- a/lib/Cake/Cache/Cache.php +++ b/lib/Cake/Cache/Cache.php @@ -113,11 +113,11 @@ class Cache { * - `user` Used by Xcache. Username for XCache * - `password` Used by Xcache/Redis. Password for XCache/Redis * - * @see app/Config/core.php for configuration settings * @param string $name Name of the configuration * @param array $settings Optional associative array of settings passed to the engine * @return array array(engine, settings) on success, false on failure * @throws CacheException + * @see app/Config/core.php for configuration settings */ public static function config($name = null, $settings = array()) { if (is_array($name)) { @@ -561,6 +561,7 @@ class Cache { * the cache key is empty. Can be any callable type supported by your PHP. * @param string $config The cache configuration to use for this operation. * Defaults to default. + * @return mixed The results of the callable or unserialized results. */ public static function remember($key, $callable, $config = 'default') { $existing = self::read($key, $config); diff --git a/lib/Cake/Cache/CacheEngine.php b/lib/Cake/Cache/CacheEngine.php index 5d19bdeaf..394950b40 100644 --- a/lib/Cake/Cache/CacheEngine.php +++ b/lib/Cake/Cache/CacheEngine.php @@ -130,7 +130,7 @@ abstract class CacheEngine { * to decide whether actually delete the keys or just simulate it to achieve * the same result. * - * @param string $groups name of the group to be cleared + * @param string $group name of the group to be cleared * @return boolean */ public function clearGroup($group) { diff --git a/lib/Cake/Cache/Engine/ApcEngine.php b/lib/Cake/Cache/Engine/ApcEngine.php index 8fd0ff1ad..a06fbd3f7 100644 --- a/lib/Cake/Cache/Engine/ApcEngine.php +++ b/lib/Cake/Cache/Engine/ApcEngine.php @@ -173,6 +173,7 @@ class ApcEngine extends CacheEngine { * Increments the group value to simulate deletion of all keys under a group * old values will remain in storage until they expire. * + * @param string $group The group to clear. * @return boolean success */ public function clearGroup($group) { diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index b93d6c1a8..ad96952c1 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -303,8 +303,8 @@ class FileEngine extends CacheEngine { /** * Not implemented * - * @param string $key - * @param integer $offset + * @param string $key The key to decrement + * @param integer $offset The number to offset * @return void * @throws CacheException */ @@ -315,8 +315,8 @@ class FileEngine extends CacheEngine { /** * Not implemented * - * @param string $key - * @param integer $offset + * @param string $key The key to decrement + * @param integer $offset The number to offset * @return void * @throws CacheException */ @@ -405,6 +405,7 @@ class FileEngine extends CacheEngine { /** * Recursively deletes all files under any directory named as $group * + * @param string $group The group to clear. * @return boolean success */ public function clearGroup($group) { diff --git a/lib/Cake/Cache/Engine/MemcacheEngine.php b/lib/Cake/Cache/Engine/MemcacheEngine.php index facaedf0e..5f15fb03b 100644 --- a/lib/Cake/Cache/Engine/MemcacheEngine.php +++ b/lib/Cake/Cache/Engine/MemcacheEngine.php @@ -199,7 +199,8 @@ class MemcacheEngine extends CacheEngine { /** * Delete all keys from the cache * - * @param boolean $check + * @param boolean $check If true no deletes will occur and instead CakePHP will rely + * on key TTL values. * @return boolean True if the cache was successfully cleared, false otherwise */ public function clear($check) { @@ -282,6 +283,7 @@ class MemcacheEngine extends CacheEngine { * Increments the group value to simulate deletion of all keys under a group * old values will remain in storage until they expire. * + * @param string $group The group to clear. * @return boolean success */ public function clearGroup($group) { diff --git a/lib/Cake/Cache/Engine/MemcachedEngine.php b/lib/Cake/Cache/Engine/MemcachedEngine.php index 820dd720f..9beb887db 100644 --- a/lib/Cake/Cache/Engine/MemcachedEngine.php +++ b/lib/Cake/Cache/Engine/MemcachedEngine.php @@ -144,6 +144,7 @@ class MemcachedEngine extends CacheEngine { * Settings the memcached instance * * @throws CacheException when the Memcached extension is not built with the desired serializer engine + * @return void */ protected function _setOptions() { $this->_Memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true); @@ -265,7 +266,8 @@ class MemcachedEngine extends CacheEngine { /** * Delete all keys from the cache * - * @param boolean $check + * @param boolean $check If true no deletes will occur and instead CakePHP will rely + * on key TTL values. * @return boolean True if the cache was successfully cleared, false otherwise */ public function clear($check) { @@ -322,6 +324,7 @@ class MemcachedEngine extends CacheEngine { * Increments the group value to simulate deletion of all keys under a group * old values will remain in storage until they expire. * + * @param string $group The group to clear. * @return boolean success */ public function clearGroup($group) { diff --git a/lib/Cake/Cache/Engine/RedisEngine.php b/lib/Cake/Cache/Engine/RedisEngine.php index 2c52de1bc..fa15b344f 100644 --- a/lib/Cake/Cache/Engine/RedisEngine.php +++ b/lib/Cake/Cache/Engine/RedisEngine.php @@ -175,7 +175,8 @@ class RedisEngine extends CacheEngine { /** * Delete all keys from the cache * - * @param boolean $check + * @param boolean $check Whether or not expiration keys should be checked. If + * true, no keys will be removed as cache will rely on redis TTL's. * @return boolean True if the cache was successfully cleared, false otherwise */ public function clear($check) { @@ -212,6 +213,7 @@ class RedisEngine extends CacheEngine { * Increments the group value to simulate deletion of all keys under a group * old values will remain in storage until they expire. * + * @param string $group The group name to clear. * @return boolean success */ public function clearGroup($group) { diff --git a/lib/Cake/Cache/Engine/WincacheEngine.php b/lib/Cake/Cache/Engine/WincacheEngine.php index bfba803d2..fb3c3066e 100644 --- a/lib/Cake/Cache/Engine/WincacheEngine.php +++ b/lib/Cake/Cache/Engine/WincacheEngine.php @@ -179,6 +179,7 @@ class WincacheEngine extends CacheEngine { * Increments the group value to simulate deletion of all keys under a group * old values will remain in storage until they expire. * + * @param string $group The group to clear. * @return boolean success */ public function clearGroup($group) { diff --git a/lib/Cake/Cache/Engine/XcacheEngine.php b/lib/Cake/Cache/Engine/XcacheEngine.php index 12e19c786..5bab6d5dc 100644 --- a/lib/Cake/Cache/Engine/XcacheEngine.php +++ b/lib/Cake/Cache/Engine/XcacheEngine.php @@ -126,7 +126,8 @@ class XcacheEngine extends CacheEngine { /** * Delete all keys from the cache * - * @param boolean $check + * @param boolean $check If true no deletes will occur and instead CakePHP will rely + * on key TTL values. * @return boolean True if the cache was successfully cleared, false otherwise */ public function clear($check) { @@ -163,6 +164,7 @@ class XcacheEngine extends CacheEngine { * Increments the group value to simulate deletion of all keys under a group * old values will remain in storage until they expire. * + * @param string $group The group to clear. * @return boolean success */ public function clearGroup($group) { diff --git a/lib/Cake/Configure/ConfigReaderInterface.php b/lib/Cake/Configure/ConfigReaderInterface.php index e36f05697..8c1677b03 100644 --- a/lib/Cake/Configure/ConfigReaderInterface.php +++ b/lib/Cake/Configure/ConfigReaderInterface.php @@ -26,7 +26,7 @@ interface ConfigReaderInterface { * These sources can either be static resources like files, or dynamic ones like * a database, or other datasource. * - * @param string $key + * @param string $key Key to read. * @return array An array of data to merge into the runtime configuration */ public function read($key); diff --git a/lib/Cake/Configure/IniReader.php b/lib/Cake/Configure/IniReader.php index 886ab1779..8b4c6fac2 100644 --- a/lib/Cake/Configure/IniReader.php +++ b/lib/Cake/Configure/IniReader.php @@ -181,7 +181,7 @@ class IniReader implements ConfigReaderInterface { /** * Converts a value into the ini equivalent * - * @param mixed $value to export. + * @param mixed $val Value to export. * @return string String value for ini file. */ protected function _value($val) { diff --git a/lib/Cake/Console/Templates/default/views/index.ctp b/lib/Cake/Console/Templates/default/views/index.ctp index f48f3f1e1..0dffb9d6b 100644 --- a/lib/Cake/Console/Templates/default/views/index.ctp +++ b/lib/Cake/Console/Templates/default/views/index.ctp @@ -19,12 +19,15 @@

"; ?>

+ + + \n"; echo "\t\n"; @@ -53,6 +56,7 @@ echo "\n"; ?> +
Paginator->sort('{$field}'); ?>"; ?> "; ?>

_findUser($username, $pass); diff --git a/lib/Cake/Controller/Component/Auth/BlowfishPasswordHasher.php b/lib/Cake/Controller/Component/Auth/BlowfishPasswordHasher.php index 0c15fdd16..5f9f9c520 100644 --- a/lib/Cake/Controller/Component/Auth/BlowfishPasswordHasher.php +++ b/lib/Cake/Controller/Component/Auth/BlowfishPasswordHasher.php @@ -1,7 +1,5 @@ data($model . '.' . $field); - if (empty($value) || !is_string($value)) { + if (empty($value) && $value !== '0' || !is_string($value)) { return false; } } diff --git a/lib/Cake/Controller/Component/Auth/SimplePasswordHasher.php b/lib/Cake/Controller/Component/Auth/SimplePasswordHasher.php index 5a42312eb..ef7ab4711 100644 --- a/lib/Cake/Controller/Component/Auth/SimplePasswordHasher.php +++ b/lib/Cake/Controller/Component/Auth/SimplePasswordHasher.php @@ -1,7 +1,5 @@ Auth->allow('edit', 'add');` or * `$this->Auth->allow();` to allow all actions * - * @param string|array $action,... Controller action name or array of actions + * @param string|array $action Controller action name or array of actions * @return void * @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#making-actions-public */ @@ -537,7 +537,7 @@ class AuthComponent extends Component { * `$this->Auth->deny('edit', 'add');` or * `$this->Auth->deny();` to remove all items from the allowed list * - * @param string|array $action,... Controller action name or array of actions + * @param string|array $action Controller action name or array of actions * @return void * @see AuthComponent::allow() * @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#making-actions-require-authorization diff --git a/lib/Cake/Controller/Component/CookieComponent.php b/lib/Cake/Controller/Component/CookieComponent.php index d1aececd2..14f0e5bf7 100644 --- a/lib/Cake/Controller/Component/CookieComponent.php +++ b/lib/Cake/Controller/Component/CookieComponent.php @@ -185,7 +185,7 @@ class CookieComponent extends Component { /** * Start CookieComponent for use in the controller * - * @param Controller $controller + * @param Controller $controller Controller instance. * @return void */ public function startup(Controller $controller) { @@ -293,7 +293,7 @@ class CookieComponent extends Component { /** * Returns true if given variable is set in cookie. * - * @param string $var Variable name to check for + * @param string $key Variable name to check for * @return boolean True if variable is there */ public function check($key = null) { diff --git a/lib/Cake/Controller/Component/EmailComponent.php b/lib/Cake/Controller/Component/EmailComponent.php index 2e5ba1c38..92ef9a307 100644 --- a/lib/Cake/Controller/Component/EmailComponent.php +++ b/lib/Cake/Controller/Component/EmailComponent.php @@ -423,7 +423,7 @@ class EmailComponent extends Component { /** * Format addresses to be an array with email as key and alias as value * - * @param array $addresses + * @param array $addresses Address to format. * @return array */ protected function _formatAddresses($addresses) { diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php index 2d1cf5907..6978916ed 100644 --- a/lib/Cake/Controller/Component/RequestHandlerComponent.php +++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php @@ -224,7 +224,7 @@ class RequestHandlerComponent extends Component { * Helper method to parse xml input data, due to lack of anonymous functions * this lives here. * - * @param string $xml + * @param string $xml XML string. * @return array Xml array data */ public function convertXml($xml) { @@ -246,7 +246,7 @@ class RequestHandlerComponent extends Component { * @param Controller $controller A reference to the controller * @param string|array $url A string or array containing the redirect location * @param integer|array $status HTTP Status for redirect - * @param boolean $exit + * @param boolean $exit Whether to exit script, defaults to `true`. * @return void */ public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) { @@ -279,7 +279,7 @@ class RequestHandlerComponent extends Component { * render process is skipped. And the client will get a blank response with a * "304 Not Modified" header. * - * @params Controller $controller + * @param Controller $controller Controller instance. * @return boolean false if the render process should be aborted */ public function beforeRender(Controller $controller) { @@ -444,9 +444,10 @@ class RequestHandlerComponent extends Component { /** * Gets remote client IP * - * @param boolean $safe + * @param boolean $safe Use safe = false when you think the user might manipulate + * their HTTP_CLIENT_IP header. Setting $safe = false will also look at HTTP_X_FORWARDED_FOR * @return string Client IP address - * @deprecated use $this->request->clientIp() from your, controller instead. + * @deprecated use $this->request->clientIp() from your, controller instead. */ public function getClientIP($safe = true) { return $this->request->clientIp($safe); diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index ca311fe86..73c0f62aa 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -346,7 +346,7 @@ class Controller extends Object implements CakeEventListener { * Provides backwards compatibility to avoid problems with empty and isset to alias properties. * Lazy loads models using the loadModel() method if declared in $uses * - * @param string $name + * @param string $name Property name to check. * @return boolean */ public function __isset($name) { @@ -412,8 +412,8 @@ class Controller extends Object implements CakeEventListener { /** * Provides backwards compatibility access for setting values to the request object. * - * @param string $name - * @param mixed $value + * @param string $name Property name to set. + * @param mixed $value Value to set. * @return void */ public function __set($name, $value) { @@ -448,7 +448,7 @@ class Controller extends Object implements CakeEventListener { * - $this->autoRender - To false if $request->params['return'] == 1 * - $this->passedArgs - The the combined results of params['named'] and params['pass] * - * @param CakeRequest $request + * @param CakeRequest $request Request instance. * @return void */ public function setRequest(CakeRequest $request) { @@ -471,7 +471,7 @@ class Controller extends Object implements CakeEventListener { * Dispatches the controller action. Checks that the action * exists and isn't private. * - * @param CakeRequest $request + * @param CakeRequest $request Request instance. * @return mixed The resulting response. * @throws PrivateActionException When actions are not public or prefixed by _ * @throws MissingActionException When actions are not defined and scaffolding is @@ -528,7 +528,7 @@ class Controller extends Object implements CakeEventListener { /** * Returns a scaffold object to use for dynamically scaffolded controllers. * - * @param CakeRequest $request + * @param CakeRequest $request Request instance. * @return Scaffold */ protected function _getScaffold(CakeRequest $request) { @@ -887,11 +887,11 @@ class Controller extends Object implements CakeEventListener { } /** - * Validates models passed by parameters. Example: + * Validates models passed by parameters. Takes a list of models as a variable argument. + * Example: * * `$errors = $this->validateErrors($this->Article, $this->User);` * - * @param mixed A list of models as a variable argument * @return array Validation errors, or false if none * @deprecated This method will be removed in 3.0 */ @@ -1145,7 +1145,7 @@ class Controller extends Object implements CakeEventListener { /** * Alias to beforeScaffold() * - * @param string $method + * @param string $method Method name. * @return boolean * @see Controller::beforeScaffold() * @deprecated Will be removed in 3.0. @@ -1168,7 +1168,7 @@ class Controller extends Object implements CakeEventListener { /** * Alias to afterScaffoldSave() * - * @param string $method + * @param string $method Method name. * @return boolean * @see Controller::afterScaffoldSave() * @deprecated Will be removed in 3.0. @@ -1191,7 +1191,7 @@ class Controller extends Object implements CakeEventListener { /** * Alias to afterScaffoldSaveError() * - * @param string $method + * @param string $method Method name. * @return boolean * @see Controller::afterScaffoldSaveError() * @deprecated Will be removed in 3.0. @@ -1216,7 +1216,7 @@ class Controller extends Object implements CakeEventListener { /** * Alias to scaffoldError() * - * @param string $method + * @param string $method Method name. * @return boolean * @see Controller::scaffoldError() * @deprecated Will be removed in 3.0. diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index 1d174a007..4df1dc8fb 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -393,7 +393,7 @@ class App { * * `App::core('Cache/Engine'); will return the full path to the cache engines package` * - * @param string $type + * @param string $type Package type. * @return array full path to package * @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::core */ @@ -587,19 +587,19 @@ class App { * Finds classes based on $name or specific file(s) to search. Calling App::import() will * not construct any classes contained in the files. It will only find and require() the file. * - * @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#including-files-with-app-import * @param string|array $type The type of Class if passed as a string, or all params can be passed as - * an single array to $type, + * an single array to $type. * @param string $name Name of the Class or a unique name for the file * @param boolean|array $parent boolean true if Class Parent should be searched, accepts key => value - * array('parent' => $parent, 'file' => $file, 'search' => $search, 'ext' => '$ext'); - * $ext allows setting the extension of the file name - * based on Inflector::underscore($name) . ".$ext"; + * array('parent' => $parent, 'file' => $file, 'search' => $search, 'ext' => '$ext'); + * $ext allows setting the extension of the file name + * based on Inflector::underscore($name) . ".$ext"; * @param array $search paths to search for files, array('path 1', 'path 2', 'path 3'); * @param string $file full name of the file to search for including extension * @param boolean $return Return the loaded file, the file must have a return - * statement in it to work: return $variable; + * statement in it to work: return $variable; * @return boolean true if Class is already in memory or if file is found and loaded, false if not + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#including-files-with-app-import */ public static function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) { $ext = null; diff --git a/lib/Cake/Core/CakePlugin.php b/lib/Cake/Core/CakePlugin.php index 3515de8fa..529ae0c62 100644 --- a/lib/Cake/Core/CakePlugin.php +++ b/lib/Cake/Core/CakePlugin.php @@ -115,7 +115,7 @@ class CakePlugin { * The above example will load the bootstrap file for all plugins, but for DebugKit it will only load * the routes file and will not look for any bootstrap script. * - * @param array $options + * @param array $options Options list. See CakePlugin::load() for valid options. * @return void */ public static function loadAll($options = array()) { @@ -206,7 +206,7 @@ class CakePlugin { * Returns true if the plugin $plugin is already loaded * If plugin is null, it will return a list of all loaded plugins * - * @param string $plugin + * @param string $plugin Plugin name to check. * @return mixed boolean true if $plugin is already loaded. * If $plugin is null, returns a list of plugins that have been loaded */ diff --git a/lib/Cake/Core/Configure.php b/lib/Cake/Core/Configure.php index bc1a3f041..b8319f519 100644 --- a/lib/Cake/Core/Configure.php +++ b/lib/Cake/Core/Configure.php @@ -62,7 +62,7 @@ class Configure { * - Include app/Config/bootstrap.php. * - Setup error/exception handlers. * - * @param boolean $boot + * @param boolean $boot Whether to do bootstrapping. * @return void */ public static function bootstrap($boot = true) { @@ -113,6 +113,7 @@ class Configure { /** * Set app's default configs + * * @return void */ protected static function _appDefaults() { @@ -143,11 +144,11 @@ class Configure { * )); * }}} * - * @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::write * @param string|array $config The key to write, can be a dot notation value. * Alternatively can be an array containing key(s) and value(s). * @param mixed $value Value to set for var * @return boolean True if write was successful + * @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::write */ public static function write($config, $value = null) { if (!is_array($config)) { @@ -178,9 +179,9 @@ class Configure { * Configure::read('Name.key'); will return only the value of Configure::Name[key] * }}} * - * @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::read * @param string $var Variable to obtain. Use '.' to access array elements. * @return mixed value stored in configure, or null. + * @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::read */ public static function read($var = null) { if ($var === null) { @@ -211,9 +212,9 @@ class Configure { * Configure::delete('Name.key'); will delete only the Configure::Name[key] * }}} * - * @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::delete * @param string $var the var to be deleted * @return void + * @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::delete */ public static function delete($var = null) { self::$_values = Hash::remove(self::$_values, $var); @@ -240,7 +241,7 @@ class Configure { /** * Gets the names of the configured reader objects. * - * @param string $name + * @param string $name Name to check. If null returns all configured reader names. * @return array Array of the configured reader objects. */ public static function configured($name = null) { @@ -283,12 +284,12 @@ class Configure { * If using `default` config and no reader has been configured for it yet, * one will be automatically created using PhpReader * - * @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::load * @param string $key name of configuration resource to load. * @param string $config Name of the configured reader to use to read the resource identified by $key. * @param boolean $merge if config files should be merged instead of simply overridden * @return boolean False if file not found, true if load successful. * @throws ConfigureException Will throw any exceptions the reader raises. + * @link http://book.cakephp.org/2.0/en/development/configuration.html#Configure::load */ public static function load($key, $config = 'default', $merge = true) { $reader = self::_getReader($config); diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php index 3e6eca2a7..5d8a14fde 100644 --- a/lib/Cake/Error/ErrorHandler.php +++ b/lib/Cake/Error/ErrorHandler.php @@ -102,7 +102,7 @@ class ErrorHandler { * This will either use custom exception renderer class if configured, * or use the default ExceptionRenderer. * - * @param Exception $exception + * @param Exception $exception The exception to render. * @return void * @see http://php.net/manual/en/function.set-exception-handler.php */ @@ -132,6 +132,7 @@ class ErrorHandler { /** * Generates a formatted error message + * * @param Exception $exception Exception instance * @return string Formatted message */ @@ -159,8 +160,8 @@ class ErrorHandler { /** * Handles exception logging * - * @param Exception $exception - * @param array $config + * @param Exception $exception The exception to render. + * @param array $config An array of configuration for logging. * @return boolean */ protected static function _log(Exception $exception, $config) { diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 63dc66215..60482db10 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -180,7 +180,7 @@ class ExceptionRenderer { /** * Generic handler for the internal framework errors CakePHP can generate. * - * @param CakeException $error + * @param CakeException $error The exception to render. * @return void */ protected function _cakeError(CakeException $error) { @@ -202,7 +202,7 @@ class ExceptionRenderer { /** * Convenience method to display a 400 series page. * - * @param Exception $error + * @param Exception $error The exception to render. * @return void */ public function error400($error) { @@ -225,7 +225,7 @@ class ExceptionRenderer { /** * Convenience method to display a 500 page. * - * @param Exception $error + * @param Exception $error The exception to render. * @return void */ public function error500($error) { @@ -249,7 +249,7 @@ class ExceptionRenderer { /** * Convenience method to display a PDOException. * - * @param PDOException $error + * @param PDOException $error The exception to render. * @return void */ public function pdoError(PDOException $error) { diff --git a/lib/Cake/Error/exceptions.php b/lib/Cake/Error/exceptions.php index fbc5bdc9e..0a0a52c95 100644 --- a/lib/Cake/Error/exceptions.php +++ b/lib/Cake/Error/exceptions.php @@ -34,9 +34,9 @@ class CakeBaseException extends RuntimeException { /** * Get/set the response header to be used * - * @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|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() @@ -378,6 +378,12 @@ class MissingConnectionException extends CakeException { protected $_messageTemplate = 'Database connection "%s" is missing, or could not be created.'; +/** + * Constructor + * + * @param string|array $message The error message. + * @param int $code The error code. + */ public function __construct($message, $code = 500) { if (is_array($message)) { $message += array('enabled' => true); @@ -587,10 +593,10 @@ class FatalErrorException extends CakeException { /** * Constructor * - * @param string $message - * @param integer $code - * @param string $file - * @param integer $line + * @param string $message The error message. + * @param integer $code The error code. + * @param string $file The file the error occurred in. + * @param integer $line The line the error occurred on. */ public function __construct($message, $code = 500, $file = null, $line = null) { parent::__construct($message, $code); diff --git a/lib/Cake/Event/CakeEvent.php b/lib/Cake/Event/CakeEvent.php index cdd737a30..0716e9b0b 100644 --- a/lib/Cake/Event/CakeEvent.php +++ b/lib/Cake/Event/CakeEvent.php @@ -1,7 +1,5 @@ _defaults, $config); @@ -157,6 +157,7 @@ class FileLog extends BaseLog { /** * Get filename + * * @param string $type The type of log. * @return string File name */ diff --git a/lib/Cake/Log/Engine/SyslogLog.php b/lib/Cake/Log/Engine/SyslogLog.php index 51cf1ac9f..d6ed83630 100644 --- a/lib/Cake/Log/Engine/SyslogLog.php +++ b/lib/Cake/Log/Engine/SyslogLog.php @@ -87,7 +87,7 @@ class SyslogLog extends BaseLog { * Make sure the configuration contains the format parameter, by default it uses * the error number and the type as a prefix to the message * - * @param array $config + * @param array $config Options list. */ public function __construct($config = array()) { $config += $this->_defaults; @@ -142,8 +142,8 @@ class SyslogLog extends BaseLog { * Extracts the call to syslog() in order to run unit tests on it. This function * will perform the actual write in the system logger * - * @param integer $priority - * @param string $message + * @param integer $priority Message priority. + * @param string $message Message to log. * @return boolean */ protected function _write($priority, $message) { diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php index c729fc44b..105be01a4 100644 --- a/lib/Cake/Model/CakeSchema.php +++ b/lib/Cake/Model/CakeSchema.php @@ -599,7 +599,7 @@ class CakeSchema extends Object { /** * Formats Schema columns from Model Object * - * @param array $Obj model object + * @param array &$Obj model object * @return array Formatted columns */ protected function _columns(&$Obj) { diff --git a/lib/Cake/Model/ModelValidator.php b/lib/Cake/Model/ModelValidator.php index 377866aa9..aa7a96cd7 100644 --- a/lib/Cake/Model/ModelValidator.php +++ b/lib/Cake/Model/ModelValidator.php @@ -119,7 +119,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable { * If you do not want this to happen, make a copy of `$data` before passing it * to this method * - * @param array $data Record data to validate. This should be an array indexed by association name. + * @param array &$data Record data to validate. This should be an array indexed by association name. * @param array $options Options to use when validating record data (see above), See also $options of validates(). * @return array|boolean If atomic: True on success, or false on failure. * Otherwise: array similar to the $data array passed, but values are set to true/false @@ -196,7 +196,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable { * If you do not want this to happen, make a copy of `$data` before passing it * to this method * - * @param array $data Record data to validate. This should be a numerically-indexed array + * @param array &$data Record data to validate. This should be a numerically-indexed array * @param array $options Options to use when validating record data (see above), See also $options of validates(). * @return mixed If atomic: True on success, or false on failure. * Otherwise: array similar to the $data array passed, but values are set to true/false @@ -442,7 +442,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable { /** * Propagates beforeValidate event * - * @param array $options + * @param array $options Options to pass to callback. * @return boolean */ protected function _triggerBeforeValidate($options = array()) { @@ -544,7 +544,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable { * )); * }}} * - * @param string $field The name of the field from which the rule will be removed + * @param string $field The name of the field where the rule is to be added * @param string|array|CakeValidationSet $name name of the rule to be added or list of rules for the field * @param array|CakeValidationRule $rule or list of rules to be added to the field's rule set * @return ModelValidator this instance diff --git a/lib/Cake/Model/Validator/CakeValidationRule.php b/lib/Cake/Model/Validator/CakeValidationRule.php index 0a5d5e5de..7df11f579 100644 --- a/lib/Cake/Model/Validator/CakeValidationRule.php +++ b/lib/Cake/Model/Validator/CakeValidationRule.php @@ -157,7 +157,7 @@ class CakeValidationRule { * Checks whether the field failed the `field should be present` validation * * @param string $field Field name - * @param array $data Data to check rule against + * @param array &$data Data to check rule against * @return boolean */ public function checkRequired($field, &$data) { @@ -174,7 +174,7 @@ class CakeValidationRule { * Checks if the allowEmpty key applies * * @param string $field Field name - * @param array $data data to check rule against + * @param array &$data data to check rule against * @return boolean */ public function checkEmpty($field, &$data) { @@ -259,8 +259,8 @@ class CakeValidationRule { * Dispatches the validation rule to the given validator method * * @param string $field Field name - * @param array $data Data array - * @param array $methods Methods list + * @param array &$data Data array + * @param array &$methods Methods list * @return boolean True if the rule could be dispatched, false otherwise */ public function process($field, &$data, &$methods) { @@ -334,7 +334,7 @@ class CakeValidationRule { * Parses the rule and sets the rule and ruleParams * * @param string $field Field name - * @param array $data Data array + * @param array &$data Data array * @return void */ protected function _parseRule($field, &$data) { diff --git a/lib/Cake/Model/Validator/CakeValidationSet.php b/lib/Cake/Model/Validator/CakeValidationSet.php index e6817e50c..ff32f9ad2 100644 --- a/lib/Cake/Model/Validator/CakeValidationSet.php +++ b/lib/Cake/Model/Validator/CakeValidationSet.php @@ -74,8 +74,8 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable { /** * Constructor * - * @param string $fieldName The fieldname - * @param array $ruleset + * @param string $fieldName The fieldname. + * @param array $ruleSet Rules set. */ public function __construct($fieldName, $ruleSet) { $this->field = $fieldName; @@ -93,7 +93,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable { /** * Sets the list of methods to use for validation * - * @param array $methods Methods list + * @param array &$methods Methods list * @return void */ public function setMethods(&$methods) { @@ -160,7 +160,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable { /** * Gets a rule for a given name if exists * - * @param string $name + * @param string $name Field name. * @return CakeValidationRule */ public function getRule($name) { @@ -330,11 +330,10 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable { * This is a wrapper for ArrayAccess. Use setRule() directly for * chainable access. * - * @see http://www.php.net/manual/en/arrayobject.offsetset.php - * - * @param string $index name of the rule - * @param CakeValidationRule|array rule to add to $index + * @param string $index Name of the rule. + * @param CakeValidationRule|array $rule Rule to add to $index. * @return void + * @see http://www.php.net/manual/en/arrayobject.offsetset.php */ public function offsetSet($index, $rule) { $this->setRule($index, $rule); diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index 64f16224d..672a6799a 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -793,7 +793,7 @@ class CakeRequest implements ArrayAccess { * Only qualifiers will be extracted, any other accept extensions will be * discarded as they are not frequently used. * - * @param string $header + * @param string $header Header to parse. * @return array */ protected static function _parseAcceptWithQualifier($header) { @@ -854,7 +854,7 @@ class CakeRequest implements ArrayAccess { * You can write to any value, even paths/keys that do not exist, and the arrays * will be created for you. * - * @param string $name,... Dot separated name of the value to read/write + * @param string $name Dot separated name of the value to read/write, one or more args. * @return mixed Either the value being read, or this so you can chain consecutive writes. */ public function data($name) { @@ -950,11 +950,11 @@ class CakeRequest implements ArrayAccess { /** * Alias of CakeRequest::allowMethod() for backwards compatibility. * - * @see CakeRequest::allowMethod() - * @deprecated 2.5 Use CakeRequest::allowMethod() instead. * @param string|array $methods Allowed HTTP request methods. * @return boolean true * @throws MethodNotAllowedException + * @see CakeRequest::allowMethod() + * @deprecated 2.5 Use CakeRequest::allowMethod() instead. */ public function onlyAllow($methods) { if (!is_array($methods)) { diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index fd9d6eeed..415f196c2 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -559,10 +559,10 @@ class CakeResponse { * e.g `header('WWW-Authenticate: Negotiate'); header('WWW-Authenticate: Not-Negotiate');` * will have the same effect as only doing `header('WWW-Authenticate: Not-Negotiate');` * - * @param string|array $header. An array of header strings or a single header string + * @param string|array $header An array of header strings or a single header string * - an associative array of "header name" => "header value" is also accepted * - an array of string headers is also accepted - * @param string|array $value. The header value(s) + * @param string|array $value The header value(s) * @return array list of headers to be sent */ public function header($header = null, $value = null) { @@ -586,6 +586,7 @@ class CakeResponse { * Acccessor for the location header. * * Get/Set the Location header value. + * * @param null|string $url Either null to get the current location, or a string to set one. * @return string|null When setting the location null will be returned. When reading the location * a string of the current location header value (if any) will be returned. @@ -702,7 +703,7 @@ class CakeResponse { * * e.g `type(array('jpg' => 'text/plain'));` * - * @param string $contentType + * @param string $contentType Content type key. * @return mixed current content type or false if supplied an invalid content type */ public function type($contentType = null) { @@ -765,7 +766,7 @@ class CakeResponse { * Sets the response charset * if $charset is null the current charset is returned * - * @param string $charset + * @param string $charset Character set string. * @return string current charset */ public function charset($charset = null) { @@ -892,8 +893,8 @@ class CakeResponse { * with the origin. * 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 + * @param boolean $enable If null returns whether directive is set, if boolean + * sets or unsets directive. * @return boolean */ public function mustRevalidate($enable = null) { @@ -934,7 +935,7 @@ class CakeResponse { * `$response->expires(new DateTime('+1 day'))` Will set the expiration in next 24 hours * `$response->expires()` Will return the current expiration header value * - * @param string|DateTime $time + * @param string|DateTime $time Valid time string or DateTime object. * @return string */ public function expires($time = null) { @@ -958,7 +959,7 @@ class CakeResponse { * `$response->modified(new DateTime('+1 day'))` Will set the modification date in the past 24 hours * `$response->modified()` Will return the current Last-Modified header value * - * @param string|DateTime $time + * @param string|DateTime $time Valid time string or DateTime object. * @return string */ public function modified($time = null) { @@ -1033,7 +1034,7 @@ class CakeResponse { * * If no parameters are passed, current Etag header is returned. * - * @param string $hash the unique has that identifies this response + * @param string $tag Tag to set. * @param boolean $weak whether the response is semantically the same as * other with the same hash or not * @return string @@ -1052,7 +1053,7 @@ class CakeResponse { * Returns a DateTime object initialized at the $time param and using UTC * as timezone * - * @param string|integer|DateTime $time + * @param string|DateTime $time Valid time string or unix timestamp or DateTime object. * @return DateTime */ protected function _getUTCDate($time = null) { @@ -1104,7 +1105,7 @@ class CakeResponse { * Sets the protocol to be used when sending the response. Defaults to HTTP/1.1 * If called with no arguments, it will return the current configured protocol * - * @param string protocol to be used for sending response + * @param string $protocol Protocol to be used for sending response. * @return string protocol currently set */ public function protocol($protocol = null) { @@ -1287,8 +1288,8 @@ class CakeResponse { /** * Normalize the origin to regular expressions and put in an array format * - * @param array $domains - * @param boolean $requestIsSSL + * @param array $domains Domains to normalize + * @param boolean $requestIsSSL Whether it's a SSL request. * @return array */ protected function _normalizeCorsDomains($domains, $requestIsSSL = false) { diff --git a/lib/Cake/Network/CakeSocket.php b/lib/Cake/Network/CakeSocket.php index d947a27b4..be8dadb9a 100644 --- a/lib/Cake/Network/CakeSocket.php +++ b/lib/Cake/Network/CakeSocket.php @@ -182,8 +182,8 @@ class CakeSocket { * * Instead we need to handle those errors manually. * - * @param integer $code - * @param string $message + * @param integer $code Code. + * @param string $message Message. * @return void */ protected function _connectionErrorHandler($code, $message) { diff --git a/lib/Cake/Network/Http/BasicAuthentication.php b/lib/Cake/Network/Http/BasicAuthentication.php index a9d34f2a3..055888225 100644 --- a/lib/Cake/Network/Http/BasicAuthentication.php +++ b/lib/Cake/Network/Http/BasicAuthentication.php @@ -26,8 +26,8 @@ class BasicAuthentication { /** * Authentication * - * @param HttpSocket $http - * @param array $authInfo + * @param HttpSocket $http Http socket instance. + * @param array &$authInfo Authentication info. * @return void * @see http://www.ietf.org/rfc/rfc2617.txt */ @@ -40,8 +40,8 @@ class BasicAuthentication { /** * Proxy Authentication * - * @param HttpSocket $http - * @param array $proxyInfo + * @param HttpSocket $http Http socket instance. + * @param array &$proxyInfo Proxy info. * @return void * @see http://www.ietf.org/rfc/rfc2617.txt */ @@ -54,8 +54,8 @@ class BasicAuthentication { /** * Generate basic [proxy] authentication header * - * @param string $user - * @param string $pass + * @param string $user Username. + * @param string $pass Password. * @return string */ protected static function _generateHeader($user, $pass) { diff --git a/lib/Cake/Network/Http/DigestAuthentication.php b/lib/Cake/Network/Http/DigestAuthentication.php index f1c49914c..aaadbb261 100644 --- a/lib/Cake/Network/Http/DigestAuthentication.php +++ b/lib/Cake/Network/Http/DigestAuthentication.php @@ -26,8 +26,8 @@ class DigestAuthentication { /** * Authentication * - * @param HttpSocket $http - * @param array $authInfo + * @param HttpSocket $http Http socket instance. + * @param array &$authInfo Authentication info. * @return void * @link http://www.ietf.org/rfc/rfc2617.txt */ @@ -43,8 +43,8 @@ class DigestAuthentication { /** * Retrieve information about the authentication * - * @param HttpSocket $http - * @param array $authInfo + * @param HttpSocket $http Http socket instance. + * @param array &$authInfo Authentication info. * @return boolean */ protected static function _getServerInformation(HttpSocket $http, &$authInfo) { @@ -70,8 +70,8 @@ class DigestAuthentication { /** * Generate the header Authorization * - * @param HttpSocket $http - * @param array $authInfo + * @param HttpSocket $http Http socket instance. + * @param array &$authInfo Authentication info. * @return string */ protected static function _generateHeader(HttpSocket $http, &$authInfo) { diff --git a/lib/Cake/Network/Http/HttpSocket.php b/lib/Cake/Network/Http/HttpSocket.php index 842ff185b..2856af78f 100644 --- a/lib/Cake/Network/Http/HttpSocket.php +++ b/lib/Cake/Network/Http/HttpSocket.php @@ -543,7 +543,7 @@ class HttpSocket extends CakeSocket { * * Would return `/search?q=socket`. * - * @param string|array Either a string or array of URL options to create a URL with. + * @param string|array $url Either a string or array of URL options to create a URL with. * @param string $uriTemplate A template string to use for URL formatting. * @return mixed Either false on failure or a string containing the composed URL. */ @@ -910,7 +910,7 @@ class HttpSocket extends CakeSocket { * Builds the header. * * @param array $header Header to build - * @param string $mode + * @param string $mode Mode * @return string Header built from array */ protected function _buildHeader($header, $mode = 'standard') { @@ -972,7 +972,7 @@ class HttpSocket extends CakeSocket { * Escapes a given $token according to RFC 2616 (HTTP 1.1 specs) * * @param string $token Token to escape - * @param array $chars + * @param array $chars Characters to escape * @return string Escaped token */ protected function _escapeToken($token, $chars = null) { @@ -985,7 +985,7 @@ class HttpSocket extends CakeSocket { * Gets escape chars according to RFC 2616 (HTTP 1.1 specs). * * @param boolean $hex true to get them as HEX values, false otherwise - * @param array $chars + * @param array $chars Characters to escape * @return array Escape chars */ protected function _tokenEscapeChars($hex = true, $chars = null) { diff --git a/lib/Cake/Network/Http/HttpSocketResponse.php b/lib/Cake/Network/Http/HttpSocketResponse.php index 4e62fa340..d5c073810 100644 --- a/lib/Cake/Network/Http/HttpSocketResponse.php +++ b/lib/Cake/Network/Http/HttpSocketResponse.php @@ -82,7 +82,7 @@ class HttpSocketResponse implements ArrayAccess { /** * Constructor * - * @param string $message + * @param string $message Message to parse. */ public function __construct($message = null) { if ($message !== null) { @@ -102,8 +102,8 @@ class HttpSocketResponse implements ArrayAccess { /** * Get header in case insensitive * - * @param string $name Header name - * @param array $headers + * @param string $name Header name. + * @param array $headers Headers to format. * @return mixed String if header exists or null */ public function getHeader($name, $headers = null) { @@ -331,8 +331,8 @@ class HttpSocketResponse implements ArrayAccess { /** * Unescapes a given $token according to RFC 2616 (HTTP 1.1 specs) * - * @param string $token Token to unescape - * @param array $chars + * @param string $token Token to unescape. + * @param array $chars Characters to unescape. * @return string Unescaped token */ protected function _unescapeToken($token, $chars = null) { @@ -344,8 +344,8 @@ class HttpSocketResponse implements ArrayAccess { /** * Gets escape chars according to RFC 2616 (HTTP 1.1 specs). * - * @param boolean $hex true to get them as HEX values, false otherwise - * @param array $chars + * @param boolean $hex True to get them as HEX values, false otherwise. + * @param array $chars Characters to uescape. * @return array Escape chars */ protected function _tokenEscapeChars($hex = true, $chars = null) { @@ -371,7 +371,7 @@ class HttpSocketResponse implements ArrayAccess { /** * ArrayAccess - Offset Exists * - * @param string $offset + * @param string $offset Offset to check. * @return boolean */ public function offsetExists($offset) { @@ -381,7 +381,7 @@ class HttpSocketResponse implements ArrayAccess { /** * ArrayAccess - Offset Get * - * @param string $offset + * @param string $offset Offset to get. * @return mixed */ public function offsetGet($offset) { @@ -418,8 +418,8 @@ class HttpSocketResponse implements ArrayAccess { /** * ArrayAccess - Offset Set * - * @param string $offset - * @param mixed $value + * @param string $offset Offset to set. + * @param mixed $value Value. * @return void */ public function offsetSet($offset, $value) { @@ -428,7 +428,7 @@ class HttpSocketResponse implements ArrayAccess { /** * ArrayAccess - Offset Unset * - * @param string $offset + * @param string $offset Offset to unset. * @return void */ public function offsetUnset($offset) { diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php index 0d410fcdc..321aee7f3 100644 --- a/lib/Cake/Routing/Dispatcher.php +++ b/lib/Cake/Routing/Dispatcher.php @@ -85,7 +85,7 @@ class Dispatcher implements CakeEventListener { * Attaches all event listeners for this dispatcher instance. Loads the * dispatcher filters from the configured locations. * - * @param CakeEventManager $manager + * @param CakeEventManager $manager Event manager instance. * @return void * @throws MissingDispatcherFilterException */ @@ -244,7 +244,7 @@ class Dispatcher implements CakeEventListener { /** * Load controller and return controller class name * - * @param CakeRequest $request + * @param CakeRequest $request Request instance. * @return string|boolean Name of controller class name */ protected function _loadController($request) { diff --git a/lib/Cake/Routing/DispatcherFilter.php b/lib/Cake/Routing/DispatcherFilter.php index 649f84c28..b8de0b0dc 100644 --- a/lib/Cake/Routing/DispatcherFilter.php +++ b/lib/Cake/Routing/DispatcherFilter.php @@ -1,7 +1,5 @@ settings = Hash::merge($this->settings, $settings); diff --git a/lib/Cake/Routing/Filter/AssetDispatcher.php b/lib/Cake/Routing/Filter/AssetDispatcher.php index 6e9fb6dbd..3c7b3d701 100644 --- a/lib/Cake/Routing/Filter/AssetDispatcher.php +++ b/lib/Cake/Routing/Filter/AssetDispatcher.php @@ -108,7 +108,7 @@ class AssetDispatcher extends DispatcherFilter { /** * Builds asset file path based off url * - * @param string $url + * @param string $url URL * @return string Absolute path for asset file */ protected function _getAssetFile($url) { diff --git a/lib/Cake/Routing/Route/CakeRoute.php b/lib/Cake/Routing/Route/CakeRoute.php index 74595c400..c154871de 100644 --- a/lib/Cake/Routing/Route/CakeRoute.php +++ b/lib/Cake/Routing/Route/CakeRoute.php @@ -536,7 +536,10 @@ class CakeRoute { $out = str_replace($search, $replace, $out); } - if (strpos($this->template, '*')) { + if (strpos($this->template, '**') !== false) { + $out = str_replace('**', $params['pass'], $out); + $out = str_replace('%2F', '/', $out); + } elseif (strpos($this->template, '*') !== false) { $out = str_replace('*', $params['pass'], $out); } $out = str_replace('//', '/', $out); diff --git a/lib/Cake/Routing/Route/RedirectRoute.php b/lib/Cake/Routing/Route/RedirectRoute.php index 322d276ed..e6a4c5e63 100644 --- a/lib/Cake/Routing/Route/RedirectRoute.php +++ b/lib/Cake/Routing/Route/RedirectRoute.php @@ -113,7 +113,7 @@ class RedirectRoute extends CakeRoute { * Stop execution of the current script. Wraps exit() making * testing easier. * - * @param integer|string $status see http://php.net/exit for values + * @param integer|string $code See http://php.net/exit for values * @return void */ protected function _stop($code = 0) { diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php index 27fd10dbc..4e31081c8 100644 --- a/lib/Cake/Routing/Router.php +++ b/lib/Cake/Routing/Router.php @@ -636,7 +636,7 @@ class Router { /** * Parses a file extension out of a URL, if Router::parseExtensions() is enabled. * - * @param string $url + * @param string $url URL. * @return array Returns an array containing the altered URL and the parsed extension. */ protected static function _parseExtension($url) { diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/BasicAuthenticateTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/BasicAuthenticateTest.php index 0e0e8bf02..cd337cf08 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/BasicAuthenticateTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/BasicAuthenticateTest.php @@ -126,10 +126,35 @@ class BasicAuthenticateTest extends CakeTestCase { $_SERVER['PHP_AUTH_PW'] = "' OR 1 = 1"; $this->assertFalse($this->auth->getUser($request)); - $this->assertFalse($this->auth->authenticate($request, $this->response)); } +/** + * Test that username of 0 works. + * + * @return void + */ + public function testAuthenticateUsernameZero() { + $User = ClassRegistry::init('User'); + $User->updateAll(array('user' => $User->getDataSource()->value('0')), array('user' => 'mariano')); + + $request = new CakeRequest('posts/index', false); + $request->data = array('User' => array( + 'user' => '0', + 'password' => 'password' + )); + $_SERVER['PHP_AUTH_USER'] = '0'; + $_SERVER['PHP_AUTH_PW'] = 'password'; + + $expected = array( + 'id' => 1, + 'user' => '0', + 'created' => '2007-03-17 01:16:23', + 'updated' => '2007-03-17 01:18:31' + ); + $this->assertEquals($expected, $this->auth->authenticate($request, $this->response)); + } + /** * test that challenge headers are sent when no credentials are found. * diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticateTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticateTest.php index 90f5797c9..a8a17b2b8 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticateTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticateTest.php @@ -1,7 +1,5 @@ assertFalse($this->auth->authenticate($request, $this->response)); + $request->data = array( + 'User' => array( + 'user' => array(), + 'password' => 'my password' + )); + $this->assertFalse($this->auth->authenticate($request, $this->response)); + $request->data = array( 'User' => array( 'user' => 'mariano', @@ -226,6 +231,30 @@ class FormAuthenticateTest extends CakeTestCase { $this->assertFalse($this->auth->authenticate($request, $this->response)); } +/** + * Test that username of 0 works. + * + * @return void + */ + public function testAuthenticateUsernameZero() { + $User = ClassRegistry::init('User'); + $User->updateAll(array('user' => $User->getDataSource()->value('0')), array('user' => 'mariano')); + + $request = new CakeRequest('posts/index', false); + $request->data = array('User' => array( + 'user' => '0', + 'password' => 'password' + )); + + $expected = array( + 'id' => 1, + 'user' => '0', + 'created' => '2007-03-17 01:16:23', + 'updated' => '2007-03-17 01:18:31' + ); + $this->assertEquals($expected, $this->auth->authenticate($request, $this->response)); + } + /** * test a model in a plugin. * diff --git a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php index 6095e5de0..2dee4d95d 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php @@ -1745,7 +1745,7 @@ class HttpSocketTest extends CakeTestCase { $this->skipIf(!extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.'); $socket = new HttpSocket(); try { - $socket->get('https://typography.com'); + $socket->get('https://tv.eurosport.com/'); $this->markTestSkipped('Found valid certificate, was expecting invalid certificate.'); } catch (SocketException $e) { $message = $e->getMessage(); diff --git a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php index 375cf4d59..46c293d95 100644 --- a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php +++ b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php @@ -873,6 +873,23 @@ class CakeRouteTest extends CakeTestCase { $this->assertEquals($expected, $result); } +/** + * Test match() with trailing ** style routes. + * + * @return void + */ + public function testMatchTrailing() { + $route = new CakeRoute('/pages/**', array('controller' => 'pages', 'action' => 'display')); + $id = 'test/ spaces/漢字/la†în'; + $result = $route->match(array( + 'controller' => 'pages', + 'action' => 'display', + $id + )); + $expected = '/pages/test/%20spaces/%E6%BC%A2%E5%AD%97/la%E2%80%A0%C3%AEn'; + $this->assertEquals($expected, $result); + } + /** * test restructuring args with pass key * diff --git a/lib/Cake/Test/Case/Utility/HashTest.php b/lib/Cake/Test/Case/Utility/HashTest.php index 2ed9ffc7d..f85ac6a86 100644 --- a/lib/Cake/Test/Case/Utility/HashTest.php +++ b/lib/Cake/Test/Case/Utility/HashTest.php @@ -23,6 +23,11 @@ App::uses('Hash', 'Utility'); */ class HashTest extends CakeTestCase { +/** + * Data provider + * + * @return array + */ public static function articleData() { return array( array( @@ -136,6 +141,11 @@ class HashTest extends CakeTestCase { ); } +/** + * Data provider + * + * @return array + */ public static function userData() { return array( array( @@ -1021,7 +1031,7 @@ class HashTest extends CakeTestCase { * @return void */ public function testSort() { - $result = Hash::sort(array(), '{n}.name', 'asc'); + $result = Hash::sort(array(), '{n}.name'); $this->assertEquals(array(), $result); $a = array( @@ -1044,7 +1054,7 @@ class HashTest extends CakeTestCase { 'Friend' => array(array('name' => 'Nate')) ) ); - $a = Hash::sort($a, '{n}.Friend.{n}.name', 'asc'); + $a = Hash::sort($a, '{n}.Friend.{n}.name'); $this->assertEquals($a, $b); $b = array( @@ -1786,6 +1796,11 @@ class HashTest extends CakeTestCase { $this->assertEquals($expected, $result); } +/** + * testApply + * + * @return void + */ public function testApply() { $data = self::articleData(); @@ -1808,8 +1823,8 @@ class HashTest extends CakeTestCase { /** * testing method for map callbacks. * - * @param mixed $value - * @return mixed. + * @param mixed $value Value + * @return mixed */ public function mapCallback($value) { return $value * 2; @@ -1818,9 +1833,9 @@ class HashTest extends CakeTestCase { /** * testing method for reduce callbacks. * - * @param mixed $one - * @param mixed $two - * @return mixed. + * @param mixed $one First param + * @param mixed $two Second param + * @return mixed */ public function reduceCallback($one, $two) { return $one + $two; diff --git a/lib/Cake/Utility/Hash.php b/lib/Cake/Utility/Hash.php index 711b42f93..57531bcc3 100644 --- a/lib/Cake/Utility/Hash.php +++ b/lib/Cake/Utility/Hash.php @@ -800,12 +800,12 @@ class Hash { * * @param array $data An array of data to sort * @param string $path A Set-compatible path to the array value - * @param string $dir See directions above. + * @param string $dir See directions above. Defaults to 'asc'. * @param string $type See direction types above. Defaults to 'regular'. * @return array Sorted array of data * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::sort */ - public static function sort(array $data, $path, $dir, $type = 'regular') { + public static function sort(array $data, $path, $dir = 'asc', $type = 'regular') { if (empty($data)) { return array(); } diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index 165ad6681..ed27e4da4 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -224,7 +224,7 @@ class Helper extends Object { * Provides backwards compatibility access for setting values to the request object. * * @param string $name Name of the property being accessed. - * @param mixed $value + * @param mixed $value Value to set. * @return void * @deprecated This method will be removed in 3.0 */ @@ -299,7 +299,7 @@ class Helper extends Object { * Generate URL for given asset file. Depending on options passed provides full URL with domain name. * Also calls Helper::assetTimestamp() to add timestamp to local files * - * @param string|array Path string or URL array + * @param string|array $path Path string or URL array * @param array $options Options array. Possible keys: * `fullBase` Return full URL with domain name * `pathPrefix` Path prefix for relative URLs @@ -665,7 +665,7 @@ class Helper extends Object { * * @param array|string $options If an array, should be an array of attributes that $key needs to be added to. * If a string or null, will be used as the View entity. - * @param string $field + * @param string $field Field name. * @param string $key The name of the attribute to be set, defaults to 'name' * @return mixed If an array was given for $options, an array with $key set will be returned. * If a string was supplied a string will be returned. @@ -706,7 +706,7 @@ class Helper extends Object { * * @param array|string $options If an array, should be an array of attributes that $key needs to be added to. * If a string or null, will be used as the View entity. - * @param string $field + * @param string $field Field name. * @param string $key The name of the attribute to be set, defaults to 'value' * @return mixed If an array was given for $options, an array with $key set will be returned. * If a string was supplied a string will be returned. @@ -881,8 +881,8 @@ class Helper extends Object { * Transforms a recordset from a hasAndBelongsToMany association to a list of selected * options for a multiple select element * - * @param string|array $data - * @param string $key + * @param string|array $data Data array or model name. + * @param string $key Field name. * @return array */ protected function _selectedArray($data, $key = 'id') { diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php index e54d6b2cb..b725ca43e 100644 --- a/lib/Cake/View/Helper/CacheHelper.php +++ b/lib/Cake/View/Helper/CacheHelper.php @@ -64,7 +64,7 @@ class CacheHelper extends AppHelper { /** * Parses the view file and stores content for cache file building. * - * @param string $viewFile + * @param string $viewFile View file name. * @param string $output The output for the file. * @return string Updated content. */ @@ -77,7 +77,7 @@ class CacheHelper extends AppHelper { /** * Parses the layout file and stores content for cache file building. * - * @param string $layoutFile + * @param string $layoutFile Layout file name. * @return void */ public function afterLayout($layoutFile) { @@ -266,7 +266,8 @@ class CacheHelper extends AppHelper { * * @param string $content view content to write to a cache file. * @param string $timestamp Duration to set for cache file. - * @param boolean $useCallbacks + * @param boolean $useCallbacks Whether to include statements in cached file which + * run callbacks. * @return boolean success of caching view. */ protected function _writeFile($content, $timestamp, $useCallbacks = false) { diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 77ae39450..b5ae1564c 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -140,7 +140,7 @@ class FormHelper extends AppHelper { * Guess the location for a model based on its name and tries to create a new instance * or get an already created instance of the model * - * @param string $model + * @param string $model Model name. * @return Model model instance */ protected function _getModel($model) { @@ -254,7 +254,7 @@ class FormHelper extends AppHelper { /** * Returns if a field is required to be filled based on validation properties from the validating object. * - * @param CakeValidationSet $validationRules + * @param CakeValidationSet $validationRules Validation rules set. * @return boolean true if field is required to be filled, false otherwise */ protected function _isRequiredField($validationRules) { @@ -1107,7 +1107,7 @@ class FormHelper extends AppHelper { /** * Generates input options array * - * @param array $options + * @param array $options Options list. * @return array Options */ protected function _parseOptions($options) { @@ -1138,7 +1138,7 @@ class FormHelper extends AppHelper { /** * Generates list of options for multiple select * - * @param array $options + * @param array $options Options list. * @return array */ protected function _optionsOptions($options) { @@ -1162,7 +1162,7 @@ class FormHelper extends AppHelper { /** * Magically set option type and corresponding options * - * @param array $options + * @param array $options Options list. * @return array */ protected function _magicOptions($options) { @@ -1235,7 +1235,7 @@ class FormHelper extends AppHelper { /** * Generate format options * - * @param array $options + * @param array $options Options list. * @return array */ protected function _getFormat($options) { @@ -1254,8 +1254,8 @@ class FormHelper extends AppHelper { /** * Generate label for input * - * @param string $fieldName - * @param array $options + * @param string $fieldName Field name. + * @param array $options Options list. * @return boolean|string false or Generated label element */ protected function _getLabel($fieldName, $options) { @@ -1277,7 +1277,7 @@ class FormHelper extends AppHelper { /** * Calculates maxlength option * - * @param array $options + * @param array $options Options list. * @return array */ protected function _maxLength($options) { @@ -1299,7 +1299,7 @@ class FormHelper extends AppHelper { /** * Generate div options for input * - * @param array $options + * @param array $options Options list. * @return array */ protected function _divOptions($options) { @@ -1351,9 +1351,10 @@ class FormHelper extends AppHelper { * $options can contain a hash of id overrides. These overrides will be * used instead of the generated values if present. * - * @param string $fieldName - * @param string $label - * @param array $options Options for the label element. 'NONE' option is deprecated and will be removed in 3.0 + * @param string $fieldName Field name. + * @param string|array $label Label text or array with text and options. + * @param array $options Options for the label element. 'NONE' option is + * deprecated and will be removed in 3.0 * @return string Generated label element */ protected function _inputLabel($fieldName, $label, $options) { @@ -2668,9 +2669,9 @@ class FormHelper extends AppHelper { /** * Gets the input field name for the current tag * - * @param array $options - * @param string $field - * @param string $key + * @param array $options Options list. + * @param string $field Field name. + * @param string $key Key name. * @return array */ protected function _name($options = array(), $field = null, $key = 'name') { @@ -2710,10 +2711,10 @@ class FormHelper extends AppHelper { /** * Returns an array of formatted OPTION/OPTGROUP elements * - * @param array $elements - * @param array $parents - * @param boolean $showParents - * @param array $attributes + * @param array $elements Elements to format. + * @param array $parents Parents for OPTGROUP. + * @param boolean $showParents Whether to show parents. + * @param array $attributes HTML attributes. * @return array */ protected function _selectOptions($elements = array(), $parents = array(), $showParents = null, $attributes = array()) { @@ -2828,8 +2829,8 @@ class FormHelper extends AppHelper { /** * Generates option lists for common