r102096 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102095‎ | r102096 | r102097 >
Date:14:10, 5 November 2011
Author:reedy
Status:ok
Tags:
Comment:
Partial revert to r101244 due to next() weirdness
Modified paths:
  • /trunk/phase3/includes/MagicWord.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MagicWord.php
@@ -228,6 +228,7 @@
229229
230230 /**
231231 * Get an array of parser substitution modifier IDs
 232+ * @return array
232233 */
233234 static function getSubstIDs() {
234235 return self::$mSubstIDs;
@@ -236,9 +237,10 @@
237238 /**
238239 * Allow external reads of TTL array
239240 *
 241+ * @param $id int
240242 * @return array
241243 */
242 - static function getCacheTTL($id) {
 244+ static function getCacheTTL( $id ) {
243245 if ( array_key_exists( $id, self::$mCacheTTLs ) ) {
244246 return self::$mCacheTTLs[$id];
245247 } else {
@@ -383,7 +385,7 @@
384386 /**
385387 * Returns true if the text contains the word
386388 *
387 - * @paran $text string
 389+ * @param $text string
388390 *
389391 * @return bool
390392 */
@@ -712,7 +714,7 @@
713715 /**
714716 * Get a regex anchored to the start of the string that does not match parameters
715717 *
716 - * @return string
 718+ * @return array
717719 */
718720 function getRegexStart() {
719721 $base = $this->getBaseRegex();
@@ -729,7 +731,7 @@
730732 /**
731733 * Get an anchored regex for matching variables with parameters
732734 *
733 - * @return string
 735+ * @return array
734736 */
735737 function getVariableStartToEndRegex() {
736738 $base = $this->getBaseRegex();
@@ -754,7 +756,7 @@
755757 */
756758 function parseMatch( $m ) {
757759 reset( $m );
758 - foreach ( $m as $key => $value ) {
 760+ while ( list( $key, $value ) = each( $m ) ) {
759761 if ( $key === 0 || $value === '' ) {
760762 continue;
761763 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101244Remove more assignments in conditionals (while each to foreach)reedy02:04, 29 October 2011

Status & tagging log