objectcache: Add callable doc comments for WANObjectCache
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 25 Jul 2016 05:33:06 +0000 (22:33 -0700)
committerKrinkle <krinklemail@gmail.com>
Mon, 25 Jul 2016 18:40:39 +0000 (18:40 +0000)
Change-Id: I28a705ae12e065dc8a3921e33c873f9a7fbb7490

includes/libs/objectcache/WANObjectCache.php

index 2dc17bf..b5d014f 100644 (file)
@@ -759,10 +759,10 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         * @param array $opts Options map:
         *   - checkKeys: List of "check" keys. The key at $key will be seen as invalid when either
         *      touchCheckKey() or resetCheckKey() is called on any of these keys.
-        *      Default: [];
-        *   - lowTTL: Consider pre-emptive updates when the current TTL (sec) of the key is less than
-        *      this. It becomes more likely over time, becoming a certainty once the key is expired.
-        *      Default: WANObjectCache::LOW_TTL seconds.
+        *      Default: [].
+        *   - lowTTL: Consider pre-emptive updates when the current TTL (seconds) of the key is less
+        *      than this. It becomes more likely over time, becoming certain once the key is expired.
+        *      Default: WANObjectCache::LOW_TTL.
         *   - lockTSE: If the key is tombstoned or expired (by checkKeys) less than this many seconds
         *      ago, then try to have a single thread handle cache regeneration at any given time.
         *      Other threads will try to use stale values if possible. If, on miss, the time since
@@ -776,9 +776,9 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         *      stampedes cannot happen if the value falls out of cache. This can be used as insurance
         *      against cache regeneration becoming very slow for some reason (greater than the TTL).
         *      Default: null.
-        *   - pcTTL: Process cache the value in this PHP instance with this TTL. This avoids
-        *      network I/O when a key is read several times. This will not cache if the callback
-        *      returns false however. Note that any purges will not be seen while process cached;
+        *   - pcTTL: Process cache the value in this PHP instance for this many seconds. This avoids
+        *      network I/O when a key is read several times. This will not cache when the callback
+        *      returns false, however. Note that any purges will not be seen while process cached;
         *      since the callback should use slave DBs and they may be lagged or have snapshot
         *      isolation anyway, this should not typically matter.
         *      Default: WANObjectCache::TTL_UNCACHEABLE.
@@ -788,6 +788,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         *      however, as this reduces compatibility (due to serialization).
         *      Default: null.
         * @return mixed Value found or written to the key
+        * @note Callable type hints are not used to avoid class-autoloading
         */
        final public function getWithSetCallback( $key, $ttl, $callback, array $opts = [] ) {
                $pcTTL = isset( $opts['pcTTL'] ) ? $opts['pcTTL'] : self::TTL_UNCACHEABLE;
@@ -862,6 +863,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         *   - minTime: Treat values older than this UNIX timestamp as not existing. Default: null.
         * @param float &$asOf Cache generation timestamp of returned value [returned]
         * @return mixed
+        * @note Callable type hints are not used to avoid class-autoloading
         */
        protected function doGetWithSetCallback( $key, $ttl, $callback, array $opts, &$asOf = null ) {
                $lowTTL = isset( $opts['lowTTL'] ) ? $opts['lowTTL'] : min( self::LOW_TTL, $ttl );