r104208 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104207‎ | r104208 | r104209 >
Date:00:15, 25 November 2011
Author:reedy
Status:ok
Tags:
Comment:
"else if" to "elseif"
Modified paths:
  • /trunk/phase3/includes/UserMailer.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllmessages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPasswordReset.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
@@ -12,16 +12,16 @@
1313 $oldCanServer = $wgCanonicalServer;
1414 $wgServer = $server;
1515 $wgCanonicalServer = $canServer;
16 -
 16+
1717 // Fake $_SERVER['HTTPS'] if needed
1818 if ( $httpsMode ) {
1919 $_SERVER['HTTPS'] = 'on';
2020 } else {
2121 unset( $_SERVER['HTTPS'] );
2222 }
23 -
 23+
2424 $this->assertEquals( $fullUrl, wfExpandUrl( $shortUrl, $defaultProto ), $message );
25 -
 25+
2626 // Restore $wgServer and $wgCanonicalServer
2727 $wgServer = $oldServer;
2828 $wgCanonicalServer = $oldCanServer;
@@ -36,7 +36,7 @@
3737 $modes = array( 'http', 'https' );
3838 $servers = array( 'http' => 'http://example.com', 'https' => 'https://example.com', 'protocol-relative' => '//example.com' );
3939 $defaultProtos = array( 'http' => PROTO_HTTP, 'https' => PROTO_HTTPS, 'protocol-relative' => PROTO_RELATIVE, 'current' => PROTO_CURRENT, 'canonical' => PROTO_CANONICAL );
40 -
 40+
4141 $retval = array();
4242 foreach ( $modes as $mode ) {
4343 $httpsMode = $mode == 'https';
@@ -48,14 +48,14 @@
4949 $retval[] = array( 'https://example.com', 'https://example.com', $defaultProto, $server, $canServer, $httpsMode, "Testing fully qualified https URLs (no need to expand) (defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" );
5050 # Would be nice to support this, see fixme on wfExpandUrl()
5151 $retval[] = array( "wiki/FooBar", 'wiki/FooBar', $defaultProto, $server, $canServer, $httpsMode, "Test non-expandable relative URLs (defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" );
52 -
 52+
5353 // Determine expected protocol
5454 $p = $protoDesc . ':'; // default case
5555 if ( $protoDesc == 'protocol-relative' ) {
5656 $p = '';
57 - } else if ( $protoDesc == 'current' ) {
 57+ } elseif ( $protoDesc == 'current' ) {
5858 $p = "$mode:";
59 - } else if ( $protoDesc == 'canonical' ) {
 59+ } elseif ( $protoDesc == 'canonical' ) {
6060 $p = "$canServerMode:";
6161 } else {
6262 $p = $protoDesc . ':';
@@ -63,12 +63,12 @@
6464 // Determine expected server name
6565 if ( $protoDesc == 'canonical' ) {
6666 $srv = $canServer;
67 - } else if ( $serverDesc == 'protocol-relative' ) {
 67+ } elseif ( $serverDesc == 'protocol-relative' ) {
6868 $srv = $p . $server;
6969 } else {
7070 $srv = $server;
7171 }
72 -
 72+
7373 $retval[] = array( "$p//wikipedia.org", '//wikipedia.org', $defaultProto, $server, $canServer, $httpsMode, "Test protocol-relative URL (defaultProto: $protoDesc, wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" );
7474 $retval[] = array( "$srv/wiki/FooBar", '/wiki/FooBar', $defaultProto, $server, $canServer, $httpsMode, "Testing expanding URL beginning with / (defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" );
7575 }
Index: trunk/phase3/includes/UserMailer.php
@@ -197,7 +197,7 @@
198198 $ret = wfRunHooks( 'AlternateUserMailer', array( $headers, $to, $from, $subject, $body ) );
199199 if ( $ret === false ) {
200200 return Status::newGood();
201 - } else if ( $ret !== true ) {
 201+ } elseif ( $ret !== true ) {
202202 return Status::newFatal( 'php-mail-error', $ret );
203203 }
204204
Index: trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php
@@ -168,7 +168,7 @@
169169 }
170170 // Modules with a group but no foreign source pass four arguments (name, timestamp, dependencies, group)
171171 // to mw.loader.register()
172 - else if ( $module->getSource() === 'local' ) {
 172+ elseif ( $module->getSource() === 'local' ) {
173173 $registrations[] = array(
174174 $name, $mtime, $module->getDependencies(), $module->getGroup() );
175175 }
Index: trunk/phase3/includes/specials/SpecialAllmessages.php
@@ -411,7 +411,7 @@
412412 function getCellAttrs( $field, $value ){
413413 if( $this->mCurrentRow->am_customised && $field == 'am_title' ){
414414 return array( 'rowspan' => '2', 'class' => $field );
415 - } else if( $field == 'am_title' ) {
 415+ } elseif( $field == 'am_title' ) {
416416 return array( 'class' => $field );
417417 } else {
418418 return array( 'lang' => $this->langcode, 'dir' => $this->lang->getDir(), 'class' => $field );
Index: trunk/phase3/includes/specials/SpecialPasswordReset.php
@@ -50,7 +50,7 @@
5151 $error = $this->canChangePassword( $user );
5252 if ( is_string( $error ) ) {
5353 throw new ErrorPageError( 'internalerror', $error );
54 - } else if ( !$error ) {
 54+ } elseif ( !$error ) {
5555 throw new ErrorPageError( 'internalerror', 'resetpass_forbidden' );
5656 }
5757
@@ -280,7 +280,7 @@
281281
282282 $this->getOutput()->addHTML( Html::rawElement( 'pre', array(), $this->email->escaped() ) );
283283 }
284 -
 284+
285285 $this->getOutput()->addWikiMsg( 'passwordreset-emailsent' );
286286 $this->getOutput()->returnToMain();
287287 }
Index: trunk/phase3/languages/classes/LanguageSr.php
@@ -191,7 +191,7 @@
192192
193193 if( $variant == 'sr-ec' ) {
194194 return (boolean) ($numCyrillic > $numLatin);
195 - } else if( $variant == 'sr-el' ) {
 195+ } elseif( $variant == 'sr-el' ) {
196196 return (boolean) ($numLatin > $numCyrillic);
197197 } else {
198198 return false;

Status & tagging log