LanguageConverter: Fix @return description
[lhc/web/wiklou.git] / languages / LanguageConverter.php
index a84c4b8..ce35717 100644 (file)
@@ -163,6 +163,8 @@ class LanguageConverter {
 
                $req = $this->getURLVariant();
 
+               Hooks::run( 'GetLangPreferredVariant', [ &$req ] );
+
                if ( $wgUser->isSafeToLoad() && $wgUser->isLoggedIn() && !$req ) {
                        $req = $this->getUserVariant();
                } elseif ( !$req ) {
@@ -222,7 +224,7 @@ class LanguageConverter {
        /**
         * Get the variant specified in the URL
         *
-        * @return mixed Variant if one found, false otherwise.
+        * @return mixed Variant if one found, null otherwise
         */
        public function getURLVariant() {
                global $wgRequest;
@@ -245,7 +247,7 @@ class LanguageConverter {
        /**
         * Determine if the user has a variant set.
         *
-        * @return mixed Variant if one found, false otherwise.
+        * @return mixed Variant if one found, null otherwise
         */
        protected function getUserVariant() {
                global $wgUser, $wgContLang;
@@ -282,7 +284,7 @@ class LanguageConverter {
        /**
         * Determine the language variant from the Accept-Language header.
         *
-        * @return mixed Variant if one found, false otherwise.
+        * @return mixed Variant if one found, null otherwise
         */
        protected function getHeaderVariant() {
                global $wgRequest;
@@ -680,9 +682,8 @@ class LanguageConverter {
 
                $noScript = '<script.*?>.*?<\/script>(*SKIP)(*FAIL)';
                $noStyle = '<style.*?>.*?<\/style>(*SKIP)(*FAIL)';
-               // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
+               // phpcs:ignore Generic.Files.LineLength
                $noHtml = '<(?:[^>=]*+(?>[^>=]*+=\s*+(?:"[^"]*"|\'[^\']*\'|[^\'">\s]*+))*+[^>=]*+>|.*+)(*SKIP)(*FAIL)';
-               // @codingStandardsIgnoreEnd
                while ( $startPos < $length && $continue ) {
                        $continue = preg_match(
                                // Only match -{ outside of html.
@@ -966,11 +967,11 @@ class LanguageConverter {
         * Parse the conversion table stored in the cache.
         *
         * The tables should be in blocks of the following form:
-        *              -{
-        *                      word => word ;
-        *                      word => word ;
-        *                      ...
-        *              }-
+        *              -{
+        *                      word => word ;
+        *                      word => word ;
+        *                      ...
+        *              }-
         *
         * To make the tables more manageable, subpages are allowed
         * and will be parsed recursively if $recursive == true.