diff --git a/lib/Cake/Controller/Component/Auth/DigestAuthenticate.php b/lib/Cake/Controller/Component/Auth/DigestAuthenticate.php index 068a7c09c..8dafb16e9 100644 --- a/lib/Cake/Controller/Component/Auth/DigestAuthenticate.php +++ b/lib/Cake/Controller/Component/Auth/DigestAuthenticate.php @@ -156,7 +156,7 @@ class DigestAuthenticate extends BasicAuthenticate { * Parse the digest authentication headers and split them up. * * @param string $digest The raw digest authentication headers. - * @return array An array of digest authentication headers + * @return array|null An array of digest authentication headers */ public function parseAuthData($digest) { if (substr($digest, 0, 7) === 'Digest ') { diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index b2730a56f..165dee00c 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -648,7 +648,7 @@ class AuthComponent extends Component { * cookies + sessions will be used. * * @param string $key field to retrieve. Leave null to get entire User record - * @return mixed User record. or null if no user is logged in. + * @return array|null User record. or null if no user is logged in. * @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#accessing-the-logged-in-user */ public static function user($key = null) { diff --git a/lib/Cake/Controller/Component/CookieComponent.php b/lib/Cake/Controller/Component/CookieComponent.php index fb5e4c38c..6ed908d55 100644 --- a/lib/Cake/Controller/Component/CookieComponent.php +++ b/lib/Cake/Controller/Component/CookieComponent.php @@ -262,7 +262,7 @@ class CookieComponent extends Component { * $this->Cookie->read(Name.key); * * @param string $key Key of the value to be obtained. If none specified, obtain map key => values - * @return string or null, value for specified key + * @return string|null Value for specified key * @link http://book.cakephp.org/2.0/en/core-libraries/components/cookie.html#CookieComponent::read */ public function read($key = null) { diff --git a/lib/Cake/Controller/Component/EmailComponent.php b/lib/Cake/Controller/Component/EmailComponent.php index 9301ed883..799baaca8 100644 --- a/lib/Cake/Controller/Component/EmailComponent.php +++ b/lib/Cake/Controller/Component/EmailComponent.php @@ -405,7 +405,7 @@ class EmailComponent extends Component { * Find the specified attachment in the list of file paths * * @param string $attachment Attachment file name to find - * @return string Path to located file + * @return string|null Path to located file */ protected function _findFiles($attachment) { if (file_exists($attachment)) { diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php index ed8f1454e..9d5581487 100644 --- a/lib/Cake/Controller/Component/RequestHandlerComponent.php +++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php @@ -162,7 +162,7 @@ class RequestHandlerComponent extends Component { $accepts = $this->response->mapType($accept); $preferedTypes = current($accepts); if (array_intersect($preferedTypes, array('html', 'xhtml'))) { - return null; + return; } $extensions = Router::extensions(); @@ -724,7 +724,7 @@ class RequestHandlerComponent extends Component { * Maps a content type alias back to its mime-type(s) * * @param string|array $alias String alias to convert back into a content type. Or an array of aliases to map. - * @return string Null on an undefined alias. String value of the mapped alias type. If an + * @return string|null Null on an undefined alias. String value of the mapped alias type. If an * alias maps to more than one content type, the first one will be returned. */ public function mapAlias($alias) { diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php index 4e05be5f3..820cf43ab 100644 --- a/lib/Cake/Controller/Component/SecurityComponent.php +++ b/lib/Cake/Controller/Component/SecurityComponent.php @@ -355,7 +355,7 @@ class SecurityComponent extends Component { * Check if HTTP methods are required * * @param Controller $controller Instantiating controller - * @return bool true if $method is required + * @return bool|null True if $method is required */ protected function _methodsRequired(Controller $controller) { foreach (array('Post', 'Get', 'Put', 'Delete') as $method) { @@ -378,7 +378,7 @@ class SecurityComponent extends Component { * Check if access requires secure connection * * @param Controller $controller Instantiating controller - * @return bool true if secure connection required + * @return bool|null True if secure connection required */ protected function _secureRequired(Controller $controller) { if (is_array($this->requireSecure) && !empty($this->requireSecure)) { @@ -399,7 +399,7 @@ class SecurityComponent extends Component { * Check if authentication is required * * @param Controller $controller Instantiating controller - * @return bool true if authentication required + * @return bool|null True if authentication required */ protected function _authRequired(Controller $controller) { if (is_array($this->requireAuth) && !empty($this->requireAuth) && !empty($this->request->data)) { diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index c92467b05..8925f2dea 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -1017,7 +1017,7 @@ class Controller extends Object implements CakeEventListener { * @param string $bool SQL boolean operator: AND, OR, XOR, etc. * @param bool $exclusive If true, and $op is an array, fields not included in $op will not be * included in the returned conditions - * @return array An array of model conditions + * @return array|null An array of model conditions * @deprecated 3.0.0 Will be removed in 3.0. */ public function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive = false) { diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index bb8369c25..ff8fe4c9e 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -575,7 +575,7 @@ class App { * Returns the package name where a class was defined to be located at * * @param string $className name of the class to obtain the package name from - * @return string package name or null if not declared + * @return string|null Package name, or null if not declared * @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::location */ public static function location($className) { diff --git a/lib/Cake/I18n/Multibyte.php b/lib/Cake/I18n/Multibyte.php index 794ea5e78..61c5175a1 100644 --- a/lib/Cake/I18n/Multibyte.php +++ b/lib/Cake/I18n/Multibyte.php @@ -824,7 +824,7 @@ class Multibyte { * * @param int $char decimal value of character * @param string $type Type 'lower' or 'upper'. Defaults to 'lower'. - * @return array + * @return array|null */ protected static function _find($char, $type = 'lower') { $found = array(); diff --git a/lib/Cake/Model/Behavior/AclBehavior.php b/lib/Cake/Model/Behavior/AclBehavior.php index eab610bdc..381e6ae8a 100644 --- a/lib/Cake/Model/Behavior/AclBehavior.php +++ b/lib/Cake/Model/Behavior/AclBehavior.php @@ -73,7 +73,7 @@ class AclBehavior extends ModelBehavior { * @param Model $model Model using this behavior. * @param string|array|Model $ref Array with 'model' and 'foreign_key', model object, or string value * @param string $type Only needed when Acl is set up as 'both', specify 'Aro' or 'Aco' to get the correct node - * @return array + * @return array|null * @link http://book.cakephp.org/2.0/en/core-libraries/behaviors/acl.html#node */ public function node(Model $model, $ref = null, $type = null) { diff --git a/lib/Cake/Model/Behavior/TreeBehavior.php b/lib/Cake/Model/Behavior/TreeBehavior.php index 9e1633f4f..3bd0991ea 100644 --- a/lib/Cake/Model/Behavior/TreeBehavior.php +++ b/lib/Cake/Model/Behavior/TreeBehavior.php @@ -443,7 +443,7 @@ class TreeBehavior extends ModelBehavior { * @param int|string $id The ID of the record to read * @param string|array $fields Either a single string of a field name, or an array of field names * @param int $recursive The number of levels deep to fetch associated records - * @return array Array of nodes from top most parent to current node + * @return array|null Array of nodes from top most parent to current node * @link http://book.cakephp.org/2.0/en/core-libraries/behaviors/tree.html#TreeBehavior::getPath */ public function getPath(Model $Model, $id = null, $fields = null, $recursive = null) { diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php index f2ad056dc..26a637b39 100644 --- a/lib/Cake/Model/ConnectionManager.php +++ b/lib/Cake/Model/ConnectionManager.php @@ -126,7 +126,7 @@ class ConnectionManager { * Gets a DataSource name from an object reference. * * @param DataSource $source DataSource object - * @return string Datasource name, or null if source is not present + * @return string|null Datasource name, or null if source is not present * in the ConnectionManager. */ public static function getSourceName($source) { @@ -145,8 +145,8 @@ class ConnectionManager { * Loads the DataSource class for the given connection name * * @param string|array $connName A string name of the connection, as defined in app/Config/database.php, - * or an array containing the filename (without extension) and class name of the object, - * to be found in app/Model/Datasource/ or lib/Cake/Model/Datasource/. + * or an array containing the filename (without extension) and class name of the object, + * to be found in app/Model/Datasource/ or lib/Cake/Model/Datasource/. * @return bool True on success, null on failure or false if the class is already loaded * @throws MissingDatasourceException */ @@ -184,10 +184,10 @@ class ConnectionManager { } /** - * Return a list of connections + * Returns a list of connections * * @return array An associative array of elements where the key is the connection name - * (as defined in Connections), and the value is an array with keys 'filename' and 'classname'. + * (as defined in Connections), and the value is an array with keys 'filename' and 'classname'. */ public static function enumConnectionObjects() { if (empty(self::$_init)) { @@ -201,7 +201,7 @@ class ConnectionManager { * * @param string $name The DataSource name * @param array $config The DataSource configuration settings - * @return DataSource A reference to the DataSource object, or null if creation failed + * @return DataSource|null A reference to the DataSource object, or null if creation failed */ public static function create($name = '', $config = array()) { if (empty(self::$_init)) { diff --git a/lib/Cake/Model/Datasource/DataSource.php b/lib/Cake/Model/Datasource/DataSource.php index d0bbcce7a..e77df4f8e 100644 --- a/lib/Cake/Model/Datasource/DataSource.php +++ b/lib/Cake/Model/Datasource/DataSource.php @@ -90,7 +90,7 @@ class DataSource extends Object { * Caches/returns cached results for child instances * * @param mixed $data Unused in this class. - * @return array Array of sources available in this datasource. + * @return array|null Array of sources available in this datasource. */ public function listSources($data = null) { if ($this->cacheSources === false) { @@ -117,7 +117,7 @@ class DataSource extends Object { * Returns a Model description (metadata) or null if none found. * * @param Model|string $model The model to describe. - * @return array Array of Metadata for the $model + * @return array|null Array of Metadata for the $model */ public function describe($model) { if ($this->cacheSources === false) { @@ -407,14 +407,14 @@ class DataSource extends Object { /** * Returns the schema name. Override this in subclasses. * - * @return string schema name + * @return string|null The schema name */ public function getSchemaName() { return null; } /** - * Closes a connection. Override in subclasses + * Closes a connection. Override in subclasses. * * @return bool */ diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index cf112057e..0fb440b60 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -1381,7 +1381,7 @@ class Model extends Object implements CakeEventListener { * $field => keys(type, null, default, key, length, extra) * * @param bool|string $field Set to true to reload schema, or a string to return a specific field - * @return array Array of table metadata + * @return array|null Array of table metadata */ public function schema($field = false) { if ($this->useTable !== false && (!is_array($this->_schema) || $field === true)) { @@ -1684,7 +1684,7 @@ class Model extends Object implements CakeEventListener { * If a boolean, indicates whether or not to validate before saving. * If an array, allows control of 'validate', 'callbacks' and 'counterCache' options. * See Model::save() for details of each options. - * @return bool See Model::save() + * @return bool|array See Model::save() False on failure or an array of model data on success. * @see Model::save() * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-savefield-string-fieldname-string-fieldvalue-validate-false */ @@ -2972,7 +2972,7 @@ class Model extends Object implements CakeEventListener { * * @param string $type Type of find operation (all / first / count / neighbors / list / threaded) * @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks) - * @return array Array of records, or Null on failure. + * @return array|null Array of records, or Null on failure. * @link http://book.cakephp.org/2.0/en/models/retrieving-your-data.html */ public function find($type = 'first', $query = array()) { @@ -3031,7 +3031,7 @@ class Model extends Object implements CakeEventListener { * * @param string $type Type of find operation (all / first / count / neighbors / list / threaded) * @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks) - * @return array Query array or null if it could not be build for some reasons + * @return array|null Query array or null if it could not be build for some reasons * @see Model::find() */ public function buildQuery($type = 'first', $query = array()) { @@ -3650,7 +3650,7 @@ class Model extends Object implements CakeEventListener { * Gets all the models with which this model is associated. * * @param string $type Only result associations of this type - * @return array Associations + * @return array|null Associations */ public function getAssociated($type = null) { if (!$type) { diff --git a/lib/Cake/Model/ModelValidator.php b/lib/Cake/Model/ModelValidator.php index 1c8ea248b..6b8de8e58 100644 --- a/lib/Cake/Model/ModelValidator.php +++ b/lib/Cake/Model/ModelValidator.php @@ -318,7 +318,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable { * params are passed then it returns an array with all CakeValidationSet objects for each field * * @param string $name [optional] The fieldname to fetch. Defaults to null. - * @return CakeValidationSet|array + * @return CakeValidationSet|array|null */ public function getField($name = null) { $this->_parseRules(); diff --git a/lib/Cake/Model/Validator/CakeValidationRule.php b/lib/Cake/Model/Validator/CakeValidationRule.php index 7d19fad7f..3a58e5a5c 100644 --- a/lib/Cake/Model/Validator/CakeValidationRule.php +++ b/lib/Cake/Model/Validator/CakeValidationRule.php @@ -300,7 +300,7 @@ class CakeValidationRule { * Returns passed options for this rule * * @param string|int $key Array index - * @return array + * @return array|null */ public function getOptions($key) { if (!isset($this->_passedOptions[$key])) { diff --git a/lib/Cake/Network/CakeSocket.php b/lib/Cake/Network/CakeSocket.php index f0ad49c62..55c459981 100644 --- a/lib/Cake/Network/CakeSocket.php +++ b/lib/Cake/Network/CakeSocket.php @@ -238,7 +238,7 @@ class CakeSocket { /** * Get the last error as a string. * - * @return string Last error + * @return string|null Last error */ public function lastError() { if (!empty($this->lastError)) { diff --git a/lib/Cake/Network/Http/HttpSocket.php b/lib/Cake/Network/Http/HttpSocket.php index bef5f6c0d..e9a43d495 100644 --- a/lib/Cake/Network/Http/HttpSocket.php +++ b/lib/Cake/Network/Http/HttpSocket.php @@ -420,7 +420,8 @@ class HttpSocket extends CakeSocket { } if ($this->request['redirect'] && $this->response->isRedirect()) { - $request['uri'] = trim(urldecode($this->response->getHeader('Location')), '='); + $location = trim($this->response->getHeader('Location'), '='); + $request['uri'] = str_replace('%2F', '/', $location); $request['redirect'] = is_int($this->request['redirect']) ? $this->request['redirect'] - 1 : $this->request['redirect']; $this->response = $this->request($request); } diff --git a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php index 94fedd1b0..1b56f9881 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php @@ -790,7 +790,7 @@ class HttpSocketTest extends CakeTestCase { 'uri' => 'http://localhost/oneuri', 'redirect' => 1 ); - $serverResponse1 = "HTTP/1.x 302 Found\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\nLocation: http://i.cmpnet.com%2Ftechonline%2Fpdf%2Fa.pdf=\r\n\r\n"; + $serverResponse1 = "HTTP/1.x 302 Found\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\nLocation: http://i.cmpnet.com%2Ftechonline%2Fpdf%2Fa+b.pdf=\r\n\r\n"; $serverResponse2 = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n