r51507 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51506‎ | r51507 | r51508 >
Date:16:31, 5 June 2009
Author:simetrical
Status:ok
Tags:
Comment:
Style: "else { if" -> "elseif"
Modified paths:
  • /trunk/extensions/ParserFunctions/ParserFunctions_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php
@@ -160,11 +160,9 @@
161161 if ( $found || $parts[0] == $primary ) {
162162 # Found a match, return now
163163 return $parts[1];
164 - } else {
165 - if ( $mwDefault->matchStartAndRemove( $parts[0] ) ) {
166 - $default = $parts[1];
167 - } # else wrong case, continue
168 - }
 164+ } elseif ( $mwDefault->matchStartAndRemove( $parts[0] ) ) {
 165+ $default = $parts[1];
 166+ } # else wrong case, continue
169167 } elseif ( count( $parts ) == 1 ) {
170168 # Multiple input, single output
171169 # If the value matches, set a flag and continue
@@ -211,11 +209,9 @@
212210 if ( $test == $primary ) {
213211 # Found a match, return now
214212 return trim( $frame->expand( $valueNode ) );
215 - } else {
216 - if ( $mwDefault->matchStartAndRemove( $test ) ) {
217 - $default = $valueNode;
218 - } # else wrong case, continue
219 - }
 213+ } elseif ( $mwDefault->matchStartAndRemove( $test ) ) {
 214+ $default = $valueNode;
 215+ } # else wrong case, continue
220216 }
221217 } else {
222218 # Multiple input, single output

Status & tagging log