X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FconvertExtensionToRegistration.php;h=737e65f34307dffe03fcaef7d6aa8f29f0c4026e;hb=3587a9427d8ecae967caf98a4e0c9095e97b4aa8;hp=a09ca5ceb51890a305258092281939ea0e947780;hpb=61efdc4352fa2c6c31a5404b5a4c25bb10df1f3b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index a09ca5ceb5..737e65f343 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -168,9 +168,8 @@ class ConvertExtensionToRegistration extends Maintenance { $this->fatalError( "Error: Closures cannot be converted to JSON. " . "Please move your extension function somewhere else." ); - } - // check if $func exists in the global scope - if ( function_exists( $func ) ) { + } elseif ( function_exists( $func ) ) { + // check if $func exists in the global scope $this->fatalError( "Error: Global functions cannot be converted to JSON. " . "Please move your extension function ($func) into a class." ); @@ -263,9 +262,8 @@ class ConvertExtensionToRegistration extends Maintenance { $this->fatalError( "Error: Closures cannot be converted to JSON. " . "Please move the handler for $hookName somewhere else." ); - } - // Check if $func exists in the global scope - if ( function_exists( $func ) ) { + } elseif ( function_exists( $func ) ) { + // Check if $func exists in the global scope $this->fatalError( "Error: Global functions cannot be converted to JSON. " . "Please move the handler for $hookName inside a class." ); @@ -278,6 +276,11 @@ class ConvertExtensionToRegistration extends Maintenance { $this->json[$realName] = $value; } + /** + * @param string $realName + * @param array[] $value + * @suppress PhanTypeInvalidDimOffset + */ protected function handleResourceModules( $realName, $value ) { $defaults = []; $remote = $this->hasOption( 'skin' ) ? 'remoteSkinPath' : 'remoteExtPath';