Make list=logevents display log entries by anonymous users
[lhc/web/wiklou.git] / includes / ScopedCallback.php
index 8ecd874..ef22e0a 100644 (file)
  * @since 1.21
  */
 class ScopedCallback {
-       /** @var Closure */
+       /** @var callable */
        protected $callback;
 
        /**
-        * @param $callback Closure
+        * @param callable $callback
+        * @throws MWException
         */
-       public function __construct( Closure $callback ) {
+       public function __construct( $callback ) {
+               if ( !is_callable( $callback ) ) {
+                       throw new MWException( "Provided callback is not valid." );
+               }
                $this->callback = $callback;
        }