Swap else if for elseif
authorSam Reed <reedy@users.mediawiki.org>
Fri, 17 Jun 2011 16:05:35 +0000 (16:05 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 17 Jun 2011 16:05:35 +0000 (16:05 +0000)
Trimming trailing whitespace also

Doing in 3 commits (3/3), so hopefully reviewable in CR...

21 files changed:
includes/Title.php
includes/User.php
includes/WebRequest.php
includes/Wiki.php
includes/Xml.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUnlockdb.php
languages/Language.php
languages/classes/LanguageEo.php
languages/classes/LanguageSr.php
languages/classes/LanguageWa.php
maintenance/Maintenance.php
maintenance/fuzz-tester.php
maintenance/importImages.php
maintenance/language/checkDupeMessages.php
maintenance/populateLogSearch.php
maintenance/updateRestrictions.php
tests/RunSeleniumTests.php
tests/parser/parserTestsStaticParserHook.php
tests/phpunit/includes/TitlePermissionTest.php

index 441f291..d06b322 100644 (file)
@@ -1283,13 +1283,13 @@ class Title {
                if ( is_array( $result ) && count( $result ) && !is_array( $result[0] ) ) {
                        // A single array representing an error
                        $errors[] = $result;
-               } else if ( is_array( $result ) && is_array( $result[0] ) ) {
+               } elseif ( is_array( $result ) && is_array( $result[0] ) ) {
                        // A nested array representing multiple errors
                        $errors = array_merge( $errors, $result );
-               } else if ( $result !== '' && is_string( $result ) ) {
+               } elseif ( $result !== '' && is_string( $result ) ) {
                        // A string representing a message-id
                        $errors[] = array( $result );
-               } else if ( $result === false ) {
+               } elseif ( $result === false ) {
                        // a generic "We don't want them to do that"
                        $errors[] = array( 'badaccess-group0' );
                }
@@ -1377,7 +1377,7 @@ class Title {
                                && !preg_match( '/^' . preg_quote( $user->getName(), '/' ) . '\//', $this->mTextform ) ) {
                        if ( $this->isCssSubpage() && !$user->isAllowed( 'editusercss' ) ) {
                                $errors[] = array( 'customcssprotected' );
-                       } else if ( $this->isJsSubpage() && !$user->isAllowed( 'edituserjs' ) ) {
+                       } elseif ( $this->isJsSubpage() && !$user->isAllowed( 'edituserjs' ) ) {
                                $errors[] = array( 'customjsprotected' );
                        }
                }
@@ -2022,7 +2022,7 @@ class Title {
 
                if ( isset( $this->mCascadeSources ) && $getPages ) {
                        return array( $this->mCascadeSources, $this->mCascadingRestrictions );
-               } else if ( isset( $this->mHasCascadingRestrictions ) && !$getPages ) {
+               } elseif ( isset( $this->mHasCascadingRestrictions ) && !$getPages ) {
                        return array( $this->mHasCascadingRestrictions, $pagerestrictions );
                }
 
@@ -2617,7 +2617,7 @@ class Title {
                                                if ( $wgContLang->getNsIndex( $x[1] ) ) {
                                                        # Disallow Talk:File:x type titles...
                                                        return false;
-                                               } else if ( Interwiki::isValidInterwiki( $x[1] ) ) {
+                                               } elseif ( Interwiki::isValidInterwiki( $x[1] ) ) {
                                                        # Disallow Talk:Interwiki:x type titles...
                                                        return false;
                                                }
@@ -3163,7 +3163,7 @@ class Title {
                $u->doUpdate();
 
                $dbw->commit();
-               
+
                # Update site_stats
                if ( $this->isContentPage() && !$nt->isContentPage() ) {
                        # No longer a content page
@@ -3656,7 +3656,7 @@ class Title {
         * @return String: MW timestamp
         */
        public function getEarliestRevTime( $flags = 0 ) {
-               $rev = $this->getFirstRevision( $flags );       
+               $rev = $this->getFirstRevision( $flags );
                return $rev ? $rev->getTimestamp() : null;
        }
 
index d21693a..80c2962 100644 (file)
@@ -925,7 +925,7 @@ class User {
                                return false;
                        }
                        $wgRequest->setSessionData( 'wsUserID', $sId );
-               } else if ( $sessId !== null && $sessId != 0 ) {
+               } elseif ( $sessId !== null && $sessId != 0 ) {
                        $sId = $sessId;
                } else {
                        $this->loadDefaults();
@@ -934,7 +934,7 @@ class User {
 
                if ( $wgRequest->getSessionData( 'wsUserName' ) !== null ) {
                        $sName = $wgRequest->getSessionData( 'wsUserName' );
-               } else if ( $wgRequest->getCookie( 'UserName' ) !== null ) {
+               } elseif ( $wgRequest->getCookie( 'UserName' ) !== null ) {
                        $sName = $wgRequest->getCookie( 'UserName' );
                        $wgRequest->setSessionData( 'wsUserName', $sName );
                } else {
@@ -959,7 +959,7 @@ class User {
                if ( $wgRequest->getSessionData( 'wsToken' ) !== null ) {
                        $passwordCorrect = $proposedUser->getToken() === $wgRequest->getSessionData( 'wsToken' );
                        $from = 'session';
-               } else if ( $wgRequest->getCookie( 'Token' ) !== null ) {
+               } elseif ( $wgRequest->getCookie( 'Token' ) !== null ) {
                        $passwordCorrect = $proposedUser->getToken() === $wgRequest->getCookie( 'Token' );
                        $from = 'cookie';
                } else {
@@ -1492,7 +1492,7 @@ class User {
                // User is already an IP?
                if( IP::isIPAddress( $this->getName() ) ) {
                        $ip = $this->getName();
-               } else if( !$ip ) {
+               } elseif( !$ip ) {
                        $ip = wfGetIP();
                }
                $blocked = false;
index 5a883eb..b338261 100644 (file)
@@ -806,7 +806,7 @@ class WebRequest {
        }
 
        /**
-        * Check if Internet Explorer will detect an incorrect cache extension in 
+        * Check if Internet Explorer will detect an incorrect cache extension in
         * PATH_INFO or QUERY_STRING. If the request can't be allowed, show an error
         * message or redirect to a safer URL. Returns true if the URL is OK, and
         * false if an error message has been shown and the request should be aborted.
@@ -825,14 +825,14 @@ class WebRequest {
                        }
                        wfHttpError( 403, 'Forbidden',
                                'Invalid file extension found in the path info or query string.' );
-                       
+
                        return false;
                }
                return true;
        }
 
        /**
-        * Attempt to redirect to a URL with a QUERY_STRING that's not dangerous in 
+        * Attempt to redirect to a URL with a QUERY_STRING that's not dangerous in
         * IE 6. Returns true if it was successful, false otherwise.
         */
        protected function doSecurityRedirect( $url ) {
@@ -847,11 +847,11 @@ class WebRequest {
 <body>
 <h1>Security redirect</h1>
 <p>
-We can't serve non-HTML content from the URL you have requested, because 
+We can't serve non-HTML content from the URL you have requested, because
 Internet Explorer would interpret it as an incorrect and potentially dangerous
 content type.</p>
-<p>Instead, please use <a href="$encUrl">this URL</a>, which is the same as the URL you have requested, except that 
-"&amp;*" is appended. This prevents Internet Explorer from seeing a bogus file 
+<p>Instead, please use <a href="$encUrl">this URL</a>, which is the same as the URL you have requested, except that
+"&amp;*" is appended. This prevents Internet Explorer from seeing a bogus file
 extension.
 </p>
 </body>
@@ -877,7 +877,7 @@ HTML;
         * QUERY_STRING, since IE 6 and earlier will use this to get the file type
         * if there was no dot before the question mark (bug 28235).
         *
-        * @deprecated Use checkUrlExtension(). 
+        * @deprecated Use checkUrlExtension().
         */
        public function isPathInfoBad( $extWhitelist = array() ) {
                global $wgScriptExtension;
@@ -916,7 +916,7 @@ HTML;
                foreach ( $langs as $lang => $val ) {
                        if ( $val === '' ) {
                                $langs[$lang] = 1;
-                       } else if ( $val == 0 ) {
+                       } elseif ( $val == 0 ) {
                                unset($langs[$lang]);
                        }
                }
index 8e71aac..3a1d881 100644 (file)
@@ -126,10 +126,10 @@ class MediaWiki {
                // If the user is not logged in, the Namespace:title of the article must be in
                // the Read array in order for the user to see it. (We have to check here to
                // catch special pages etc. We check again in Article::view())
-               } else if ( !$title->userCanRead() ) {
+               } elseif ( !$title->userCanRead() ) {
                        $output->loginToUse();
                // Interwiki redirects
-               } else if ( $title->getInterwiki() != '' ) {
+               } elseif ( $title->getInterwiki() != '' ) {
                        $rdfrom = $request->getVal( 'rdfrom' );
                        if ( $rdfrom ) {
                                $url = $title->getFullURL( 'rdfrom=' . urlencode( $rdfrom ) );
@@ -148,7 +148,7 @@ class MediaWiki {
                                throw new ErrorPageError( 'badtitle', 'badtitletext' );
                        }
                // Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant
-               } else if ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted()
+               } elseif ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted()
                        && ( $request->getVal( 'title' ) === null || $title->getPrefixedDBKey() != $request->getVal( 'title' ) )
                        && !count( array_diff( array_keys( $request->getValues() ), array( 'action', 'title' ) ) ) )
                {
@@ -186,7 +186,7 @@ class MediaWiki {
                                $output->redirect( $targetUrl, '301' );
                        }
                // Special pages
-               } else if ( NS_SPECIAL == $title->getNamespace() ) {
+               } elseif ( NS_SPECIAL == $title->getNamespace() ) {
                        // actions that need to be made when we have a special pages
                        SpecialPageFactory::executePath( $title, $this->context );
                } else {
index e25d436..b0b0938 100644 (file)
@@ -191,7 +191,7 @@ class Xml {
                }
                if( $year ) {
                        $encYear = intval( $year );
-               } else if( $encMonth ) {
+               } elseif( $encMonth ) {
                        $thisMonth = intval( gmdate( 'n' ) );
                        $thisYear = intval( gmdate( 'Y' ) );
                        if( intval($encMonth) > $thisMonth ) {
@@ -351,9 +351,9 @@ class Xml {
         * Convenience function to build an HTML form label
         * @param $label String text of the label
         * @param $id
-        * @param $attribs Array an attribute array.  This will usuall be 
+        * @param $attribs Array an attribute array.  This will usuall be
         *     the same array as is passed to the corresponding input element,
-        *     so this function will cherry-pick appropriate attributes to 
+        *     so this function will cherry-pick appropriate attributes to
         *     apply to the label as well; currently only class is applied.
         * @return string HTML
         */
@@ -646,8 +646,8 @@ class Xml {
        }
 
        /**
-        * Create a call to a JavaScript function. The supplied arguments will be 
-        * encoded using Xml::encodeJsVar(). 
+        * Create a call to a JavaScript function. The supplied arguments will be
+        * encoded using Xml::encodeJsVar().
         *
         * @param $name String The name of the function to call, or a JavaScript expression
         *    which evaluates to a function object which is called.
@@ -904,8 +904,8 @@ class XmlSelect {
 }
 
 /**
- * A wrapper class which causes Xml::encodeJsVar() and Xml::encodeJsCall() to 
- * interpret a given string as being a JavaScript expression, instead of string 
+ * A wrapper class which causes Xml::encodeJsVar() and Xml::encodeJsCall() to
+ * interpret a given string as being a JavaScript expression, instead of string
  * data.
  *
  * Example:
index 1798b64..9922602 100644 (file)
@@ -116,7 +116,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                if( !$user->isAllowed( 'deletedhistory' ) ) {
                        $output->permissionRequired( 'deletedhistory' );
                        return;
-               } else if( wfReadOnly() ) {
+               } elseif( wfReadOnly() ) {
                        $output->readOnlyPage();
                        return;
                }
@@ -588,7 +588,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                foreach( $bitPars as $const => $val ) {
                        if( $val == 1 ) {
                                $newBits |= $const; // $const is the *_deleted const
-                       } else if( $val == -1 ) {
+                       } elseif( $val == -1 ) {
                                $newBits |= ($oldfield & $const); // use existing
                        }
                }
index 028b28d..943de94 100644 (file)
@@ -691,7 +691,7 @@ class SpecialUndelete extends SpecialPage {
                        if ( !$file->exists() ) {
                                $wgOut->addWikiMsg( 'filedelete-nofile', $this->mFilename );
                                return;
-                       } else if( !$file->userCan( File::DELETED_FILE ) ) {
+                       } elseif( !$file->userCan( File::DELETED_FILE ) ) {
                                if( $file->isDeleted( File::DELETED_RESTRICTED ) ) {
                                        $wgOut->permissionRequired( 'suppressrevision' );
                                } else {
@@ -1253,7 +1253,7 @@ class SpecialUndelete extends SpecialPage {
                        if( !$rev->userCan( Revision::DELETED_TEXT ) ) {
                                $pageLink = htmlspecialchars( $wgLang->timeanddate( $ts, true ) );
                                $last = wfMsgHtml( 'diff' );
-                       } else if( $remaining > 0 || ( $earliestLiveTime && $ts > $earliestLiveTime ) ) {
+                       } elseif( $remaining > 0 || ( $earliestLiveTime && $ts > $earliestLiveTime ) ) {
                                $pageLink = $this->getPageLink( $rev, $titleObj, $ts, $sk );
                                $last = $sk->linkKnown(
                                        $titleObj,
index 88cd50e..5fbf38a 100644 (file)
@@ -48,7 +48,7 @@ class SpecialUnlockdb extends SpecialPage {
 
                if ( $action == 'success' ) {
                        $this->showSuccess();
-               } else if ( $action == 'submit' && $wgRequest->wasPosted() &&
+               } elseif ( $action == 'submit' && $wgRequest->wasPosted() &&
                        $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
                        $this->doSubmit();
                } else {
index cc0062b..7ada2ca 100644 (file)
@@ -778,7 +778,7 @@ class Language {
                        if ( isset( $wgLocalTZoffset ) ) {
                                $minDiff = $wgLocalTZoffset;
                        }
-               } else if ( $data[0] == 'Offset' ) {
+               } elseif ( $data[0] == 'Offset' ) {
                        $minDiff = intval( $data[1] );
                } else {
                        $data = explode( ':', $tz );
@@ -1469,9 +1469,9 @@ class Language {
                $c = intval( ( $Mar + 3 * ( $year - 1 ) + 5 * $b + 5 ) % 7 );
                if ( $c == 0 && $a > 11 && $m >= 0.89772376543210 ) {
                        $Mar++;
-               } else if ( $c == 1 && $a > 6 && $m >= 0.63287037037037 ) {
+               } elseif ( $c == 1 && $a > 6 && $m >= 0.63287037037037 ) {
                        $Mar += 2;
-               } else if ( $c == 2 || $c == 4 || $c == 6 ) {
+               } elseif ( $c == 2 || $c == 4 || $c == 6 ) {
                        $Mar++;
                }
 
@@ -1501,12 +1501,12 @@ class Language {
                        # Add 543 years to the Gregorian calendar
                        # Months and days are identical
                        $gy_offset = $gy + 543;
-               } else if ( ( !strcmp( $cName, 'minguo' ) ) || !strcmp( $cName, 'juche' ) ) {
+               } elseif ( ( !strcmp( $cName, 'minguo' ) ) || !strcmp( $cName, 'juche' ) ) {
                        # Minguo dates
                        # Deduct 1911 years from the Gregorian calendar
                        # Months and days are identical
                        $gy_offset = $gy - 1911;
-               } else if ( !strcmp( $cName, 'tenno' ) ) {
+               } elseif ( !strcmp( $cName, 'tenno' ) ) {
                        # Nengō dates up to Meiji period
                        # Deduct years from the Gregorian calendar
                        # depending on the nengo periods
@@ -1519,7 +1519,7 @@ class Language {
                                        $gy_offset = '元';
                                }
                                $gy_offset = '明治' . $gy_offset;
-                       } else if (
+                       } elseif (
                                ( ( $gy == 1912 ) && ( $gm == 7 ) && ( $gd == 31 ) ) ||
                                ( ( $gy == 1912 ) && ( $gm >= 8 ) ) ||
                                ( ( $gy > 1912 ) && ( $gy < 1926 ) ) ||
@@ -1534,7 +1534,7 @@ class Language {
                                        $gy_offset = '元';
                                }
                                $gy_offset = '大正' . $gy_offset;
-                       } else if (
+                       } elseif (
                                ( ( $gy == 1926 ) && ( $gm == 12 ) && ( $gd >= 26 ) ) ||
                                ( ( $gy > 1926 ) && ( $gy < 1989 ) ) ||
                                ( ( $gy == 1989 ) && ( $gm == 1 ) && ( $gd < 8 ) )
@@ -2586,7 +2586,7 @@ class Language {
                        for ( $i = $m; $i >= 0; $i-- ) {
                                if ( $i == $m ) {
                                        $s = $l[$i];
-                               } else if ( $i == $m - 1 ) {
+                               } elseif ( $i == $m - 1 ) {
                                        $s = $l[$i] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $s;
                                } else {
                                        $s = $l[$i] . $this->getMessageFromDB( 'comma-separator' ) . $s;
@@ -2898,7 +2898,7 @@ class Language {
                if ( $tag != '' ) {
                        if ( $tagType == 0 && $lastCh != '/' ) {
                                $openTags[] = $tag; // tag opened (didn't close itself)
-                       } else if ( $tagType == 1 ) {
+                       } elseif ( $tagType == 1 ) {
                                if ( $openTags && $tag == $openTags[count( $openTags ) - 1] ) {
                                        array_pop( $openTags ); // tag closed
                                }
index 07fe6fd..af058a3 100644 (file)
@@ -42,7 +42,7 @@ class LanguageEo extends Language {
                        return preg_replace_callback (
                                '/([cghjsu]x?)((?:xx)*)(?!x)/i',
                                array( $this, 'strrtxuCallback' ), $string      );
-               } else if ( strcasecmp( $in, 'UTF-8' ) == 0 && strcasecmp( $out, 'x' ) == 0 ) {
+               } elseif ( strcasecmp( $in, 'UTF-8' ) == 0 && strcasecmp( $out, 'x' ) == 0 ) {
                        # Double Xs only if they follow cxapelutaj literoj.
                        return preg_replace_callback(
                                '/((?:[cghjsu]|\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]|\xc5[\x9c\x9d\xac\xad])x*)/i',
index 466887d..2c1f7ac 100644 (file)
@@ -191,7 +191,7 @@ class SrConverter extends LanguageConverter {
 
                if( $variant == 'sr-ec' ) {
                        return $numCyrillic > $numLatin;
-               } else if( $variant == 'sr-el' ) {
+               } elseif( $variant == 'sr-el' ) {
                        return $numLatin > $numCyrillic;
                } else {
                        return false;
index 25e52ae..4a18663 100644 (file)
@@ -62,10 +62,10 @@ class LanguageWa extends Language {
                if ( $n == 1 ) {
                    $d = "1î d' " . $this->getMonthName( $m ) .
                        " " .  substr( $ts, 0, 4 );
-               } else if ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
+               } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
                    $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
                        " " .  substr( $ts, 0, 4 );
-               } else if ( $m == 4 || $m == 8 || $m == 10 ) {
+               } elseif ( $m == 4 || $m == 8 || $m == 10 ) {
                    $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
                        " " .  substr( $ts, 0, 4 );
                } else {
index 7aff84d..aac62e0 100644 (file)
@@ -933,7 +933,7 @@ abstract class Maintenance {
 
                if ( isset( $this->mOptions['conf'] ) ) {
                        $settingsFile = $this->mOptions['conf'];
-               } else if ( defined("MW_CONFIG_FILE") ) {
+               } elseif ( defined("MW_CONFIG_FILE") ) {
                        $settingsFile = MW_CONFIG_FILE;
                } else {
                        $settingsFile = "$IP/LocalSettings.php";
index aadb935..18af4de 100644 (file)
@@ -823,7 +823,7 @@ class wikiFuzz {
        static private function stringEscape( $matches ) {
                return sprintf( "\\x%02x", ord( $matches[1] ) );
        }
-       
+
        /**
         ** Strips out the stuff that Mediawiki balks at in a page's title.
         **        Implementation copied/pasted from cleanupTable.inc & cleanupImages.php
@@ -1369,7 +1369,7 @@ class viewPageTest extends pageTest {
 
                // Tidy does not know how to valid atom or rss, so exclude from testing for the time being.
                if ( $this->params["feed"] == "atom" )     { unset( $this->params["feed"] ); }
-               else if ( $this->params["feed"] == "rss" ) { unset( $this->params["feed"] ); }
+               elseif ( $this->params["feed"] == "rss" ) { unset( $this->params["feed"] ); }
 
                // Raw pages cannot really be validated
                if ( $this->params["action"] == "raw" ) unset( $this->params["action"] );
@@ -1416,7 +1416,7 @@ class specialNewpagesPageTest extends pageTest {
 
                // Tidy does not know how to valid atom or rss, so exclude from testing for the time being.
                if ( $this->params["feed"] == "atom" )     { unset( $this->params["feed"] ); }
-               else if ( $this->params["feed"] == "rss" ) { unset( $this->params["feed"] ); }
+               elseif ( $this->params["feed"] == "rss" ) { unset( $this->params["feed"] ); }
        }
 }
 
@@ -2702,7 +2702,7 @@ if ( !is_dir( DIRECTORY ) ) {
        mkdir ( DIRECTORY, 0700 );
 }
 // otherwise, we first retest the things that we have found in previous runs
-else if ( RERUN_OLD_TESTS ) {
+elseif ( RERUN_OLD_TESTS ) {
        rerunPreviousTests();
 }
 
@@ -2750,7 +2750,7 @@ for ( $count = 0; true; $count++ ) {
                }
                saveTest( $test, $testname );
                $num_errors += 1;
-       } else if ( KEEP_PASSED_TESTS ) {
+       } elseif ( KEEP_PASSED_TESTS ) {
                // print current time, with microseconds (matches "strace" format), and the test name.
                print " " . date( "H:i:s." ) . substr( current( explode( " ", microtime() ) ), 2 ) . " " . $testname;
                saveTest( $test, $testname );
index 47dc3cc..f3b10ea 100644 (file)
@@ -96,7 +96,7 @@ if ( count( $args ) > 0 ) {
                        die( "failed to read comment file: {$options['comment-file']}\n" );
                }
        }
-       else if ( isset( $options['comment'] ) ) {
+       elseif ( isset( $options['comment'] ) ) {
                $comment =  $options['comment'];
        }
 
@@ -241,7 +241,7 @@ if ( count( $args ) > 0 ) {
 
                        if ( isset( $options['dry'] ) ) {
                                echo( "done.\n" );
-                       } else if ( $image->recordUpload( $archive->value, $commentText, $license ) ) {
+                       } elseif ( $image->recordUpload( $archive->value, $commentText, $license ) ) {
                                # We're done!
                                echo( "done.\n" );
                                if ( $doProtect ) {
index 5c79fe1..ea5b187 100644 (file)
@@ -34,9 +34,9 @@ if ( isset( $options['lang'] ) && isset( $options['clang'] ) ) {
        } else {
                if ( !strcmp( $options['mode'], 'wiki' ) ) {
                        $runMode = 'wiki';
-               } else if ( !strcmp( $options['mode'], 'php' ) ) {
+               } elseif ( !strcmp( $options['mode'], 'php' ) ) {
                        $runMode = 'php';
-               } else if ( !strcmp( $options['mode'], 'raw' ) ) {
+               } elseif ( !strcmp( $options['mode'], 'raw' ) ) {
                        $runMode = 'raw';
                } else {
                }
@@ -77,7 +77,7 @@ if ( $runTest ) {
 if ( $run ) {
        if ( !strcmp( $runMode, 'wiki' ) ) {
                $runMode = 'wiki';
-       } else if ( !strcmp( $runMode, 'raw' ) ) {
+       } elseif ( !strcmp( $runMode, 'raw' ) ) {
                $runMode = 'raw';
        }
        include( $messagesFile );
@@ -102,9 +102,9 @@ if ( $run ) {
                                        if ( ( !strcmp( $key, $ckey ) ) && ( !strcmp( $value, $cvalue ) ) ) {
                                                if ( !strcmp( $runMode, 'raw' ) ) {
                                                        print( "$key\n" );
-                                               } else if ( !strcmp( $runMode, 'php' ) ) {
+                                               } elseif ( !strcmp( $runMode, 'php' ) ) {
                                                        print( "'$key' => '',\n" );
-                                               } else if ( !strcmp( $runMode, 'wiki' ) ) {
+                                               } elseif ( !strcmp( $runMode, 'wiki' ) ) {
                                                        $uKey = ucfirst( $key );
                                                        print( "* MediaWiki:$uKey/$langCode\n" );
                                                } else {
index b6f8c2d..f13873c 100644 (file)
@@ -97,14 +97,14 @@ class PopulateLogSearch extends Maintenance {
                                        foreach ( $sres as $srow ) {
                                                if ( $srow->$userField > 0 )
                                                        $userIds[] = intval( $srow->$userField );
-                                               else if ( $srow->$userTextField != '' )
+                                               elseif ( $srow->$userTextField != '' )
                                                        $userIPs[] = $srow->$userTextField;
                                        }
                                        // Add item author relations...
                                        $log->addRelations( 'target_author_id', $userIds, $row->log_id );
                                        $log->addRelations( 'target_author_ip', $userIPs, $row->log_id );
                                // RevisionDelete logs - log events
-                               } else if ( LogEventsList::typeAction( $row, $delTypes, 'event' ) ) {
+                               } elseif ( LogEventsList::typeAction( $row, $delTypes, 'event' ) ) {
                                        $params = LogPage::extractParams( $row->log_params );
                                        // Param format: <item CSV> [<ofield> <nfield>]
                                        if ( count( $params ) < 1 ) continue; // bad row
@@ -121,7 +121,7 @@ class PopulateLogSearch extends Maintenance {
                                        foreach ( $sres as $srow ) {
                                                if ( $srow->log_user > 0 )
                                                        $userIds[] = intval( $srow->log_user );
-                                               else if ( IP::isIPAddress( $srow->log_user_text ) )
+                                               elseif ( IP::isIPAddress( $srow->log_user_text ) )
                                                        $userIPs[] = $srow->log_user_text;
                                        }
                                        $log->addRelations( 'target_author_id', $userIds, $row->log_id );
index f1d6139..ffbdb2b 100644 (file)
@@ -64,7 +64,7 @@ class UpdateRestrictions extends Maintenance {
                                                // old old format should be treated as edit/move restriction
                                                $oldRestrictions["edit"] = trim( $temp[0] );
                                                $oldRestrictions["move"] = trim( $temp[0] );
-                                       } else if ( $temp[1] ) {
+                                       } elseif ( $temp[1] ) {
                                                $oldRestrictions[$temp[0]] = trim( $temp[1] );
                                        }
                                }
index dd97c15..9cadd75 100644 (file)
@@ -164,7 +164,7 @@ class SeleniumTester extends Maintenance {
                                $seleniumBrowsers,
                                $seleniumTestSuites,
                                $configFile );
-               } else if ( !isset( $wgHooks['SeleniumSettings'] ) ) {
+               } elseif ( !isset( $wgHooks['SeleniumSettings'] ) ) {
                        $this->output("No command line, configuration file or configuration hook found.\n");
                        SeleniumConfig::getSeleniumSettings( $seleniumSettings,
                                $seleniumBrowsers,
index a7ce5a4..e82f7f3 100644 (file)
@@ -36,7 +36,7 @@ class ParserTestStaticParserHook {
                if ( ! count( $argv ) ) {
                        $parser->static_tag_buf = $in;
                        return '';
-               } else if ( count( $argv ) === 1 && isset( $argv['action'] )
+               } elseif ( count( $argv ) === 1 && isset( $argv['action'] )
                        && $argv['action'] === 'flush' && $in === null )
                {
                        // Clear the buffer, we probably don't need to
index 67913c6..d1dfa57 100644 (file)
@@ -65,7 +65,7 @@ class TitlePermissionTest extends MediaWikiTestCase {
        function setUser( $userName = null ) {
                if ( $userName === 'anon' ) {
                        $this->user = $this->anonUser;
-               } else if ( $userName === null || $userName === $this->userName ) {
+               } elseif ( $userName === null || $userName === $this->userName ) {
                        $this->user = $this->userUser;
                } else {
                        $this->user = $this->altUser;