Merge "objectcache: Use constant for $ttl param default in WANObjectCache::set()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 9 Mar 2019 00:15:00 +0000 (00:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 9 Mar 2019 00:15:00 +0000 (00:15 +0000)
includes/libs/objectcache/WANObjectCache.php

index 41a3e4e..9fbad39 100644 (file)
@@ -519,7 +519,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         * @param string $key Cache key
         * @param mixed $value
         * @param int $ttl Seconds to live. Special values are:
-        *   - WANObjectCache::TTL_INDEFINITE: Cache forever
+        *   - WANObjectCache::TTL_INDEFINITE: Cache forever (default)
         * @param array $opts Options map:
         *   - lag : Seconds of replica DB lag. Typically, this is either the replica DB lag
         *      before the data was read or, if applicable, the replica DB lag before
@@ -548,7 +548,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         * @note Options added in 1.28: staleTTL
         * @return bool Success
         */
-       final public function set( $key, $value, $ttl = 0, array $opts = [] ) {
+       final public function set( $key, $value, $ttl = self::TTL_INDEFINITE, array $opts = [] ) {
                $now = $this->getCurrentTime();
                $lockTSE = $opts['lockTSE'] ?? self::TSE_NONE;
                $staleTTL = $opts['staleTTL'] ?? self::STALE_TTL_NONE;