Merge "ESLint ecmaVersion setting is not needed if env is es6"
[lhc/web/wiklou.git] / includes / libs / objectcache / HashBagOStuff.php
index baa3c32..f8e3b17 100644 (file)
@@ -31,7 +31,7 @@
 class HashBagOStuff extends BagOStuff {
        /** @var mixed[] */
        protected $bag = [];
-       /** @var integer Max entries allowed */
+       /** @var int Max entries allowed */
        protected $maxCacheKeys;
 
        const KEY_VAL = 0;
@@ -52,7 +52,7 @@ class HashBagOStuff extends BagOStuff {
 
        protected function expire( $key ) {
                $et = $this->bag[$key][self::KEY_EXP];
-               if ( $et == self::TTL_INDEFINITE || $et > time() ) {
+               if ( $et == self::TTL_INDEFINITE || $et > $this->getCurrentTime() ) {
                        return false;
                }
 
@@ -115,4 +115,8 @@ class HashBagOStuff extends BagOStuff {
        public function clear() {
                $this->bag = [];
        }
+
+       protected function getCurrentTime() {
+               return time();
+       }
 }