@@ -417,16 +417,13 @@ class FileEngine extends CacheEngine
}
/**
- * Generates a safe key for use with cache engine storage engines.
- *
- * @param string $key the key passed over
- * @return mixed string $key or false
+ * @inheritDoc
*/
protected function _key($key)
{
$key = parent::_key($key);
- if (preg_match('/[\/\\<>?:|*"]/', (string)$key)) {
+ if (preg_match('/[\/\\<>?:|*"]/', $key)) {
throw new InvalidArgumentException(
"Cache key `{$key}` contains invalid characters. " .
'You cannot use /, \\, <, >, ?, :, |, *, or " in cache keys.'
@@ -377,7 +377,7 @@ class RequestHandlerComponent extends Component
*
* @param string|array|null $type An optional array of 'friendly' content-type names, i.e.
* 'html', 'xml', 'js', etc.
- * @return mixed If $type is null or not provided, the first content-type in the
+ * @return string|bool|null If $type is null or not provided, the first content-type in the
* list, based on preference, is returned. If a single type is provided
* a boolean will be returned if that type is preferred.
* If an array of types are provided then the first preferred type is returned.
@@ -97,7 +97,7 @@ class ClassLoader
* @param string $prefix The namespace prefix.
* @param string $relativeClass The relative class name.
- * @return mixed Boolean false if no mapped file can be loaded, or the
+ * @return string|false Boolean false if no mapped file can be loaded, or the
* name of the mapped file that was loaded.
protected function _loadMappedFile(string $prefix, string $relativeClass)
@@ -288,7 +288,7 @@ class RulesChecker
* @param \Cake\Datasource\EntityInterface $entity The entity to check for validity.
* @param array $options Extra options to pass to checker functions.
- * @param array $rules The list of rules that must be checked.
+ * @param callable[] $rules The list of rules that must be checked.
* @return bool
protected function _checkRules(EntityInterface $entity, array $options = [], array $rules = []): bool
@@ -753,7 +753,7 @@ class EagerLoader
* Helper function used to return the keys from the query records that will be used
* to eagerly load associations.
- * @param array $external the list of external associations to be loaded
+ * @param \Cake\ORM\EagerLoadable[] $external the list of external associations to be loaded
* @param \Cake\ORM\Query $query The query from which the results where generated
* @param \Cake\Database\Statement\BufferedStatement $statement The statement to work on
* @return array
@@ -761,7 +761,6 @@ class EagerLoader
protected function _collectKeys(array $external, Query $query, $statement): array
$collectKeys = [];
- /* @var \Cake\ORM\EagerLoadable $meta */
foreach ($external as $meta) {
$instance = $meta->instance();
if (!$instance->requiresKeys($meta->getConfig())) {
@@ -1347,7 +1347,7 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
* composite keys when comparing values.
* @param array $options the original options passed to a finder
- * @param array $keys the keys to check in $options to build matchers from
+ * @param string[] $keys the keys to check in $options to build matchers from
* the associated value
@@ -2259,7 +2259,7 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
* @param string $method The method name that was fired.
* @param array $args List of arguments passed to the function.
- * @return mixed
+ * @return \Cake\ORM\Query
* @throws \BadMethodCallException when there are missing arguments, or when
* and & or are combined.