X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FconvertExtensionToRegistration.php;h=409ecdf135b37008f252ea352c4d0d792b346050;hb=0e2241ad6c9fd1ac055ce1a829144a021dfdb79f;hp=a09ca5ceb51890a305258092281939ea0e947780;hpb=787da207a297714551fec2e518d67fbe3e957d60;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index a09ca5ceb5..409ecdf135 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,10 @@ class ConvertExtensionToRegistration extends Maintenance { $this->json[$realName] = $value; } + /** + * @param string $realName + * @param array[] $value + */ protected function handleResourceModules( $realName, $value ) { $defaults = []; $remote = $this->hasOption( 'skin' ) ? 'remoteSkinPath' : 'remoteExtPath';