Make TemplateDataBlob::normaliseInterfaceText() private

Not used anywhere else:
https://codesearch.wmcloud.org/search/?q=normaliseInterfaceText
Doesn't even need to be static, as it is never called from a
non-static context.

Change-Id: I0981392e18cab08fb19501f57d805caf8f57dd4a
This commit is contained in:
Thiemo Kreuz 2020-08-19 15:40:55 +02:00
parent 1c91be000e
commit 10971b6124

View file

@ -164,7 +164,7 @@ class TemplateDataBlob {
if ( !is_object( $data->description ) && !is_string( $data->description ) ) { if ( !is_object( $data->description ) && !is_string( $data->description ) ) {
return Status::newFatal( 'templatedata-invalid-type', 'description', 'string|object' ); return Status::newFatal( 'templatedata-invalid-type', 'description', 'string|object' );
} }
$data->description = self::normaliseInterfaceText( $data->description ); $data->description = $this->normaliseInterfaceText( $data->description );
} else { } else {
$data->description = null; $data->description = null;
} }
@ -229,7 +229,7 @@ class TemplateDataBlob {
'string|object' 'string|object'
); );
} }
$paramObj->label = self::normaliseInterfaceText( $paramObj->label ); $paramObj->label = $this->normaliseInterfaceText( $paramObj->label );
} else { } else {
$paramObj->label = null; $paramObj->label = null;
} }
@ -270,7 +270,7 @@ class TemplateDataBlob {
'string|object' 'string|object'
); );
} }
$paramObj->description = self::normaliseInterfaceText( $paramObj->description ); $paramObj->description = $this->normaliseInterfaceText( $paramObj->description );
} else { } else {
$paramObj->description = null; $paramObj->description = null;
} }
@ -285,7 +285,7 @@ class TemplateDataBlob {
'string|object' 'string|object'
); );
} }
$paramObj->example = self::normaliseInterfaceText( $paramObj->example ); $paramObj->example = $this->normaliseInterfaceText( $paramObj->example );
} else { } else {
$paramObj->example = null; $paramObj->example = null;
} }
@ -341,7 +341,7 @@ class TemplateDataBlob {
'string|object' 'string|object'
); );
} }
$paramObj->default = self::normaliseInterfaceText( $paramObj->default ); $paramObj->default = $this->normaliseInterfaceText( $paramObj->default );
} else { } else {
$paramObj->default = null; $paramObj->default = null;
} }
@ -460,7 +460,7 @@ class TemplateDataBlob {
); );
} }
$setObj->label = self::normaliseInterfaceText( $setObj->label ); $setObj->label = $this->normaliseInterfaceText( $setObj->label );
if ( !isset( $setObj->params ) ) { if ( !isset( $setObj->params ) ) {
return Status::newFatal( 'templatedata-invalid-missing', "sets.{$setNr}.params", 'array' ); return Status::newFatal( 'templatedata-invalid-missing', "sets.{$setNr}.params", 'array' );
@ -557,9 +557,9 @@ class TemplateDataBlob {
/** /**
* Normalise a InterfaceText field in the TemplateData blob. * Normalise a InterfaceText field in the TemplateData blob.
* @param stdClass|string $text * @param stdClass|string $text
* @return stdClass|string * @return stdClass
*/ */
protected static function normaliseInterfaceText( $text ) { private function normaliseInterfaceText( $text ) {
if ( is_string( $text ) ) { if ( is_string( $text ) ) {
$contLang = MediaWikiServices::getInstance()->getContentLanguage(); $contLang = MediaWikiServices::getInstance()->getContentLanguage();
$ret = new stdClass(); $ret = new stdClass();