X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FconvertExtensionToRegistration.php;h=409ecdf135b37008f252ea352c4d0d792b346050;hb=398d8e843a72c39c21f6c74e4f43fda413858a13;hp=3db0511eae711cd835f9fb19665f30b1306cd0ae;hpb=7f7efbe026b01be36019c26571224a6e8a178677;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index 3db0511eae..409ecdf135 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -168,10 +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 ) ) { - // @phan-suppress-next-next-line PhanTypeSuspiciousStringExpression + } 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." ); @@ -264,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." ); @@ -279,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';