BagOStuff doc tweaks
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 20 Apr 2015 17:23:07 +0000 (10:23 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 20 Apr 2015 17:23:07 +0000 (10:23 -0700)
Change-Id: I0eea84bbbc4c742c07a35a2b157517ad9dd40bb8

includes/libs/objectcache/BagOStuff.php

index 0b791e5..150a7ce 100644 (file)
@@ -47,6 +47,7 @@ use Psr\Log\NullLogger;
 abstract class BagOStuff implements LoggerAwareInterface {
        private $debugMode = false;
 
+       /** @var integer */
        protected $lastError = self::ERR_NONE;
 
        /**
@@ -109,8 +110,9 @@ abstract class BagOStuff implements LoggerAwareInterface {
 
        /**
         * Merge changes into the existing cache value (possibly creating a new one).
-        * The callback function returns the new value given the current value (possibly false),
-        * and takes the arguments: (this BagOStuff object, cache key, current value).
+        * The callback function returns the new value given the current value
+        * (which will be false if not present), and takes the arguments:
+        * (this BagOStuff, cache key, current value).
         *
         * @param string $key
         * @param callable $callback Callback method to be executed
@@ -334,7 +336,7 @@ abstract class BagOStuff implements LoggerAwareInterface {
         * Decrease stored value of $key by $value while preserving its TTL
         * @param string $key
         * @param int $value
-        * @return int
+        * @return int|bool New value or false on failure
         */
        public function decr( $key, $value = 1 ) {
                return $this->incr( $key, - $value );