From 46d4f5625e7f298c717dc6b5f34b2dbafac07f11 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 6 May 2011 22:53:59 +0000 Subject: [PATCH] Documentation Remove some deprecated in 1.16 functions with no callers --- includes/Linker.php | 88 +++++++++------------------------------------ 1 file changed, 17 insertions(+), 71 deletions(-) diff --git a/includes/Linker.php b/includes/Linker.php index 509619189a..f872d1e9b3 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -317,6 +317,8 @@ class Linker { * Default text of the links to the Title $target * * @param $target Title + * + * @return string */ private static function linkText( $target ) { # We might be passed a non-Title by make*LinkObj(). Fail gracefully. @@ -361,6 +363,8 @@ class Linker { * despite $query not being used. * * @param $nt Title + * + * @return string */ static function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { if ( $text == '' ) { @@ -370,6 +374,10 @@ class Linker { return "{$prefix}{$text}{$inside}{$trail}"; } + /** + * @param $title Title + * @return Title + */ static function normaliseSpecialPage( Title $title ) { if ( $title->getNamespace() == NS_SPECIAL ) { list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); @@ -387,6 +395,10 @@ class Linker { /** * Returns the filename part of an url. * Used as alternative text for external images. + * + * @param $url string + * + * @return string */ static function fnamePart( $url ) { $basename = strrchr( $url, '/' ); @@ -401,6 +413,11 @@ class Linker { /** * Return the code for images which were added via external links, * via Parser::maybeMakeExternalImage(). + * + * @param $url + * @param $alt + * + * @return string */ static function makeExternalImage( $url, $alt = '' ) { if ( $alt == '' ) { @@ -1737,60 +1754,6 @@ class Linker { /* Deprecated methods */ - /** - * @deprecated since 1.16 Use link() - * - * This function is a shortcut to makeLinkObj(Title::newFromText($title),...). Do not call - * it if you already have a title object handy. See makeLinkObj for further documentation. - * - * @param $title String: the text of the title - * @param $text String: link text - * @param $query String: optional query part - * @param $trail String: optional trail. Alphabetic characters at the start of this string will - * be included in the link text. Other characters will be appended after - * the end of the link. - */ - static function makeLink( $title, $text = '', $query = '', $trail = '' ) { - wfProfileIn( __METHOD__ ); - $nt = Title::newFromText( $title ); - if ( $nt instanceof Title ) { - $result = self::makeLinkObj( $nt, $text, $query, $trail ); - } else { - wfDebug( 'Invalid title passed to self::makeLink(): "' . $title . "\"\n" ); - $result = $text == "" ? $title : $text; - } - - wfProfileOut( __METHOD__ ); - return $result; - } - - /** - * @deprecated since 1.16 Use link() - * - * This function is a shortcut to makeKnownLinkObj(Title::newFromText($title),...). Do not call - * it if you already have a title object handy. See makeKnownLinkObj for further documentation. - * - * @param $title String: the text of the title - * @param $text String: link text - * @param $query String: optional query part - * @param $trail String: optional trail. Alphabetic characters at the start of this string will - * be included in the link text. Other characters will be appended after - * the end of the link. - * @param $prefix String: Optional prefix - * @param $aprops String: extra attributes to the a-element - */ - static function makeKnownLink( - $title, $text = '', $query = '', $trail = '', $prefix = '', $aprops = '' - ) { - $nt = Title::newFromText( $title ); - if ( $nt instanceof Title ) { - return self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix , $aprops ); - } else { - wfDebug( 'Invalid title passed to self::makeKnownLink(): "' . $title . "\"\n" ); - return $text == '' ? $title : $text; - } - } - /** * @deprecated since 1.16 Use link() * @@ -1911,23 +1874,6 @@ class Linker { return $ret; } - /** - * @deprecated since 1.16 Use link() - * - * Make a brown link to a short article. - * - * @param $nt Title object of the target page - * @param $text String: link text - * @param $query String: optional query part - * @param $trail String: optional trail. Alphabetic characters at the start of this string will - * be included in the link text. Other characters will be appended after - * the end of the link. - * @param $prefix String: Optional prefix - */ - static function makeStubLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { - return self::makeColouredLinkObj( $nt, 'stub', $text, $query, $trail, $prefix ); - } - /** * @deprecated since 1.16 Use link() * -- 2.20.1