Partial revert to r101244 due to next() weirdness
authorSam Reed <reedy@users.mediawiki.org>
Sat, 5 Nov 2011 14:10:50 +0000 (14:10 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 5 Nov 2011 14:10:50 +0000 (14:10 +0000)
includes/MagicWord.php

index 99aca4a..563d3a5 100644 (file)
@@ -228,6 +228,7 @@ class MagicWord {
 
        /**
         * Get an array of parser substitution modifier IDs
+        * @return array
         */
        static function getSubstIDs() {
                return self::$mSubstIDs;
@@ -236,9 +237,10 @@ class MagicWord {
        /**
         * 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 {
@@ -383,7 +385,7 @@ class MagicWord {
        /**
         * Returns true if the text contains the word
         *
-        * @paran $text string
+        * @param $text string
         *
         * @return bool
         */
@@ -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();
@@ -729,7 +731,7 @@ class MagicWordArray {
        /**
         * Get an anchored regex for matching variables with parameters
         *
-        * @return string
+        * @return array
         */
        function getVariableStartToEndRegex() {
                $base = $this->getBaseRegex();
@@ -754,7 +756,7 @@ class MagicWordArray {
         */
        function parseMatch( $m ) {
                reset( $m );
-               foreach ( $m as $key => $value ) {
+               while ( list( $key, $value ) = each( $m ) ) {
                        if ( $key === 0 || $value === '' ) {
                                continue;
                        }