Merge "Consistently follow conventions for documenting parameters"
[lhc/web/wiklou.git] / includes / DeferredUpdates.php
index 2ca646b..a321414 100644 (file)
@@ -34,7 +34,7 @@ interface DeferrableUpdate {
 }
 
 /**
- * Class for mananging the deferred updates.
+ * Class for managing the deferred updates.
  *
  * @since 1.19
  */
@@ -63,6 +63,16 @@ class DeferredUpdates {
                self::addUpdate( new HTMLCacheUpdate( $title, $table ) );
        }
 
+       /**
+        * Add a callable update.  In a lot of cases, we just need a callback/closure,
+        * defining a new DeferrableUpdate object is not necessary
+        * @see MWCallableUpdate::__construct()
+        * @param callable $callable
+        */
+       public static function addCallableUpdate( $callable ) {
+               self::addUpdate( new MWCallableUpdate( $callable ) );
+       }
+
        /**
         * Do any deferred updates and clear the list
         *