From 10971b6124b2320b23c9e17ed4c18afd9a43f84c Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Wed, 19 Aug 2020 15:40:55 +0200 Subject: [PATCH] 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 --- includes/TemplateDataBlob.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/TemplateDataBlob.php b/includes/TemplateDataBlob.php index 8ac96b24..f6ea7ef1 100644 --- a/includes/TemplateDataBlob.php +++ b/includes/TemplateDataBlob.php @@ -164,7 +164,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; } @@ -229,7 +229,7 @@ class TemplateDataBlob { 'string|object' ); } - $paramObj->label = self::normaliseInterfaceText( $paramObj->label ); + $paramObj->label = $this->normaliseInterfaceText( $paramObj->label ); } else { $paramObj->label = null; } @@ -270,7 +270,7 @@ class TemplateDataBlob { 'string|object' ); } - $paramObj->description = self::normaliseInterfaceText( $paramObj->description ); + $paramObj->description = $this->normaliseInterfaceText( $paramObj->description ); } else { $paramObj->description = null; } @@ -285,7 +285,7 @@ class TemplateDataBlob { 'string|object' ); } - $paramObj->example = self::normaliseInterfaceText( $paramObj->example ); + $paramObj->example = $this->normaliseInterfaceText( $paramObj->example ); } else { $paramObj->example = null; } @@ -341,7 +341,7 @@ class TemplateDataBlob { 'string|object' ); } - $paramObj->default = self::normaliseInterfaceText( $paramObj->default ); + $paramObj->default = $this->normaliseInterfaceText( $paramObj->default ); } else { $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 ) ) { return Status::newFatal( 'templatedata-invalid-missing', "sets.{$setNr}.params", 'array' ); @@ -557,9 +557,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(); $ret = new stdClass();