From: jenkins-bot Date: Mon, 11 Feb 2019 00:43:31 +0000 (+0000) Subject: Merge "Linker: Remove some else statements, and unnecessary temporary variables" X-Git-Tag: 1.34.0-rc.0~2858 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22brouteur%22%2C%28%24id_rubrique%20?a=commitdiff_plain;h=12a9cf3110c9ea840b20f74b3d4a968c92d8b446;p=lhc%2Fweb%2Fwiklou.git Merge "Linker: Remove some else statements, and unnecessary temporary variables" --- 12a9cf3110c9ea840b20f74b3d4a968c92d8b446 diff --cc includes/Linker.php index cc1df39819,7d6b1493fd..049fb07284 --- a/includes/Linker.php +++ b/includes/Linker.php @@@ -1888,13 -1896,54 +1896,13 @@@ class Linker $html = $context->msg( 'rollbacklinkcount' )->numParams( $editCount )->parse(); } - return self::link( $title, $html, $attrs, $query, $options ); - } else { - $html = $context->msg( 'rollbacklink' )->escaped(); return self::link( $title, $html, $attrs, $query, $options ); } + + $html = $context->msg( 'rollbacklink' )->escaped(); + return self::link( $title, $html, $attrs, $query, $options ); } - /** - * @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. *