Followup r102785: fix typo in index name. Thanks to Platonides and his special page...
[lhc/web/wiklou.git] / includes / MagicWord.php
index 663d7a7..563d3a5 100644 (file)
@@ -197,13 +197,11 @@ class MagicWord {
         * @return MagicWord
         */
        static function &get( $id ) {
-               wfProfileIn( __METHOD__ );
                if ( !isset( self::$mObjects[$id] ) ) {
                        $mw = new MagicWord();
                        $mw->load( $id );
                        self::$mObjects[$id] = $mw;
                }
-               wfProfileOut( __METHOD__ );
                return self::$mObjects[$id];
        }
 
@@ -230,17 +228,19 @@ class MagicWord {
 
        /**
         * Get an array of parser substitution modifier IDs
+        * @return array
         */
        static function getSubstIDs() {
-               return self::$mSubstIDs; 
+               return self::$mSubstIDs;
        }
 
        /**
         * Allow external reads of TTL array
         *
+        * @param $id int
         * @return array
         */
-       static function getCacheTTL($id) {
+       static function getCacheTTL( $id ) {
                if ( array_key_exists( $id, self::$mCacheTTLs ) ) {
                        return self::$mCacheTTLs[$id];
                } else {
@@ -251,7 +251,7 @@ class MagicWord {
        /**
         * Get a MagicWordArray of double-underscore entities
         *
-        * @return array
+        * @return MagicWordArray
         */
        static function getDoubleUnderscoreArray() {
                if ( is_null( self::$mDoubleUnderscoreArray ) ) {
@@ -275,6 +275,7 @@ class MagicWord {
         */
        function load( $id ) {
                global $wgContLang;
+               wfProfileIn( __METHOD__ );
                $this->mId = $id;
                $wgContLang->getMagic( $this );
                if ( !$this->mSynonyms ) {
@@ -282,6 +283,7 @@ class MagicWord {
                        #throw new MWException( "Error: invalid magic word '$id'" );
                        wfDebugLog( 'exception', "Error: invalid magic word '$id'\n" );
                }
+               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -309,8 +311,8 @@ class MagicWord {
        }
 
        /**
-        * A comparison function that returns -1, 0 or 1 depending on whether the 
-        * first string is longer, the same length or shorter than the second 
+        * A comparison function that returns -1, 0 or 1 depending on whether the
+        * first string is longer, the same length or shorter than the second
         * string.
         *
         * @param $s1 string
@@ -383,7 +385,7 @@ class MagicWord {
        /**
         * Returns true if the text contains the word
         *
-        * @paran $text string
+        * @param $text string
         *
         * @return bool
         */
@@ -633,7 +635,7 @@ class MagicWordArray {
        /**
         * Add a number of magic words by name
         *
-        * $param $names array
+        * @param $names array
         */
        public function addArray( $names ) {
                $this->names = array_merge( $this->names, array_values( $names ) );
@@ -712,7 +714,7 @@ class MagicWordArray {
        /**
         * Get a regex anchored to the start of the string that does not match parameters
         *
-        * @return string
+        * @return array
         */
        function getRegexStart() {
                $base = $this->getBaseRegex();
@@ -721,7 +723,7 @@ class MagicWordArray {
                        $newRegex[0] = "/^(?:{$base[0]})/iuS";
                }
                if ( $base[1] !== '' ) {
-                       $newRegex[1] = "/^(?:{$base[1]})/S"; 
+                       $newRegex[1] = "/^(?:{$base[1]})/S";
                }
                return $newRegex;
        }
@@ -729,7 +731,7 @@ class MagicWordArray {
        /**
         * Get an anchored regex for matching variables with parameters
         *
-        * @return string
+        * @return array
         */
        function getVariableStartToEndRegex() {
                $base = $this->getBaseRegex();
@@ -748,7 +750,7 @@ class MagicWordArray {
         * Returns array(magic word ID, parameter value)
         * If there is no parameter value, that element will be false.
         *
-        * @param $m arrray
+        * @param $m array
         *
         * @return array
         */