From 17c84a62c2634ccc7e7edc0c9167ae955f3413e9 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Fri, 8 Feb 2019 17:31:29 -0800 Subject: [PATCH] Drop Linker::formatSize, deprecated in 1.28 and unused Change-Id: Id119e9f3ff0d27b59654876bad9212cc0f3c5a2d --- RELEASE-NOTES-1.33 | 2 ++ includes/DummyLinker.php | 9 --------- includes/Linker.php | 17 ----------------- includes/page/ImagePage.php | 2 +- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/RELEASE-NOTES-1.33 b/RELEASE-NOTES-1.33 index e7251989c7..f97539b93a 100644 --- a/RELEASE-NOTES-1.33 +++ b/RELEASE-NOTES-1.33 @@ -209,6 +209,8 @@ because of Phabricator reports. * SiteSQLStore, deprecated in 1.27 and whose only method, ::newInstance(), would return the global SiteStore instance, has been removed. You can get to this via MediaWiki\MediaWikiServices::getInstance()->getSiteStore() directly. +* Linker::formatSize, deprecated in 1.28, has been removed (with DummyLinker's). + Instead, use Language->formatSize() with the relevant Language object. === Deprecations in 1.33 === * The configuration option $wgUseESI has been deprecated, and is expected diff --git a/includes/DummyLinker.php b/includes/DummyLinker.php index ba1233e546..be2d90b67c 100644 --- a/includes/DummyLinker.php +++ b/includes/DummyLinker.php @@ -426,15 +426,6 @@ class DummyLinker { return Linker::formatHiddenCategories( $hiddencats ); } - /** - * @deprecated since 1.28, use Language::formatSize() directly - */ - public function formatSize( $size ) { - wfDeprecated( __METHOD__, '1.28' ); - - return Linker::formatSize( $size ); - } - public function titleAttrib( $name, $options = null, array $msgParams = [] ) { return Linker::titleAttrib( $name, diff --git a/includes/Linker.php b/includes/Linker.php index d1434f8ff4..b54723adb4 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1963,23 +1963,6 @@ class Linker { return $outText; } - /** - * @deprecated since 1.28, use Language::formatSize() directly - * - * Format a size in bytes for output, using an appropriate - * unit (B, KB, MB or GB) according to the magnitude in question - * - * @since 1.16.3 - * @param int $size Size to format - * @return string - */ - public static function formatSize( $size ) { - wfDeprecated( __METHOD__, '1.28' ); - - global $wgLang; - return htmlspecialchars( $wgLang->formatSize( $size ) ); - } - /** * Given the id of an interface element, constructs the appropriate title * attribute from the system messages. (Note, this is usually the id but diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php index 76b2de0ba3..66804bc152 100644 --- a/includes/page/ImagePage.php +++ b/includes/page/ImagePage.php @@ -357,7 +357,7 @@ class ImagePage extends Article { # image # "Download high res version" link below the image # $msgsize = $this->getContext()->msg( 'file-info-size', $width_orig, $height_orig, - # Linker::formatSize( $this->displayImg->getSize() ), $mime )->escaped(); + # Language::formatSize( $this->displayImg->getSize() ), $mime )->escaped(); # We'll show a thumbnail of this image if ( $width > $maxWidth || $height > $maxHeight || $this->displayImg->isVectorized() ) { list( $width, $height ) = $this->getDisplayWidthHeight( -- 2.20.1