Merge "Make TemplateDataBlob::normaliseInterfaceText() private"

This commit is contained in:
jenkins-bot 2020-09-08 22:45:15 +00:00 committed by Gerrit Code Review
commit 6dd0b66fea

View file

@ -165,7 +165,7 @@ class TemplateDataBlob {
if ( !is_object( $data->description ) && !is_string( $data->description ) ) {
return Status::newFatal( 'templatedata-invalid-type', 'description', 'string|object' );
}
$data->description = self::normaliseInterfaceText( $data->description );
$data->description = $this->normaliseInterfaceText( $data->description );
} else {
$data->description = null;
}
@ -230,7 +230,7 @@ class TemplateDataBlob {
'string|object'
);
}
$paramObj->label = self::normaliseInterfaceText( $paramObj->label );
$paramObj->label = $this->normaliseInterfaceText( $paramObj->label );
} else {
$paramObj->label = null;
}
@ -271,7 +271,7 @@ class TemplateDataBlob {
'string|object'
);
}
$paramObj->description = self::normaliseInterfaceText( $paramObj->description );
$paramObj->description = $this->normaliseInterfaceText( $paramObj->description );
} else {
$paramObj->description = null;
}
@ -286,7 +286,7 @@ class TemplateDataBlob {
'string|object'
);
}
$paramObj->example = self::normaliseInterfaceText( $paramObj->example );
$paramObj->example = $this->normaliseInterfaceText( $paramObj->example );
} else {
$paramObj->example = null;
}
@ -342,7 +342,7 @@ class TemplateDataBlob {
'string|object'
);
}
$paramObj->default = self::normaliseInterfaceText( $paramObj->default );
$paramObj->default = $this->normaliseInterfaceText( $paramObj->default );
} else {
$paramObj->default = null;
}
@ -461,7 +461,7 @@ class TemplateDataBlob {
);
}
$setObj->label = self::normaliseInterfaceText( $setObj->label );
$setObj->label = $this->normaliseInterfaceText( $setObj->label );
if ( !isset( $setObj->params ) ) {
return Status::newFatal( 'templatedata-invalid-missing', "sets.{$setNr}.params", 'array' );
@ -558,9 +558,9 @@ class TemplateDataBlob {
/**
* Normalise a InterfaceText field in the TemplateData blob.
* @param stdClass|string $text
* @return stdClass|string
* @return stdClass
*/
protected static function normaliseInterfaceText( $text ) {
private function normaliseInterfaceText( $text ) {
if ( is_string( $text ) ) {
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
return (object)[ $contLang->getCode() => $text ];