}
$json = FormatJson::decode( file_get_contents( $filename ), true );
- if ( $json === null ) {
+ if ( !is_array( $json ) ) {
$this->fatalError( "Error: Invalid JSON" );
}
while ( $json['manifest_version'] !== ExtensionRegistry::MANIFEST_VERSION ) {
$json['manifest_version'] += 1;
$func = "updateTo{$json['manifest_version']}";
+ // @phan-suppress-next-line PhanUndeclaredMethod
$this->$func( $json );
}
$json['config'][$name] = [ 'value' => $value ];
if ( isset( $value[ExtensionRegistry::MERGE_STRATEGY] ) ) {
$json['config'][$name]['merge_strategy'] = $value[ExtensionRegistry::MERGE_STRATEGY];
- unset( $value[ExtensionRegistry::MERGE_STRATEGY] );
+ unset( $json['config'][$name]['value'][ExtensionRegistry::MERGE_STRATEGY] );
}
if ( isset( $config["@$name"] ) ) {
// Put 'description' first for better human-legibility.