Merge "Remove duplicate release note for $wgOOUIEditPage removal"
[lhc/web/wiklou.git] / includes / registration / ExtensionRegistry.php
index 0c5a67e..bf33c6c 100644 (file)
@@ -332,6 +332,12 @@ class ExtensionRegistry {
                }
 
                foreach ( $info['callbacks'] as $name => $cb ) {
+                       if ( !is_callable( $cb ) ) {
+                               if ( is_array( $cb ) ) {
+                                       $cb = '[ ' . implode( ', ', $cb ) . ' ]';
+                               }
+                               throw new UnexpectedValueException( "callback '$cb' is not callable" );
+                       }
                        call_user_func( $cb, $info['credits'][$name] );
                }
        }
@@ -400,7 +406,7 @@ class ExtensionRegistry {
        protected function processAutoLoader( $dir, array $info ) {
                if ( isset( $info['AutoloadClasses'] ) ) {
                        // Make paths absolute, relative to the JSON file
-                       return array_map( function( $file ) use ( $dir ) {
+                       return array_map( function ( $file ) use ( $dir ) {
                                return "$dir/$file";
                        }, $info['AutoloadClasses'] );
                } else {