summaryrefslogtreecommitdiff
path: root/includes/WikiMap.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/WikiMap.php')
-rw-r--r--includes/WikiMap.php58
1 files changed, 29 insertions, 29 deletions
diff --git a/includes/WikiMap.php b/includes/WikiMap.php
index da4416de..34cd48da 100644
--- a/includes/WikiMap.php
+++ b/includes/WikiMap.php
@@ -28,8 +28,8 @@ class WikiMap {
/**
* Get a WikiReference object for $wikiID
*
- * @param string $wikiID wiki'd id (generally database name)
- * @return WikiReference object or null if the wiki was not found
+ * @param string $wikiID Wiki'd id (generally database name)
+ * @return WikiReference|null WikiReference object or null if the wiki was not found
*/
public static function getWiki( $wikiID ) {
global $wgConf;
@@ -58,7 +58,7 @@ class WikiMap {
* Convenience to get the wiki's display name
*
* @todo We can give more info than just the wiki id!
- * @param string $wikiID wiki'd id (generally database name)
+ * @param string $wikiID Wiki'd id (generally database name)
* @return string|int Wiki's name or $wiki_id if the wiki was not found
*/
public static function getWikiName( $wikiID ) {
@@ -73,10 +73,10 @@ class WikiMap {
/**
* Convenience to get a link to a user page on a foreign wiki
*
- * @param string $wikiID wiki'd id (generally database name)
- * @param string $user user name (must be normalised before calling this function!)
- * @param string $text link's text; optional, default to "User:$user"
- * @return String: HTML link or false if the wiki was not found
+ * @param string $wikiID Wiki'd id (generally database name)
+ * @param string $user User name (must be normalised before calling this function!)
+ * @param string $text Link's text; optional, default to "User:$user"
+ * @return string HTML link or false if the wiki was not found
*/
public static function foreignUserLink( $wikiID, $user, $text = null ) {
return self::makeForeignLink( $wikiID, "User:$user", $text );
@@ -85,10 +85,10 @@ class WikiMap {
/**
* Convenience to get a link to a page on a foreign wiki
*
- * @param string $wikiID wiki'd id (generally database name)
- * @param string $page page name (must be normalised before calling this function!)
- * @param string $text link's text; optional, default to $page
- * @return String: HTML link or false if the wiki was not found
+ * @param string $wikiID Wiki'd id (generally database name)
+ * @param string $page Page name (must be normalised before calling this function!)
+ * @param string $text Link's text; optional, default to $page
+ * @return string HTML link or false if the wiki was not found
*/
public static function makeForeignLink( $wikiID, $page, $text = null ) {
if ( !$text ) {
@@ -106,9 +106,9 @@ class WikiMap {
/**
* Convenience to get a url to a page on a foreign wiki
*
- * @param string $wikiID wiki'd id (generally database name)
- * @param string $page page name (must be normalised before calling this function!)
- * @return String: URL or false if the wiki was not found
+ * @param string $wikiID Wiki'd id (generally database name)
+ * @param string $page Page name (must be normalised before calling this function!)
+ * @return string|bool URL or false if the wiki was not found
*/
public static function getForeignURL( $wikiID, $page ) {
$wiki = WikiMap::getWiki( $wikiID );
@@ -127,16 +127,16 @@ class WikiMap {
class WikiReference {
private $mMinor; ///< 'en', 'meta', 'mediawiki', etc
private $mMajor; ///< 'wiki', 'wiktionary', etc
- private $mCanonicalServer; ///< canonical server URL, e.g. 'http://www.mediawiki.org'
+ private $mCanonicalServer; ///< canonical server URL, e.g. 'https://www.mediawiki.org'
private $mServer; ///< server URL, may be protocol-relative, e.g. '//www.mediawiki.org'
private $mPath; ///< path, '/wiki/$1'
/**
- * @param $major string
- * @param $minor string
- * @param $canonicalServer string
- * @param $path string
- * @param $server null|string
+ * @param string $major
+ * @param string $minor
+ * @param string $canonicalServer
+ * @param string $path
+ * @param null|string $server
*/
public function __construct( $major, $minor, $canonicalServer, $path, $server = null ) {
$this->mMajor = $major;
@@ -164,7 +164,7 @@ class WikiReference {
* Get the the URL in a way to de displayed to the user
* More or less Wikimedia specific
*
- * @return String
+ * @return string
*/
public function getDisplayName() {
$url = $this->getUrl( '' );
@@ -181,8 +181,8 @@ class WikiReference {
* Helper function for getUrl()
*
* @todo FIXME: This may be generalized...
- * @param string $page page name (must be normalised before calling this function!)
- * @return String: Url fragment
+ * @param string $page Page name (must be normalised before calling this function!)
+ * @return string Url fragment
*/
private function getLocalUrl( $page ) {
return str_replace( '$1', wfUrlEncode( str_replace( ' ', '_', $page ) ), $this->mPath );
@@ -191,8 +191,8 @@ class WikiReference {
/**
* Get a canonical (i.e. based on $wgCanonicalServer) URL to a page on this foreign wiki
*
- * @param string $page page name (must be normalised before calling this function!)
- * @return String: Url
+ * @param string $page Page name (must be normalised before calling this function!)
+ * @return string Url
*/
public function getCanonicalUrl( $page ) {
return $this->mCanonicalServer . $this->getLocalUrl( $page );
@@ -208,8 +208,8 @@ class WikiReference {
/**
* Alias for getCanonicalUrl(), for backwards compatibility.
- * @param $page string
- * @return String
+ * @param string $page
+ * @return string
*/
public function getUrl( $page ) {
return $this->getCanonicalUrl( $page );
@@ -219,8 +219,8 @@ class WikiReference {
* Get a URL based on $wgServer, like Title::getFullURL() would produce
* when called locally on the wiki.
*
- * @param string $page page name (must be normalized before calling this function!)
- * @return String: URL
+ * @param string $page Page name (must be normalized before calling this function!)
+ * @return string URL
*/
public function getFullUrl( $page ) {
return $this->mServer .