From 8d47f5368785c091e35a65f2c63a5964e5f29d50 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Fri, 8 Feb 2019 17:31:42 -0800 Subject: [PATCH] Drop Linker::formatTemplates, deprecated in 1.28 and unused Change-Id: I02e677021cdc1fc7ac6da4839a23b15afcfb2296 --- RELEASE-NOTES-1.33 | 2 ++ includes/DummyLinker.php | 19 ------------------- includes/Linker.php | 41 ---------------------------------------- 3 files changed, 2 insertions(+), 60 deletions(-) diff --git a/RELEASE-NOTES-1.33 b/RELEASE-NOTES-1.33 index f97539b93a..c07042d263 100644 --- a/RELEASE-NOTES-1.33 +++ b/RELEASE-NOTES-1.33 @@ -211,6 +211,8 @@ because of Phabricator reports. 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. +* Linker::formatTemplates, deprecated in 1.28, has been removed (along with the + version in DummyLinker). You can use TemplatesOnThisPageFormatter directly. === 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 be2d90b67c..e46c45e6ea 100644 --- a/includes/DummyLinker.php +++ b/includes/DummyLinker.php @@ -403,25 +403,6 @@ class DummyLinker { ); } - /** - * @deprecated since 1.28, use TemplatesOnThisPageFormatter directly - */ - public function formatTemplates( - $templates, - $preview = false, - $section = false, - $more = null - ) { - wfDeprecated( __METHOD__, '1.28' ); - - return Linker::formatTemplates( - $templates, - $preview, - $section, - $more - ); - } - public function formatHiddenCategories( $hiddencats ) { return Linker::formatHiddenCategories( $hiddencats ); } diff --git a/includes/Linker.php b/includes/Linker.php index b54723adb4..cc1df39819 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1895,47 +1895,6 @@ class Linker { } } - /** - * @deprecated since 1.28, use TemplatesOnThisPageFormatter directly - * - * Returns HTML for the "templates used on this page" list. - * - * Make an HTML list of templates, and then add a "More..." link at - * the bottom. If $more is null, do not add a "More..." link. If $more - * is a Title, make a link to that title and use it. If $more is a string, - * directly paste it in as the link (escaping needs to be done manually). - * Finally, if $more is a Message, call toString(). - * - * @since 1.16.3. $more added in 1.21 - * @param Title[] $templates Array of templates - * @param bool $preview Whether this is for a preview - * @param bool $section Whether this is for a section edit - * @param Title|Message|string|null $more An escaped link for "More..." of the templates - * @return string HTML output - */ - public static function formatTemplates( $templates, $preview = false, - $section = false, $more = null - ) { - wfDeprecated( __METHOD__, '1.28' ); - - $type = false; - if ( $preview ) { - $type = 'preview'; - } elseif ( $section ) { - $type = 'section'; - } - - if ( $more instanceof Message ) { - $more = $more->toString(); - } - - $formatter = new TemplatesOnThisPageFormatter( - RequestContext::getMain(), - MediaWikiServices::getInstance()->getLinkRenderer() - ); - return $formatter->format( $templates, $type, $more ); - } - /** * Returns HTML for the "hidden categories on this page" list. * -- 2.20.1