Add to documentation
authorSam Reed <reedy@users.mediawiki.org>
Mon, 5 Mar 2012 19:17:55 +0000 (19:17 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 5 Mar 2012 19:17:55 +0000 (19:17 +0000)
Add a couple of braces

Update code calling Language related deprecated code

languages/Language.php
languages/LanguageConverter.php
languages/classes/LanguageKu.php
languages/classes/LanguagePl.php
languages/classes/LanguageSr.php

index ce552e5..3a25dfc 100644 (file)
@@ -158,6 +158,7 @@ class Language {
        /**
         * Create a language object for a given language code
         * @param $code String
+        * @throws MWException
         * @return Language
         */
        protected static function newFromCode( $code ) {
@@ -559,7 +560,7 @@ class Language {
                if ( $usemsg && wfMessage( $msg )->exists() ) {
                        return $this->getMessageFromDB( $msg );
                }
-               $name = self::getLanguageName( $code );
+               $name = self::fetchLanguageName( $code );
                if ( $name ) {
                        return $name; # if it's defined as a language name, show that
                } else {
@@ -2538,6 +2539,7 @@ class Language {
         * @param $file string
         * @param $string string
         *
+        * @throws MWException
         * @return string
         */
        function transformUsingPairFile( $file, $string ) {
@@ -3576,6 +3578,7 @@ class Language {
         * @param $prefix string Prepend this to the filename
         * @param $code string Language code
         * @param $suffix string Append this to the filename
+        * @throws MWException
         * @return string $prefix . $mangledCode . $suffix
         */
        public static function getFileName( $prefix = 'Language', $code, $suffix = '.php' ) {
index 0aaa931..2b9cc8e 100644 (file)
@@ -72,7 +72,7 @@ class LanguageConverter {
                $this->mMainLanguageCode = $maincode;
                $this->mVariants = array_diff( $variants, $wgDisabledVariants );
                $this->mVariantFallbacks = $variantfallbacks;
-               $this->mVariantNames = Language::getLanguageNames();
+               $this->mVariantNames = Language::fetchLanguageNames();
                $this->mCacheKey = wfMemcKey( 'conversiontables', $maincode );
                $defaultflags = array(
                        // 'S' show converted text
@@ -626,6 +626,7 @@ class LanguageConverter {
         * @param $startPos int
         * @param $depth Integer: depth of recursion
         *
+        * @throws MWException
         * @return String: converted text
         */
        protected function recursiveConvertRule( $text, $variant, &$startPos, $depth = 0 ) {
@@ -796,6 +797,7 @@ class LanguageConverter {
         * This method must be implemented in derived class.
         *
         * @private
+        * @throws MWException
         */
        function loadDefaultTables() {
                $name = get_class( $this );
index 92bca09..8f8ea31 100644 (file)
@@ -196,6 +196,7 @@ class KuConverter extends LanguageConverter {
         * @param $text string
         * @param $toVariant bool
         *
+        * @throws MWException
         * @return string
         */
        function translate( $text, $toVariant ) {
index 59c8d5c..b64ee98 100644 (file)
@@ -15,14 +15,16 @@ class LanguagePl extends Language {
                if ( !count( $forms ) ) { return ''; }
                $forms = $this->preConvertPlural( $forms, 3 );
                $count = abs( $count );
-               if ( $count == 1 )
-                       return $forms[0];     // singular
+               if ( $count == 1 ) {
+                       return $forms[0]; // singular
+               }
                switch ( $count % 10 ) {
                        case 2:
                        case 3:
                        case 4:
-                               if ( $count / 10 % 10 != 1 )
+                               if ( $count / 10 % 10 != 1 ) {
                                        return $forms[1]; // plural
+                               }
                        default:
                                return $forms[2];   // plural genitive
                }
index 2e1fb27..1b04cb7 100644 (file)
@@ -147,6 +147,7 @@ class SrConverter extends LanguageConverter {
         * @param $text string
         * @param $toVariant string
         *
+        * @throws MWException
         * @return string
         */
        function translate( $text, $toVariant ) {