resources: Collapse all jQuery UI modules into one deprecated mega-module
[lhc/web/wiklou.git] / maintenance / updateExtensionJsonSchema.php
index 6233d5b..18c71a3 100644 (file)
@@ -18,7 +18,7 @@ class UpdateExtensionJsonSchema extends Maintenance {
                }
 
                $json = FormatJson::decode( file_get_contents( $filename ), true );
-               if ( $json === null ) {
+               if ( !is_array( $json ) ) {
                        $this->fatalError( "Error: Invalid JSON" );
                }
 
@@ -34,6 +34,7 @@ class UpdateExtensionJsonSchema extends Maintenance {
                while ( $json['manifest_version'] !== ExtensionRegistry::MANIFEST_VERSION ) {
                        $json['manifest_version'] += 1;
                        $func = "updateTo{$json['manifest_version']}";
+                       // @phan-suppress-next-line PhanUndeclaredMethod
                        $this->$func( $json );
                }
 
@@ -59,6 +60,13 @@ class UpdateExtensionJsonSchema extends Maintenance {
                                                $json['config'][$name]['merge_strategy'] = $value[ExtensionRegistry::MERGE_STRATEGY];
                                                unset( $value[ExtensionRegistry::MERGE_STRATEGY] );
                                        }
+                                       if ( isset( $config["@$name"] ) ) {
+                                               // Put 'description' first for better human-legibility.
+                                               $json['config'][$name] = array_merge(
+                                                       [ 'description' => $config["@$name"] ],
+                                                       $json['config'][$name]
+                                               );
+                                       }
                                }
                        }
                }