Fix typo
[lhc/web/wiklou.git] / includes / Skin.php
index 9ec7c31..d3fa607 100644 (file)
@@ -39,7 +39,7 @@ abstract class Skin extends ContextSource {
 
        /**
         * Fetch the set of available skins.
-        * @return array associative array of strings
+        * @return array Associative array of strings
         */
        static function getSkinNames() {
                global $wgValidSkinNames;
@@ -77,7 +77,7 @@ abstract class Skin extends ContextSource {
 
        /**
         * Fetch the skinname messages for available skins.
-        * @return array of strings
+        * @return string[]
         */
        static function getSkinNameMessages() {
                $messages = array();
@@ -92,9 +92,10 @@ abstract class Skin extends ContextSource {
         * Fetch the list of user-selectable skins in regards to $wgSkipSkins.
         * Useful for Special:Preferences and other places where you
         * only want to show skins users _can_ use.
-        * @return array of strings
+        * @return string[]
+        * @since 1.23
         */
-       public static function getUsableSkins() {
+       public static function getAllowedSkins() {
                global $wgSkipSkins;
 
                $allowedSkins = self::getSkinNames();
@@ -106,6 +107,15 @@ abstract class Skin extends ContextSource {
                return $allowedSkins;
        }
 
+       /**
+        * @deprecated since 1.23, use getAllowedSkins
+        * @return string[]
+        */
+       public static function getUsableSkins() {
+               wfDeprecated( __METHOD__, '1.23' );
+               return self::getAllowedSkins();
+       }
+
        /**
         * Normalize a skin preference value to a form that can be loaded.
         * If a skin can't be found, it will fall back to the configured
@@ -183,14 +193,14 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @return string skin name
+        * @return string Skin name
         */
        public function getSkinName() {
                return $this->skinname;
        }
 
        /**
-        * @param $out OutputPage
+        * @param OutputPage $out
         */
        function initPage( OutputPage $out ) {
                wfProfileIn( __METHOD__ );
@@ -204,7 +214,7 @@ abstract class Skin extends ContextSource {
         * Defines the ResourceLoader modules that should be added to the skin
         * It is recommended that skins wishing to override call parent::getDefaultModules()
         * and substitute out any modules they wish to change by using a key to look them up
-        * @return Array of modules with helper keys for easy overriding
+        * @return array Array of modules with helper keys for easy overriding
         */
        public function getDefaultModules() {
                global $wgIncludeLegacyJavaScript, $wgPreloadJavaScriptMwUtil, $wgUseAjax,
@@ -286,7 +296,7 @@ abstract class Skin extends ContextSource {
        /**
         * Get the current revision ID
         *
-        * @return Integer
+        * @return int
         */
        public function getRevisionId() {
                return $this->getOutput()->getRevisionId();
@@ -295,7 +305,7 @@ abstract class Skin extends ContextSource {
        /**
         * Whether the revision displayed is the latest revision of the page
         *
-        * @return Boolean
+        * @return bool
         */
        public function isRevisionCurrent() {
                $revID = $this->getRevisionId();
@@ -305,7 +315,7 @@ abstract class Skin extends ContextSource {
        /**
         * Set the "relevant" title
         * @see self::getRelevantTitle()
-        * @param $t Title object to use
+        * @param Title $t
         */
        public function setRelevantTitle( $t ) {
                $this->mRelevantTitle = $t;
@@ -331,7 +341,7 @@ abstract class Skin extends ContextSource {
        /**
         * Set the "relevant" user
         * @see self::getRelevantUser()
-        * @param $u User object to use
+        * @param User $u
         */
        public function setRelevantUser( $u ) {
                $this->mRelevantUser = $u;
@@ -367,12 +377,12 @@ abstract class Skin extends ContextSource {
 
        /**
         * Outputs the HTML generated by other functions.
-        * @param $out OutputPage
+        * @param OutputPage $out
         */
        abstract function outputPage( OutputPage $out = null );
 
        /**
-        * @param $data array
+        * @param array $data
         * @return string
         */
        static function makeVariablesScript( $data ) {
@@ -388,8 +398,8 @@ abstract class Skin extends ContextSource {
        /**
         * Make a "<script>" tag containing global variables
         *
-        * @deprecated in 1.19
-        * @param $unused
+        * @deprecated since 1.19
+        * @param mixed $unused
         * @return string HTML fragment
         */
        public static function makeGlobalVariablesScript( $unused ) {
@@ -422,15 +432,15 @@ abstract class Skin extends ContextSource {
         * Calling this method with an $out of anything but the same OutputPage
         * inside ->getOutput() is deprecated. The $out arg is kept
         * for compatibility purposes with skins.
-        * @param $out OutputPage
+        * @param OutputPage $out
         * @todo delete
         */
        abstract function setupSkinUserCss( OutputPage $out );
 
        /**
         * TODO: document
-        * @param $title Title
-        * @return String
+        * @param Title $title
+        * @return string
         */
        function getPageClasses( $title ) {
                $numeric = 'ns-' . $title->getNamespace();
@@ -472,8 +482,8 @@ abstract class Skin extends ContextSource {
         * This will be called by OutputPage::headElement when it is creating the
         * "<body>" tag, skins can override it if they have a need to add in any
         * body attributes or classes of their own.
-        * @param $out OutputPage
-        * @param $bodyAttrs Array
+        * @param OutputPage $out
+        * @param array $bodyAttrs
         */
        function addToBodyAttributes( $out, &$bodyAttrs ) {
                // does nothing by default
@@ -481,7 +491,7 @@ abstract class Skin extends ContextSource {
 
        /**
         * URL to the logo
-        * @return String
+        * @return string
         */
        function getLogo() {
                global $wgLogo;
@@ -555,8 +565,8 @@ abstract class Skin extends ContextSource {
 
        /**
         * Render the array as a series of links.
-        * @param array $tree categories tree returned by Title::getParentCategoryTree
-        * @return String separated by &gt;, terminate with "\n"
+        * @param array $tree Categories tree returned by Title::getParentCategoryTree
+        * @return string Separated by &gt;, terminate with "\n"
         */
        function drawCategoryBrowser( $tree ) {
                $return = '';
@@ -612,7 +622,7 @@ abstract class Skin extends ContextSource {
         * The output of this function gets processed in SkinTemplate::outputPage() for
         * the SkinTemplate based skins, all other skins should directly echo it.
         *
-        * @return String, empty by default, if not changed by any hook function.
+        * @return string Empty by default, if not changed by any hook function.
         */
        protected function afterContentHook() {
                $data = '';
@@ -638,7 +648,7 @@ abstract class Skin extends ContextSource {
        /**
         * Generate debug data HTML for displaying at the bottom of the main content
         * area.
-        * @return String HTML containing debug data, if enabled (otherwise empty).
+        * @return string HTML containing debug data, if enabled (otherwise empty).
         */
        protected function generateDebugHTML() {
                return MWDebug::getHTMLDebugLog();
@@ -647,7 +657,7 @@ abstract class Skin extends ContextSource {
        /**
         * This gets called shortly before the "</body>" tag.
         *
-        * @return String HTML-wrapped JS code to be put before "</body>"
+        * @return string HTML-wrapped JS code to be put before "</body>"
         */
        function bottomScripts() {
                // TODO and the suckage continues. This function is really just a wrapper around
@@ -677,7 +687,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @return String
+        * @return string
         */
        function getUndeleteLink() {
                $action = $this->getRequest()->getVal( 'action', 'view' );
@@ -759,7 +769,7 @@ abstract class Skin extends ContextSource {
 
        /**
         * Returns true if the IP should be shown in the header
-        * @return Bool
+        * @return bool
         */
        function showIPinHeader() {
                global $wgShowIPinHeader;
@@ -767,7 +777,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @return String
+        * @return string
         */
        function getSearchLink() {
                $searchPage = SpecialPage::getTitleFor( 'Search' );
@@ -782,7 +792,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $type string
+        * @param string $type
         * @return string
         */
        function getCopyright( $type = 'detect' ) {
@@ -876,7 +886,7 @@ abstract class Skin extends ContextSource {
        /**
         * Get the timestamp of the latest revision, formatted in user language
         *
-        * @return String
+        * @return string
         */
        protected function lastModified() {
                $timestamp = $this->getOutput()->getRevisionTimestamp();
@@ -902,7 +912,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $align string
+        * @param string $align
         * @return string
         */
        function logoText( $align = '' ) {
@@ -925,8 +935,8 @@ abstract class Skin extends ContextSource {
        /**
         * Renders a $wgFooterIcons icon according to the method's arguments
         * @param array $icon The icon to build the html for, see $wgFooterIcons for the format of this array
-        * @param bool|String $withImage Whether to use the icon's image or output a text-only footericon
-        * @return String HTML
+        * @param bool|string $withImage Whether to use the icon's image or output a text-only footericon
+        * @return string HTML
         */
        function makeFooterIcon( $icon, $withImage = 'withImage' ) {
                if ( is_string( $icon ) ) {
@@ -985,7 +995,7 @@ abstract class Skin extends ContextSource {
 
        /**
         * Gets the link to the wiki's privacy policy page.
-        * @return String HTML
+        * @return string HTML
         */
        function privacyLink() {
                return $this->footerLink( 'privacy', 'privacypage' );
@@ -993,7 +1003,7 @@ abstract class Skin extends ContextSource {
 
        /**
         * Gets the link to the wiki's about page.
-        * @return String HTML
+        * @return string HTML
         */
        function aboutLink() {
                return $this->footerLink( 'aboutsite', 'aboutpage' );
@@ -1001,7 +1011,7 @@ abstract class Skin extends ContextSource {
 
        /**
         * Gets the link to the wiki's general disclaimers page.
-        * @return String HTML
+        * @return string HTML
         */
        function disclaimerLink() {
                return $this->footerLink( 'disclaimers', 'disclaimerpage' );
@@ -1025,7 +1035,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $id User|int
+        * @param User|int $id
         * @return bool
         */
        function showEmailUser( $id ) {
@@ -1043,7 +1053,7 @@ abstract class Skin extends ContextSource {
         * This method returns a url resolved using the configured skin style path
         * and includes the style version inside of the url.
         * @param string $name The name or path of a skin resource file
-        * @return String The fully resolved style path url including styleversion
+        * @return string The fully resolved style path url including styleversion
         */
        function getCommonStylePath( $name ) {
                global $wgStylePath, $wgStyleVersion;
@@ -1055,7 +1065,7 @@ abstract class Skin extends ContextSource {
         * This method returns a url resolved using the configured skin style path
         * and includes the style version inside of the url.
         * @param string $name The name or path of a skin resource file
-        * @return String The fully resolved style path url including styleversion
+        * @return string The fully resolved style path url including styleversion
         */
        function getSkinStylePath( $name ) {
                global $wgStylePath, $wgStyleVersion;
@@ -1065,8 +1075,8 @@ abstract class Skin extends ContextSource {
        /* these are used extensively in SkinTemplate, but also some other places */
 
        /**
-        * @param $urlaction string
-        * @return String
+        * @param string $urlaction
+        * @return string
         */
        static function makeMainPageUrl( $urlaction = '' ) {
                $title = Title::newMainPage();
@@ -1083,8 +1093,8 @@ abstract class Skin extends ContextSource {
         *
         * @param string $name Name of the Special page
         * @param string $urlaction Query to append
-        * @param $proto Protocol to use or null for a local URL
-        * @return String
+        * @param string|null $proto Protocol to use or null for a local URL
+        * @return string
         */
        static function makeSpecialUrl( $name, $urlaction = '', $proto = null ) {
                $title = SpecialPage::getSafeTitleFor( $name );
@@ -1096,10 +1106,10 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name string
-        * @param $subpage string
-        * @param $urlaction string
-        * @return String
+        * @param string $name
+        * @param string $subpage
+        * @param string $urlaction
+        * @return string
         */
        static function makeSpecialUrlSubpage( $name, $subpage, $urlaction = '' ) {
                $title = SpecialPage::getSafeTitleFor( $name, $subpage );
@@ -1107,9 +1117,9 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name string
-        * @param $urlaction string
-        * @return String
+        * @param string $name
+        * @param string $urlaction
+        * @return string
         */
        static function makeI18nUrl( $name, $urlaction = '' ) {
                $title = Title::newFromText( wfMessage( $name )->inContentLanguage()->text() );
@@ -1118,9 +1128,9 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name string
-        * @param $urlaction string
-        * @return String
+        * @param string $name
+        * @param string $urlaction
+        * @return string
         */
        static function makeUrl( $name, $urlaction = '' ) {
                $title = Title::newFromText( $name );
@@ -1132,8 +1142,8 @@ abstract class Skin extends ContextSource {
        /**
         * If url string starts with http, consider as external URL, else
         * internal
-        * @param $name String
-        * @return String URL
+        * @param string $name
+        * @return string URL
         */
        static function makeInternalOrExternalUrl( $name ) {
                if ( preg_match( '/^(?i:' . wfUrlProtocols() . ')/', $name ) ) {
@@ -1145,10 +1155,10 @@ abstract class Skin extends ContextSource {
 
        /**
         * this can be passed the NS number as defined in Language.php
-        * @param $name
-        * @param $urlaction string
-        * @param $namespace int
-        * @return String
+        * @param string $name
+        * @param string $urlaction
+        * @param int $namespace
+        * @return string
         */
        static function makeNSUrl( $name, $urlaction = '', $namespace = NS_MAIN ) {
                $title = Title::makeTitleSafe( $namespace, $name );
@@ -1159,8 +1169,8 @@ abstract class Skin extends ContextSource {
 
        /**
         * these return an array with the 'href' and boolean 'exists'
-        * @param $name
-        * @param $urlaction string
+        * @param string $name
+        * @param string $urlaction
         * @return array
         */
        static function makeUrlDetails( $name, $urlaction = '' ) {
@@ -1176,8 +1186,8 @@ abstract class Skin extends ContextSource {
        /**
         * Make URL details where the article exists (or at least it's convenient to think so)
         * @param string $name Article name
-        * @param $urlaction String
-        * @return Array
+        * @param string $urlaction
+        * @return array
         */
        static function makeKnownUrlDetails( $name, $urlaction = '' ) {
                $title = Title::newFromText( $name );
@@ -1192,8 +1202,8 @@ abstract class Skin extends ContextSource {
        /**
         * make sure we have some title to operate on
         *
-        * @param $title Title
-        * @param $name string
+        * @param Title $title
+        * @param string $name
         */
        static function checkTitle( &$title, $name ) {
                if ( !is_object( $title ) ) {
@@ -1257,8 +1267,8 @@ abstract class Skin extends ContextSource {
         *
         * This is just a wrapper around addToSidebarPlain() for backwards compatibility
         *
-        * @param $bar array
-        * @param $message String
+        * @param array $bar
+        * @param string $message
         */
        function addToSidebar( &$bar, $message ) {
                $this->addToSidebarPlain( $bar, wfMessage( $message )->inContentLanguage()->plain() );
@@ -1267,9 +1277,9 @@ abstract class Skin extends ContextSource {
        /**
         * Add content from plain text
         * @since 1.17
-        * @param $bar array
-        * @param $text string
-        * @return Array
+        * @param array $bar
+        * @param string $text
+        * @return array
         */
        function addToSidebarPlain( &$bar, $text ) {
                $lines = explode( "\n", $text );
@@ -1375,7 +1385,7 @@ abstract class Skin extends ContextSource {
        /**
         * Gets new talk page messages for the current user and returns an
         * appropriate alert message (or an empty string if there are no messages)
-        * @return String
+        * @return string
         */
        function getNewtalks() {
 
@@ -1467,8 +1477,8 @@ abstract class Skin extends ContextSource {
        /**
         * Get a cached notice
         *
-        * @param string $name message name, or 'default' for $wgSiteNotice
-        * @return String: HTML fragment
+        * @param string $name Message name, or 'default' for $wgSiteNotice
+        * @return string HTML fragment
         */
        private function getCachedNotice( $name ) {
                global $wgRenderHashAppend, $parserMemc, $wgContLang;
@@ -1522,7 +1532,7 @@ abstract class Skin extends ContextSource {
        /**
         * Get a notice based on page's namespace
         *
-        * @return String: HTML fragment
+        * @return string HTML fragment
         */
        function getNamespaceNotice() {
                wfProfileIn( __METHOD__ );
@@ -1542,7 +1552,7 @@ abstract class Skin extends ContextSource {
        /**
         * Get the site notice
         *
-        * @return String: HTML fragment
+        * @return string HTML fragment
         */
        function getSiteNotice() {
                wfProfileIn( __METHOD__ );
@@ -1573,13 +1583,13 @@ abstract class Skin extends ContextSource {
         * Create a section edit link.  This supersedes editSectionLink() and
         * editSectionLinkForOther().
         *
-        * @param $nt Title  The title being linked to (may not be the same as
+        * @param Title $nt The title being linked to (may not be the same as
         *   the current page, if the section is included from a template)
         * @param string $section The designation of the section being pointed to,
         *   to be included in the link, like "&section=$section"
         * @param string $tooltip The tooltip to use for the link: will be escaped
         *   and wrapped in the 'editsectionhint' message
-        * @param $lang string Language code
+        * @param string $lang Language code
         * @return string HTML to use for edit link
         */
        public function doEditSectionLink( Title $nt, $section, $tooltip = null, $lang = false ) {