Merge "mw.Feedback: If the message is posted remotely, link the title correctly"
[lhc/web/wiklou.git] / includes / config / ConfigFactory.php
index e175765..2c7afda 100644 (file)
@@ -105,7 +105,12 @@ class ConfigFactory implements SalvageableService {
         */
        public function register( $name, $callback ) {
                if ( !is_callable( $callback ) && !( $callback instanceof Config ) ) {
-                       throw new InvalidArgumentException( 'Invalid callback provided' );
+                       if ( is_array( $callback ) ) {
+                               $callback = '[ ' . implode( ', ', $callback ) . ' ]';
+                       } elseif ( is_object( $callback ) ) {
+                               $callback = 'instanceof ' . get_class( $callback );
+                       }
+                       throw new InvalidArgumentException( 'Invalid callback \'' . $callback . '\' provided' );
                }
 
                unset( $this->configs[$name] );