Fix #17119: Fix yii\caching\Cache::multiSet() to use yii\caching\Cache::$defaultDuration when no duration is passed

This commit is contained in:
Oscar Barrett
2021-09-03 15:02:47 +08:00
committed by GitHub
parent ab1c653fb7
commit 4f387d05c1
4 changed files with 15 additions and 6 deletions

View File

@ -112,13 +112,14 @@ interface CacheInterface extends \ArrayAccess
* expiration time will be replaced with the new ones, respectively.
*
* @param array $items the items to be cached, as key-value pairs.
* @param int $duration default number of seconds in which the cached values will expire. 0 means never expire.
* @param int $duration default duration in seconds before the cache will expire. If not set,
* default [[defaultDuration]] value is used.
* @param Dependency $dependency dependency of the cached items. If the dependency changes,
* the corresponding values in the cache will be invalidated when it is fetched via [[get()]].
* This parameter is ignored if [[serializer]] is false.
* @return array array of failed keys
*/
public function multiSet($items, $duration = 0, $dependency = null);
public function multiSet($items, $duration = null, $dependency = null);
/**
* Stores a value identified by a key into cache if the cache does not contain this key.