Merge "Migrate block log to new log system"
[lhc/web/wiklou.git] / languages / LanguageConverter.php
index b3a4c1a..43d6063 100644 (file)
@@ -54,7 +54,7 @@ class LanguageConverter {
        public $mManualLevel;
 
        /**
-        * @var string memcached key name
+        * @var string Memcached key name
         */
        public $mCacheKey;
 
@@ -336,20 +336,17 @@ class LanguageConverter {
         * @return string The converted text
         */
        public function autoConvert( $text, $toVariant = false ) {
-               wfProfileIn( __METHOD__ );
 
                $this->loadTables();
 
                if ( !$toVariant ) {
                        $toVariant = $this->getPreferredVariant();
                        if ( !$toVariant ) {
-                               wfProfileOut( __METHOD__ );
                                return $text;
                        }
                }
 
                if ( $this->guessVariant( $text, $toVariant ) ) {
-                       wfProfileOut( __METHOD__ );
                        return $text;
                }
 
@@ -446,7 +443,6 @@ class LanguageConverter {
                        $literalIter->next();
                }
 
-               wfProfileOut( __METHOD__ );
                return $output;
        }
 
@@ -460,14 +456,12 @@ class LanguageConverter {
         * @return string Translated text
         */
        public function translate( $text, $variant ) {
-               wfProfileIn( __METHOD__ );
                // If $text is empty or only includes spaces, do nothing
                // Otherwise translate it
                if ( trim( $text ) ) {
                        $this->loadTables();
                        $text = $this->mTables[$variant]->replace( $text );
                }
-               wfProfileOut( __METHOD__ );
                return $text;
        }
 
@@ -478,7 +472,6 @@ class LanguageConverter {
         * @return array Variant => converted text
         */
        public function autoConvertToAllVariants( $text ) {
-               wfProfileIn( __METHOD__ );
                $this->loadTables();
 
                $ret = array();
@@ -486,7 +479,6 @@ class LanguageConverter {
                        $ret[$variant] = $this->translate( $text, $variant );
                }
 
-               wfProfileOut( __METHOD__ );
                return $ret;
        }
 
@@ -737,12 +729,12 @@ class LanguageConverter {
         * If a language supports multiple variants, it is possible that
         * non-existing link in one variant actually exists in another variant.
         * This function tries to find it. See e.g. LanguageZh.php
+        * The input parameters may be modified upon return
         *
-        * @param string $link The name of the link
-        * @param mixed $nt The title object of the link
+        * @param string &$link The name of the link
+        * @param Title &$nt The title object of the link
         * @param bool $ignoreOtherCond To disable other conditions when
         *   we need to transclude a template or update a category's link
-        * @return void Null, the input parameters may be modified upon return
         */
        public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
                # If the article has already existed, there is no need to
@@ -856,7 +848,6 @@ class LanguageConverter {
                        return;
                }
 
-               wfProfileIn( __METHOD__ );
                $this->mTablesLoaded = true;
                $this->mTables = false;
                if ( $fromCache ) {
@@ -881,7 +872,6 @@ class LanguageConverter {
                        $wgLangConvMemc->set( $this->mCacheKey, $this->mTables, 43200 );
                        wfProfileOut( __METHOD__ . '-recache' );
                }
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -1102,6 +1092,7 @@ class LanguageConverter {
 
        /**
         * Get the cached separator pattern for ConverterRule::parseRules()
+        * @return string
         */
        function getVarSeparatorPattern() {
                if ( is_null( $this->mVarSeparatorPattern ) ) {