Merge "Add language Doteli (dty)"
[lhc/web/wiklou.git] / includes / libs / objectcache / BagOStuff.php
index 5447ee7..65ff0ee 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Classes to cache objects in PHP accelerators, SQL database or DBA files
- *
  * Copyright © 2003-2004 Brion Vibber <brion@pobox.com>
  * https://www.mediawiki.org/
  *
@@ -37,10 +35,10 @@ use Psr\Log\NullLogger;
  * the PHP memcached client.
  *
  * backends for local hash array and SQL table included:
- * <code>
+ * @code
  *   $bag = new HashBagOStuff();
  *   $bag = new SqlBagOStuff(); # connect to db first
- * </code>
+ * @endcode
  *
  * @ingroup Cache
  */
@@ -119,10 +117,11 @@ abstract class BagOStuff implements LoggerAwareInterface {
         * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
         * @param int $attempts The amount of times to attempt a merge in case of failure
         * @return bool Success
+        * @throws InvalidArgumentException
         */
        public function merge( $key, $callback, $exptime = 0, $attempts = 10 ) {
                if ( !is_callable( $callback ) ) {
-                       throw new Exception( "Got invalid callback." );
+                       throw new InvalidArgumentException( "Got invalid callback." );
                }
 
                return $this->mergeViaLock( $key, $callback, $exptime, $attempts );
@@ -166,6 +165,7 @@ abstract class BagOStuff implements LoggerAwareInterface {
         * @param mixed $value
         * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
         * @return bool Success
+        * @throws Exception
         */
        protected function cas( $casToken, $key, $value, $exptime = 0 ) {
                throw new Exception( "CAS is not implemented in " . __CLASS__ );
@@ -205,7 +205,7 @@ abstract class BagOStuff implements LoggerAwareInterface {
 
        /**
         * @param string $key
-        * @param int $timeout Lock wait timeout [optional]
+        * @param int $timeout Lock wait timeout; 0 for non-blocking [optional]
         * @param int $expiry Lock expiry [optional]
         * @return bool Success
         */