From 62b83e6e3a7deea4a2c788196123acf772055a50 Mon Sep 17 00:00:00 2001 From: mscherer Date: Sat, 16 Jan 2016 16:06:00 +0100 Subject: [PATCH] Clean up the doc blocks around mixed. --- src/Controller/Component/AuthComponent.php | 8 ++++---- src/Controller/Controller.php | 4 ++-- src/Core/ClassLoader.php | 2 +- src/Core/Configure.php | 6 +++--- src/Core/Plugin.php | 2 +- src/Database/Connection.php | 2 +- src/Database/Driver/PDODriverTrait.php | 2 +- src/Database/Statement/BufferedStatement.php | 4 ++-- src/Database/Statement/CallbackStatement.php | 4 ++-- src/Database/Statement/StatementDecorator.php | 4 ++-- src/Database/StatementInterface.php | 2 +- src/Database/Type/BoolType.php | 2 +- src/Database/Type/IntegerType.php | 2 +- src/Database/Type/StringType.php | 2 +- src/Database/Type/UuidType.php | 6 +++--- src/Datasource/ConnectionManager.php | 10 +++++----- src/Error/Debugger.php | 2 +- src/Filesystem/File.php | 4 ++-- src/Filesystem/Folder.php | 4 ++-- src/I18n/Time.php | 7 ++++--- src/I18n/functions.php | 8 ++++---- src/Log/Engine/FileLog.php | 6 +++--- src/Log/Log.php | 4 ++-- src/Mailer/Email.php | 4 ++-- src/Network/Http/FormData/Part.php | 10 +++++----- src/Network/Request.php | 8 ++++---- src/Network/Response.php | 2 +- src/Network/Session.php | 2 +- src/Routing/Filter/ControllerFactoryFilter.php | 4 ++-- src/Routing/Route/InflectedRoute.php | 6 +++--- src/Routing/Route/PluginShortRoute.php | 8 ++++---- src/Routing/Route/RedirectRoute.php | 12 ++++++------ src/Routing/Route/Route.php | 2 +- src/Utility/Text.php | 2 +- src/View/Helper/FormHelper.php | 2 +- src/View/Helper/HtmlHelper.php | 6 +++--- src/View/Helper/NumberHelper.php | 2 +- src/View/Helper/PaginatorHelper.php | 4 ++-- src/View/Helper/TimeHelper.php | 2 +- src/View/View.php | 4 ++-- src/View/ViewBlock.php | 2 +- 41 files changed, 90 insertions(+), 89 deletions(-) diff --git a/src/Controller/Component/AuthComponent.php b/src/Controller/Component/AuthComponent.php index e6eda332137..166f8a31f5c 100644 --- a/src/Controller/Component/AuthComponent.php +++ b/src/Controller/Component/AuthComponent.php @@ -502,13 +502,13 @@ public function isAuthorized($user = null, Request $request = null) /** * Loads the authorization objects configured. * - * @return mixed Either null when authorize is empty, or the loaded authorization objects. + * @return array|null The loaded authorization objects, or null when authorize is empty. * @throws \Cake\Core\Exception\Exception */ public function constructAuthorize() { if (empty($this->_config['authorize'])) { - return; + return null; } $this->_authorizeObjects = []; $authorize = Hash::normalize((array)$this->_config['authorize']); @@ -782,7 +782,7 @@ public function identify() /** * Loads the configured authentication objects. * - * @return mixed either null on empty authenticate value, or an array of loaded objects. + * @return array|null The loaded authorization objects, or null on empty authenticate value. * @throws \Cake\Core\Exception\Exception */ public function constructAuthenticate() @@ -822,7 +822,7 @@ public function constructAuthenticate() * Get/set user record storage object. * * @param \Cake\Auth\Storage\StorageInterface|null $storage Sets provided - * object as storage or if null returns configuread storage object. + * object as storage or if null returns configured storage object. * @return \Cake\Auth\Storage\StorageInterface|null */ public function storage(StorageInterface $storage = null) diff --git a/src/Controller/Controller.php b/src/Controller/Controller.php index 84f74e1c884..8726764f33e 100644 --- a/src/Controller/Controller.php +++ b/src/Controller/Controller.php @@ -112,7 +112,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface * public $helpers = ['Form', 'Html', 'Time']; * ``` * - * @var mixed + * @var array * @link http://book.cakephp.org/3.0/en/controllers.html#configuring-helpers-to-load */ public $helpers = []; @@ -211,7 +211,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface /** * Holds all passed params. * - * @var mixed + * @var array * @deprecated 3.1.0 Use `$this->request->params['pass']` instead. */ public $passedArgs = []; diff --git a/src/Core/ClassLoader.php b/src/Core/ClassLoader.php index 88ff7421cb3..70a242e14cb 100644 --- a/src/Core/ClassLoader.php +++ b/src/Core/ClassLoader.php @@ -71,7 +71,7 @@ public function addNamespace($prefix, $baseDir, $prepend = false) * Loads the class file for a given class name. * * @param string $class The fully-qualified class name. - * @return mixed The mapped file name on success, or boolean false on + * @return string|bool The mapped file name on success, or boolean false on * failure. */ public function loadClass($class) diff --git a/src/Core/Configure.php b/src/Core/Configure.php index ad617c23504..0d792f6ca2c 100644 --- a/src/Core/Configure.php +++ b/src/Core/Configure.php @@ -281,7 +281,7 @@ public static function drop($name) * @param string $key name of configuration resource to load. * @param string $config Name of the configured engine to use to read the resource identified by $key. * @param bool $merge if config files should be merged instead of simply overridden - * @return mixed false if file not found, void if load successful. + * @return bool False if file not found, true if load successful. * @link http://book.cakephp.org/3.0/en/development/configuration.html#reading-and-writing-configuration-files */ public static function load($key, $config = 'default', $merge = true) @@ -325,7 +325,7 @@ public static function load($key, $config = 'default', $merge = true) * @param string $config The name of the configured adapter to dump data with. * @param array $keys The name of the top-level keys you want to dump. * This allows you save only some data stored in Configure. - * @return bool success + * @return bool Success * @throws \Cake\Core\Exception\Exception if the adapter does not implement a `dump` method. */ public static function dump($key, $config = 'default', $keys = []) @@ -346,7 +346,7 @@ public static function dump($key, $config = 'default', $keys = []) * Will create new PhpConfig for default if not configured yet. * * @param string $config The name of the configured adapter - * @return mixed Engine instance or false + * @return ConfigEngineInterface|bool Engine instance or false */ protected static function _getEngine($config) { diff --git a/src/Core/Plugin.php b/src/Core/Plugin.php index cc2aaaa9c36..5683b2c0a88 100644 --- a/src/Core/Plugin.php +++ b/src/Core/Plugin.php @@ -345,7 +345,7 @@ public static function routes($plugin = null) * If plugin is null, it will return a list of all loaded plugins * * @param string $plugin Plugin name. - * @return mixed boolean true if $plugin is already loaded. + * @return bool|array Boolean true if $plugin is already loaded. * If $plugin is null, returns a list of plugins that have been loaded */ public static function loaded($plugin = null) diff --git a/src/Database/Connection.php b/src/Database/Connection.php index fe82760f8a3..20e8f2d49c4 100644 --- a/src/Database/Connection.php +++ b/src/Database/Connection.php @@ -610,7 +610,7 @@ public function inTransaction() * * @param mixed $value The value to quote. * @param string $type Type to be used for determining kind of quoting to perform - * @return mixed quoted value + * @return String Quoted value */ public function quote($value, $type = null) { diff --git a/src/Database/Driver/PDODriverTrait.php b/src/Database/Driver/PDODriverTrait.php index da41f696679..0f9b0722029 100644 --- a/src/Database/Driver/PDODriverTrait.php +++ b/src/Database/Driver/PDODriverTrait.php @@ -56,7 +56,7 @@ protected function _connect($dsn, array $config) * result to the value passed * * @param null|\PDO $connection The PDO connection instance. - * @return mixed connection object used internally + * @return \PDO connection object used internally */ public function connection($connection = null) { diff --git a/src/Database/Statement/BufferedStatement.php b/src/Database/Statement/BufferedStatement.php index 1694ca5b59b..788a9f18090 100644 --- a/src/Database/Statement/BufferedStatement.php +++ b/src/Database/Statement/BufferedStatement.php @@ -78,7 +78,7 @@ public function execute($params = null) * {@inheritDoc} * * @param string $type The type to fetch. - * @return mixed + * @return array|bool */ public function fetch($type = 'num') { @@ -106,7 +106,7 @@ public function fetch($type = 'num') * {@inheritDoc} * * @param string $type The type to fetch. - * @return mixed + * @return array */ public function fetchAll($type = 'num') { diff --git a/src/Database/Statement/CallbackStatement.php b/src/Database/Statement/CallbackStatement.php index 1d88770d3f1..576bfc969b8 100644 --- a/src/Database/Statement/CallbackStatement.php +++ b/src/Database/Statement/CallbackStatement.php @@ -49,7 +49,7 @@ public function __construct($statement, $driver, $callback) * The result will be processed by the callback when it is not `false`. * * @param string $type Either 'num' or 'assoc' to indicate the result format you would like. - * @return mixed + * @return array|bool */ public function fetch($type = 'num') { @@ -64,7 +64,7 @@ public function fetch($type = 'num') * Each row in the result will be processed by the callback when it is not `false. * * @param string $type Either 'num' or 'assoc' to indicate the result format you would like. - * @return mixed + * @return array */ public function fetchAll($type = 'num') { diff --git a/src/Database/Statement/StatementDecorator.php b/src/Database/Statement/StatementDecorator.php index 5a0d39f5c52..6546cc8fb87 100644 --- a/src/Database/Statement/StatementDecorator.php +++ b/src/Database/Statement/StatementDecorator.php @@ -185,7 +185,7 @@ public function execute($params = null) * ``` * * @param string $type 'num' for positional columns, assoc for named columns - * @return mixed Result array containing columns and values or false if no results + * @return array|bool Result array containing columns and values or false if no results * are left */ public function fetch($type = 'num') @@ -205,7 +205,7 @@ public function fetch($type = 'num') * ``` * * @param string $type num for fetching columns as positional keys or assoc for column names as keys - * @return array list of all results from database for this statement + * @return array List of all results from database for this statement */ public function fetchAll($type = 'num') { diff --git a/src/Database/StatementInterface.php b/src/Database/StatementInterface.php index d44b80cc1aa..f12aeb9c9d1 100644 --- a/src/Database/StatementInterface.php +++ b/src/Database/StatementInterface.php @@ -107,7 +107,7 @@ public function execute($params = null); * ``` * * @param string $type 'num' for positional columns, assoc for named columns - * @return mixed Result array containing columns and values or false if no results + * @return array|bool Result array containing columns and values or false if no results * are left */ public function fetch($type = 'num'); diff --git a/src/Database/Type/BoolType.php b/src/Database/Type/BoolType.php index b457608f117..a37aeb748ad 100644 --- a/src/Database/Type/BoolType.php +++ b/src/Database/Type/BoolType.php @@ -85,7 +85,7 @@ public function toStatement($value, Driver $driver) * Marshalls request data into PHP booleans. * * @param mixed $value The value to convert. - * @return mixed Converted value. + * @return bool|null Converted value. */ public function marshal($value) { diff --git a/src/Database/Type/IntegerType.php b/src/Database/Type/IntegerType.php index e3c19f38f59..0d0d4d38809 100644 --- a/src/Database/Type/IntegerType.php +++ b/src/Database/Type/IntegerType.php @@ -78,7 +78,7 @@ public function toStatement($value, Driver $driver) * Marshalls request data into PHP floats. * * @param mixed $value The value to convert. - * @return mixed Converted value. + * @return int|null Converted value. */ public function marshal($value) { diff --git a/src/Database/Type/StringType.php b/src/Database/Type/StringType.php index 33bb49b322d..fac06be03c6 100644 --- a/src/Database/Type/StringType.php +++ b/src/Database/Type/StringType.php @@ -82,7 +82,7 @@ public function toStatement($value, Driver $driver) * Marshalls request data into PHP strings. * * @param mixed $value The value to convert. - * @return mixed Converted value. + * @return string|null Converted value. */ public function marshal($value) { diff --git a/src/Database/Type/UuidType.php b/src/Database/Type/UuidType.php index d7ccb0b711f..cf13832254f 100644 --- a/src/Database/Type/UuidType.php +++ b/src/Database/Type/UuidType.php @@ -20,7 +20,7 @@ use PDO; /** - * Provides behavior for the uuid type + * Provides behavior for the UUID type */ class UuidType extends StringType { @@ -30,7 +30,7 @@ class UuidType extends StringType * * @param mixed $value value to be converted to database equivalent * @param Driver $driver object from which database preferences and configuration will be extracted - * @return mixed + * @return string|null */ public function toDatabase($value, Driver $driver) { @@ -52,7 +52,7 @@ public function newId() } /** - * Marshalls request data into a PHP string + * Marshals request data into a PHP string * * @param mixed $value The value to convert. * @return string|null Converted value. diff --git a/src/Datasource/ConnectionManager.php b/src/Datasource/ConnectionManager.php index e434cbe5c0a..9d5e2c0089e 100644 --- a/src/Datasource/ConnectionManager.php +++ b/src/Datasource/ConnectionManager.php @@ -67,7 +67,7 @@ class ConnectionManager * * @param string|array $key The name of the connection config, or an array of multiple configs. * @param array $config An array of name => config data for adapter. - * @return mixed null when adding configuration and an array of configuration data when reading. + * @return array|null Null when adding configuration and an array of configuration data when reading. * @throws \Cake\Core\Exception\Exception When trying to modify an existing config. * @see \Cake\Core\StaticConfigTrait::config() */ @@ -99,9 +99,9 @@ public static function config($key, $config = null) * For all classes, the value of `scheme` is set as the value of both the `className` and `driver` * unless they have been otherwise specified. * - * Note that querystring arguments are also parsed and set as values in the returned configuration. + * Note that query-string arguments are also parsed and set as values in the returned configuration. * - * @param string $config The DSN string to convert to a configuration array + * @param string|null $config The DSN string to convert to a configuration array * @return array The configuration array to be stored after parsing the DSN */ public static function parseDsn($config = null) @@ -125,7 +125,7 @@ public static function parseDsn($config = null) * Set one or more connection aliases. * * Connection aliases allow you to rename active connections without overwriting - * the aliased connection. This is most useful in the testsuite for replacing + * the aliased connection. This is most useful in the test-suite for replacing * connections with their test variant. * * Defined aliases will take precedence over normal connection names. For example, @@ -169,7 +169,7 @@ public static function dropAlias($name) * * If the connection has not been constructed an instance will be added * to the registry. This method will use any aliases that have been - * defined. If you want the original unaliased connections pass `FALSE` + * defined. If you want the original unaliased connections pass `false` * as second parameter. * * @param string $name The connection name. diff --git a/src/Error/Debugger.php b/src/Error/Debugger.php index 3ee668a5cba..c85dcf7463c 100644 --- a/src/Error/Debugger.php +++ b/src/Error/Debugger.php @@ -585,7 +585,7 @@ protected static function _object($var, $depth, $indent) * * @param string|null $format The format you want errors to be output as. * Leave null to get the current format. - * @return mixed Returns null when setting. Returns the current format when getting. + * @return string|null Returns null when setting. Returns the current format when getting. * @throws \InvalidArgumentException When choosing a format that doesn't exist. */ public static function outputAs($format = null) diff --git a/src/Filesystem/File.php b/src/Filesystem/File.php index f266ae36676..cdd936ee0a8 100644 --- a/src/Filesystem/File.php +++ b/src/Filesystem/File.php @@ -143,7 +143,7 @@ public function open($mode = 'r', $force = false) * @param string|bool $bytes where to start * @param string $mode A `fread` compatible mode. * @param bool $force If true then the file will be re-opened even if its already opened, otherwise it won't - * @return mixed string on success, false on failure + * @return string|false string on success, false on failure */ public function read($bytes = false, $mode = 'rb', $force = false) { @@ -179,7 +179,7 @@ public function read($bytes = false, $mode = 'rb', $force = false) * * @param int|bool $offset The $offset in bytes to seek. If set to false then the current offset is returned. * @param int $seek PHP Constant SEEK_SET | SEEK_CUR | SEEK_END determining what the $offset is relative to - * @return mixed True on success, false on failure (set mode), false on failure or integer offset on success (get mode) + * @return int|bool True on success, false on failure (set mode), false on failure or integer offset on success (get mode) */ public function offset($offset = false, $seek = SEEK_SET) { diff --git a/src/Filesystem/Folder.php b/src/Filesystem/Folder.php index 0e3ec266f0b..cdac225453a 100644 --- a/src/Filesystem/Folder.php +++ b/src/Filesystem/Folder.php @@ -163,7 +163,7 @@ public function cd($path) * to false to get unsorted results. * @param array|bool $exceptions Either an array or boolean true will not grab dot files * @param bool $fullPath True returns the full path - * @return mixed Contents of current directory as an array, an empty array on failure + * @return array Contents of current directory as an array, an empty array on failure */ public function read($sort = true, $exceptions = false, $fullPath = false) { @@ -451,7 +451,7 @@ public function chmod($path, $mode = false, $recursive = true, array $exceptions * @param array|bool $exceptions Either an array of files/folder to exclude * or boolean true to not grab dot files/folders * @param string|null $type either 'file' or 'dir'. Null returns both files and directories - * @return mixed array of nested directories and files in each directory + * @return array Array of nested directories and files in each directory */ public function tree($path = null, $exceptions = false, $type = null) { diff --git a/src/I18n/Time.php b/src/I18n/Time.php index 3f4935ebfd6..92848b0ed08 100644 --- a/src/I18n/Time.php +++ b/src/I18n/Time.php @@ -14,6 +14,7 @@ */ namespace Cake\I18n; +use Cake\Core\Exception\Exception; use Carbon\Carbon; use DateTime; use DateTimeZone; @@ -192,7 +193,7 @@ public function isThisYear() * Returns the quarter * * @param bool $range Range. - * @return mixed 1, 2, 3, or 4 quarter of year or array if $range true + * @return int|array 1, 2, 3, or 4 quarter of year, or array if $range true */ public function toQuarter($range = false) { @@ -241,8 +242,8 @@ public function toUnixString() * - minute => The format if minutes > 0 (default "minute") * - second => The format if seconds > 0 (default "second") * - `end` => The end of relative time telling - * - `relativeString` => The printf compatible string when outputting relative time - * - `absoluteString` => The printf compatible string when outputting absolute time + * - `relativeString` => The `printf` compatible string when outputting relative time + * - `absoluteString` => The `printf` compatible string when outputting absolute time * - `timezone` => The user timezone the timestamp should be formatted in. * * Relative dates look something like this: diff --git a/src/I18n/functions.php b/src/I18n/functions.php index a5157b5a7e8..a89efe8903c 100644 --- a/src/I18n/functions.php +++ b/src/I18n/functions.php @@ -20,13 +20,13 @@ * * @param string $singular Text to translate. * @param mixed $args Array with arguments or multiple arguments in function. - * @return mixed Translated string. + * @return string|null The translated text, or null if invalid. * @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__ */ function __($singular, $args = null) { if (!$singular) { - return; + return null; } $arguments = func_num_args() === 2 ? (array)$args : array_slice(func_get_args(), 1); @@ -44,13 +44,13 @@ function __($singular, $args = null) * @param string $plural Plural text. * @param int $count Count. * @param mixed $args Array with arguments or multiple arguments in function. - * @return mixed Plural form of translated string. + * @return string|null Plural form of translated string, or null if invalid. * @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__n */ function __n($singular, $plural, $count, $args = null) { if (!$singular) { - return; + return null; } $arguments = func_num_args() === 4 ? (array)$args : array_slice(func_get_args(), 3); diff --git a/src/Log/Engine/FileLog.php b/src/Log/Engine/FileLog.php index 7d84c346e7b..cc86e93a801 100644 --- a/src/Log/Engine/FileLog.php +++ b/src/Log/Engine/FileLog.php @@ -178,8 +178,8 @@ protected function _getFilename($level) * Also if `rotate` count is reached oldest file is removed. * * @param string $filename Log file name - * @return mixed True if rotated successfully or false in case of error. - * Void if file doesn't need to be rotated. + * @return bool|null True if rotated successfully or false in case of error. + * Null if file doesn't need to be rotated. */ protected function _rotateFile($filename) { @@ -189,7 +189,7 @@ protected function _rotateFile($filename) if (!file_exists($filepath) || filesize($filepath) < $this->_size ) { - return; + return null; } $rotate = $this->_config['rotate']; diff --git a/src/Log/Log.php b/src/Log/Log.php index 36cfb6d2c7d..6132dc8e6b0 100644 --- a/src/Log/Log.php +++ b/src/Log/Log.php @@ -273,7 +273,7 @@ public static function levels() * * @param string|array $key The name of the logger config, or an array of multiple configs. * @param array|null $config An array of name => config data for adapter. - * @return mixed null when adding configuration and an array of configuration data when reading. + * @return array|null Null when adding configuration and an array of configuration data when reading. * @throws \BadMethodCallException When trying to modify an existing config. */ public static function config($key, $config = null) @@ -289,7 +289,7 @@ public static function config($key, $config = null) * Get a logging engine. * * @param string $name Key name of a configured adapter to get. - * @return mixed Instance of BaseLog or false if not found + * @return \Cake\Log\Engine\BaseLog|false Instance of BaseLog or false if not found */ public static function engine($name) { diff --git a/src/Mailer/Email.php b/src/Mailer/Email.php index f1008443024..18e85ebd8ad 100644 --- a/src/Mailer/Email.php +++ b/src/Mailer/Email.php @@ -1201,7 +1201,7 @@ public function message($type = null) * an array of multiple transports to set. * @param array|AbstractTransport|null $config Either an array of configuration * data, or a transport instance. - * @return mixed Either null when setting or an array of data when reading. + * @return array|null Either null when setting or an array of data when reading. * @throws \BadMethodCallException When modifying an existing configuration. */ public static function configTransport($key, $config = null) @@ -1213,7 +1213,7 @@ public static function configTransport($key, $config = null) foreach ($key as $name => $settings) { static::configTransport($name, $settings); } - return; + return null; } if (isset(static::$_transportConfig[$key])) { throw new BadMethodCallException(sprintf('Cannot modify an existing config "%s"', $key)); diff --git a/src/Network/Http/FormData/Part.php b/src/Network/Http/FormData/Part.php index 8a01bb875c7..cd25d389535 100644 --- a/src/Network/Http/FormData/Part.php +++ b/src/Network/Http/FormData/Part.php @@ -93,7 +93,7 @@ public function __construct($name, $value, $disposition = 'form-data') * header from being added. * * @param null|string $disposition Use null to get/string to set. - * @return mixed + * @return string|null */ public function disposition($disposition = null) { @@ -107,7 +107,7 @@ public function disposition($disposition = null) * Get/set the contentId for a part. * * @param null|string $id The content id. - * @return mixed + * @return string|null */ public function contentId($id = null) { @@ -124,7 +124,7 @@ public function contentId($id = null) * generated output. * * @param null|string $filename Use null to get/string to set. - * @return mixed + * @return string|null */ public function filename($filename = null) { @@ -138,7 +138,7 @@ public function filename($filename = null) * Get/set the content type. * * @param null|string $type Use null to get/string to set. - * @return mixed + * @return string|null */ public function type($type) { @@ -154,7 +154,7 @@ public function type($type) * Useful when content bodies are in encodings like base64. * * @param null|string $type The type of encoding the value has. - * @return mixed + * @return string|null */ public function transferEncoding($type) { diff --git a/src/Network/Request.php b/src/Network/Request.php index 81c2af228f9..f0bab35d9fb 100644 --- a/src/Network/Request.php +++ b/src/Network/Request.php @@ -886,7 +886,7 @@ public function here($base = true) * Read an HTTP header from the Request information. * * @param string $name Name of the header you want. - * @return mixed Either null on no header being set or the value of the header. + * @return string|null Either null on no header being set or the value of the header. */ public function header($name) { @@ -1000,7 +1000,7 @@ public function subdomains($tldLength = 1) * by the client. * * @param string|null $type The content type to check for. Leave null to get all types a client accepts. - * @return mixed Either an array of all the types the client accepts or a boolean if they accept the + * @return array|bool Either an array of all the types the client accepts or a boolean if they accept the * provided type. */ public function accepts($type = null) @@ -1042,7 +1042,7 @@ public function parseAccept() * ``` \Cake\Network\Request::acceptLanguage('es-es'); ``` * * @param string|null $language The language to test. - * @return mixed If a $language is provided, a boolean. Otherwise the array of accepted languages. + * @return array|bool If a $language is provided, a boolean. Otherwise the array of accepted languages. */ public function acceptLanguage($language = null) { @@ -1156,7 +1156,7 @@ public function data($name = null) * Safely access the values in $this->params. * * @param string $name The name of the parameter to get. - * @return mixed The value of the provided parameter. Will + * @return mixed|$this The value of the provided parameter. Will * return false if the parameter doesn't exist or is falsey. */ public function param($name) diff --git a/src/Network/Response.php b/src/Network/Response.php index c02c0746e14..f69d7657d2a 100644 --- a/src/Network/Response.php +++ b/src/Network/Response.php @@ -797,7 +797,7 @@ public function getMimeType($alias) * e.g `mapType('application/pdf'); // returns 'pdf'` * * @param string|array $ctype Either a string content type to map, or an array of types. - * @return mixed Aliases for the types provided. + * @return string|array|null Aliases for the types provided. */ public function mapType($ctype) { diff --git a/src/Network/Session.php b/src/Network/Session.php index 698ed61988d..794f4210f3f 100644 --- a/src/Network/Session.php +++ b/src/Network/Session.php @@ -372,7 +372,7 @@ public function check($name = null) * Returns given session variable, or all of them, if no parameters given. * * @param string|null $name The name of the session variable (or a path as sent to Hash.extract) - * @return mixed The value of the session variable, null if session not available, + * @return string|null The value of the session variable, null if session not available, * session not started, or provided name not found in the session. */ public function read($name = null) diff --git a/src/Routing/Filter/ControllerFactoryFilter.php b/src/Routing/Filter/ControllerFactoryFilter.php index dcb7fdeb712..82bd3149769 100644 --- a/src/Routing/Filter/ControllerFactoryFilter.php +++ b/src/Routing/Filter/ControllerFactoryFilter.php @@ -51,11 +51,11 @@ public function beforeDispatch(Event $event) } /** - * Get controller to use, either plugin controller or application controller + * Gets controller to use, either plugin or application controller. * * @param \Cake\Network\Request $request Request object * @param \Cake\Network\Response $response Response for the controller. - * @return mixed name of controller if not loaded, or object if loaded + * @return \Cake\Controller\Controller|bool Object if loaded, bool false otherwise. */ protected function _getController($request, $response) { diff --git a/src/Routing/Route/InflectedRoute.php b/src/Routing/Route/InflectedRoute.php index 0323d19b18d..fe4730bf7dd 100644 --- a/src/Routing/Route/InflectedRoute.php +++ b/src/Routing/Route/InflectedRoute.php @@ -35,10 +35,10 @@ class InflectedRoute extends Route /** * Parses a string URL into an array. If it matches, it will convert the prefix, controller and - * plugin keys to their camelized form + * plugin keys to their camelized form. * * @param string $url The URL to parse - * @return mixed false on failure, or an array of request parameters + * @return array|bool false on failure, or an array of request parameters */ public function parse($url) { @@ -63,7 +63,7 @@ public function parse($url) * @param array $context An array of the current request context. * Contains information such as the current host, scheme, port, and base * directory. - * @return mixed either false or a string URL. + * @return string|false Either a string URL for the parameters if they match or false. */ public function match(array $url, array $context = []) { diff --git a/src/Routing/Route/PluginShortRoute.php b/src/Routing/Route/PluginShortRoute.php index 7e54f3af905..0b4317b9891 100644 --- a/src/Routing/Route/PluginShortRoute.php +++ b/src/Routing/Route/PluginShortRoute.php @@ -24,10 +24,10 @@ class PluginShortRoute extends InflectedRoute /** * Parses a string URL into an array. If a plugin key is found, it will be copied to the - * controller parameter + * controller parameter. * * @param string $url The URL to parse - * @return mixed false on failure, or an array of request parameters + * @return array|bool An array of request parameters, or boolean false on failure. */ public function parse($url) { @@ -40,14 +40,14 @@ public function parse($url) } /** - * Reverse route plugin shortcut URLs. If the plugin and controller + * Reverses route plugin shortcut URLs. If the plugin and controller * are not the same the match is an auto fail. * * @param array $url Array of parameters to convert to a string. * @param array $context An array of the current request context. * Contains information such as the current host, scheme, port, and base * directory. - * @return mixed either false or a string URL. + * @return string|bool Either a string URL for the parameters if they match or false. */ public function match(array $url, array $context = []) { diff --git a/src/Routing/Route/RedirectRoute.php b/src/Routing/Route/RedirectRoute.php index 2a45bc4dd3f..de81b8eeb81 100644 --- a/src/Routing/Route/RedirectRoute.php +++ b/src/Routing/Route/RedirectRoute.php @@ -36,7 +36,7 @@ class RedirectRoute extends Route /** * The location to redirect to. Either a string or a CakePHP array URL. * - * @var mixed + * @var array|string */ public $redirect; @@ -58,10 +58,10 @@ public function __construct($template, $defaults = [], array $options = []) /** * Parses a string URL into an array. Parsed URLs will result in an automatic - * redirection + * redirection. * - * @param string $url The URL to parse - * @return bool False on failure + * @param string $url The URL to parse. + * @return bool|null False on failure, null otherwise. */ public function parse($url) { @@ -100,11 +100,11 @@ public function parse($url) } /** - * There is no reverse routing redirection routes + * There is no reverse routing redirection routes. * * @param array $url Array of parameters to convert to a string. * @param array $context Array of request context parameters. - * @return mixed either false or a string url. + * @return bool Always false. */ public function match(array $url, array $context = []) { diff --git a/src/Routing/Route/Route.php b/src/Routing/Route/Route.php index 9d91795fd3e..2694eeaab0e 100644 --- a/src/Routing/Route/Route.php +++ b/src/Routing/Route/Route.php @@ -406,7 +406,7 @@ protected function _persistParams(array $url, array $params) * @param array $context An array of the current request context. * Contains information such as the current host, scheme, port, base * directory and other url params. - * @return mixed Either a string url for the parameters if they match or false. + * @return string|false Either a string URL for the parameters if they match or false. */ public function match(array $url, array $context = []) { diff --git a/src/Utility/Text.php b/src/Utility/Text.php index 4c36e644068..2f980fde804 100644 --- a/src/Utility/Text.php +++ b/src/Utility/Text.php @@ -63,7 +63,7 @@ public static function uuid() * @param string $separator The token to split the data on. * @param string $leftBound The left boundary to ignore separators in. * @param string $rightBound The right boundary to ignore separators in. - * @return mixed Array of tokens in $data or original input if empty. + * @return array|string Array of tokens in $data or original input if empty. */ public static function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')') { diff --git a/src/View/Helper/FormHelper.php b/src/View/Helper/FormHelper.php index db805b306ad..a8002b56230 100644 --- a/src/View/Helper/FormHelper.php +++ b/src/View/Helper/FormHelper.php @@ -579,7 +579,7 @@ public function secure(array $fields = [], array $secureAttributes = []) * it from the list of fields. * * @param string|null $name The dot separated name for the field. - * @return mixed Either null, or the list of fields. + * @return array|null Either null, or the list of fields. * @link http://book.cakephp.org/3.0/en/views/helpers/form.html#working-with-securitycomponent */ public function unlockField($name = null) diff --git a/src/View/Helper/HtmlHelper.php b/src/View/Helper/HtmlHelper.php index ed17c4c861a..f874cb479cc 100644 --- a/src/View/Helper/HtmlHelper.php +++ b/src/View/Helper/HtmlHelper.php @@ -507,7 +507,7 @@ public function css($path, array $options = []) * * @param string|array $url String or array of javascript files to include * @param array $options Array of options, and html attributes see above. - * @return mixed String of `