objectcache: Make BagOStuff::getCurrentTime() public
authorLucas Werkmeister <lucas.werkmeister@wikimedia.de>
Sat, 8 Jun 2019 16:30:20 +0000 (18:30 +0200)
committerKrinkle <krinklemail@gmail.com>
Sun, 9 Jun 2019 17:16:12 +0000 (17:16 +0000)
If another cache wraps a BagOStuff, it may need to know about the
BagOStuff’s notion of the current time, which may be mocked and differ
from the real time.

Change-Id: I40f4085d4cf549314394d3140cccb1fe4e48690a

includes/libs/objectcache/BagOStuff.php

index 0dd7b57..321476b 100644 (file)
@@ -806,15 +806,17 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
        }
 
        /**
+        * @internal For testing only
         * @return float UNIX timestamp
         * @codeCoverageIgnore
         */
-       protected function getCurrentTime() {
+       public function getCurrentTime() {
                return $this->wallClockOverride ?: microtime( true );
        }
 
        /**
-        * @param float|null &$time Mock UNIX timestamp for testing
+        * @internal For testing only
+        * @param float|null &$time Mock UNIX timestamp
         * @codeCoverageIgnore
         */
        public function setMockTime( &$time ) {