Added/Removed spaces around string concatenation
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 13 Apr 2013 11:36:24 +0000 (13:36 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 13 Apr 2013 11:36:24 +0000 (13:36 +0200)
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8

112 files changed:
includes/ChangesFeed.php
includes/ChangesList.php
includes/Collation.php
includes/ConfEditor.php
includes/Defines.php
includes/Exception.php
includes/FeedUtils.php
includes/GlobalFunctions.php
includes/Html.php
includes/ImageGallery.php
includes/Import.php
includes/MimeMagic.php
includes/Preferences.php
includes/ProtectionForm.php
includes/SiteStats.php
includes/SkinTemplate.php
includes/Status.php
includes/StringUtils.php
includes/UIDGenerator.php
includes/User.php
includes/WikiMap.php
includes/WikiPage.php
includes/Xml.php
includes/XmlTypeCheck.php
includes/ZipDirectoryReader.php
includes/actions/HistoryAction.php
includes/api/ApiEditPage.php
includes/api/ApiMain.php
includes/api/ApiQueryRevisions.php
includes/cache/FileCacheBase.php
includes/clientpool/RedisConnectionPool.php
includes/db/DatabaseError.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/externalstore/ExternalStoreDB.php
includes/filebackend/FileBackendStore.php
includes/filebackend/SwiftFileBackend.php
includes/filebackend/lockmanager/LockManager.php
includes/filebackend/lockmanager/MemcLockManager.php
includes/filebackend/lockmanager/QuorumLockManager.php
includes/filerepo/FileRepo.php
includes/filerepo/LocalRepo.php
includes/filerepo/file/File.php
includes/filerepo/file/LocalFile.php
includes/installer/Installer.php
includes/installer/OracleInstaller.php
includes/installer/OracleUpdater.php
includes/installer/PostgresUpdater.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerOutput.php
includes/installer/WebInstallerPage.php
includes/job/JobQueueAggregatorMemc.php
includes/job/jobs/DoubleRedirectJob.php
includes/job/jobs/HTMLCacheUpdateJob.php
includes/logging/DeleteLogFormatter.php
includes/logging/LogEventsList.php
includes/logging/LogPage.php
includes/media/DjVu.php
includes/media/DjVuImage.php
includes/media/GIFMetadataExtractor.php
includes/media/IPTC.php
includes/media/ImageHandler.php
includes/media/MediaTransformOutput.php
includes/media/SVGMetadataExtractor.php
includes/media/XMPValidate.php
includes/objectcache/BagOStuff.php
includes/objectcache/MemcachedPeclBagOStuff.php
includes/objectcache/MultiWriteBagOStuff.php
includes/parser/DateFormatter.php
includes/parser/Parser.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/profiler/ProfilerSimple.php
includes/profiler/ProfilerSimpleText.php
includes/resourceloader/ResourceLoader.php
includes/revisiondelete/RevisionDelete.php
includes/search/SearchEngine.php
includes/search/SearchMySQL.php
includes/search/SearchPostgres.php
includes/search/SearchSqlite.php
includes/specials/SpecialImport.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialSearch.php
includes/specials/SpecialSpecialpages.php
includes/specials/SpecialStatistics.php
includes/specials/SpecialUserrights.php
includes/specials/SpecialVersion.php
includes/upload/UploadBase.php
includes/upload/UploadStash.php
languages/Language.php
languages/classes/LanguageKsh.php
languages/classes/LanguageTyv.php
languages/classes/LanguageWa.php
maintenance/Maintenance.php
maintenance/backupTextPass.inc
maintenance/benchmarks/Benchmarker.php
maintenance/dumpIterator.php
maintenance/formatInstallDoc.php
maintenance/importDump.php
maintenance/importImages.php
maintenance/install.php
maintenance/language/checkLanguage.inc
maintenance/language/generateCollationData.php
maintenance/language/writeMessagesArray.inc
maintenance/parse.php
maintenance/purgeList.php
maintenance/rebuildrecentchanges.php
maintenance/storage/compressOld.php
skins/CologneBlue.php
tests/phpunit/includes/BlockTest.php

index 8b8b94e..e900e34 100644 (file)
@@ -176,9 +176,9 @@ class ChangesFeed {
                        if( $n > 0 &&
                                $obj->rc_type == RC_EDIT &&
                                $obj->rc_namespace >= 0 &&
-                               $obj->rc_cur_id == $sorted[$n-1]->rc_cur_id &&
-                               $obj->rc_user_text == $sorted[$n-1]->rc_user_text ) {
-                               $sorted[$n-1]->rc_last_oldid = $obj->rc_last_oldid;
+                               $obj->rc_cur_id == $sorted[$n - 1]->rc_cur_id &&
+                               $obj->rc_user_text == $sorted[$n - 1]->rc_user_text ) {
+                               $sorted[$n - 1]->rc_last_oldid = $obj->rc_last_oldid;
                        } else {
                                $sorted[$n] = $obj;
                                $n++;
index 0c4d69e..79e2d0b 100644 (file)
@@ -543,7 +543,7 @@ class ChangesList extends ContextSource {
                                        'user_text' => $rc->mAttribs['rc_user_text'],
                                        'deleted' => $rc->mAttribs['rc_deleted']
                                ) );
-                               $s .= ' '.Linker::generateRollback( $rev, $this->getContext() );
+                               $s .= ' ' . Linker::generateRollback( $rev, $this->getContext() );
                        }
                }
        }
@@ -1046,7 +1046,7 @@ class EnhancedChangesList extends ChangesList {
                        if( $chardiff == '' ) {
                                $r .= ' ';
                        } else {
-                               $r .= ' ' . $chardiff. ' <span class="mw-changeslist-separator">. .</span> ';
+                               $r .= ' ' . $chardiff . ' <span class="mw-changeslist-separator">. .</span> ';
                        }
                }
 
index 21448f7..723b38e 100644 (file)
@@ -62,7 +62,7 @@ abstract class Collation {
                                }
 
                                // If all else fails...
-                               throw new MWException( __METHOD__.": unknown collation type \"$collationName\"" );
+                               throw new MWException( __METHOD__ . ": unknown collation type \"$collationName\"" );
                }
        }
 
index 1d9ca92..293d53d 100644 (file)
@@ -537,7 +537,7 @@ class ConfEditor {
         */
        function getIndent( $pos, $key = false, $arrowPos = false ) {
                $arrowIndent = ' ';
-               if ( $pos == 0 || $this->text[$pos-1] == "\n" ) {
+               if ( $pos == 0 || $this->text[$pos - 1] == "\n" ) {
                        $indentLength = strspn( $this->text, " \t", $pos );
                        $indent = substr( $this->text, $pos, $indentLength );
                } else {
@@ -1056,7 +1056,7 @@ class ConfEditorParseError extends MWException {
                $lines = StringUtils::explode( "\n", $text );
                foreach ( $lines as $lineNum => $line ) {
                        if ( $lineNum == $this->lineNum - 1 ) {
-                               return "$line\n" .str_repeat( ' ', $this->colNum - 1 ) . "^\n";
+                               return "$line\n" . str_repeat( ' ', $this->colNum - 1 ) . "^\n";
                        }
                }
                return '';
index 28847db..cd6b158 100644 (file)
@@ -204,7 +204,7 @@ define( 'LIST_OR', 4 );
 /**
  * Unicode and normalisation related
  */
-require_once __DIR__.'/normal/UtfNormalDefines.php';
+require_once __DIR__ . '/normal/UtfNormalDefines.php';
 
 /**@{
  * Hook support constants
index 661d03d..93fddac 100644 (file)
@@ -617,7 +617,7 @@ class HttpError extends MWException {
                        $content = htmlspecialchars( $this->content );
                }
 
-               return "<!DOCTYPE html>\n".
+               return "<!DOCTYPE html>\n" .
                        "<html><head><title>$header</title></head>\n" .
                        "<body><h1>$header</h1><p>$content</p></body></html>\n";
        }
index 57d8c0b..4842c38 100644 (file)
@@ -127,7 +127,7 @@ class FeedUtils {
                }
 
                if( $oldid ) {
-                       wfProfileIn( __METHOD__."-dodiff" );
+                       wfProfileIn( __METHOD__ . "-dodiff" );
 
                        #$diffText = $de->getDiff( wfMessage( 'revisionasof',
                        #       $wgLang->timeanddate( $timestamp ),
@@ -168,7 +168,7 @@ class FeedUtils {
                                $diffText = UtfNormal::cleanUp( $diffText );
                                $diffText = self::applyDiffStyle( $diffText );
                        }
-                       wfProfileOut( __METHOD__."-dodiff" );
+                       wfProfileOut( __METHOD__ . "-dodiff" );
                } else {
                        $rev = Revision::newFromId( $newid );
                        if( $wgFeedDiffCutoff <= 0 || is_null( $rev ) ) {
index 751f4af..af19b8e 100644 (file)
@@ -3874,7 +3874,7 @@ function wfRunHooks( $event, $args = array() ) {
  * @throws MWException if $data not long enough, or if unpack fails
  * @return array Associative array of the extracted data
  */
-function wfUnpack( $format, $data, $length=false ) {
+function wfUnpack( $format, $data, $length = false ) {
        if ( $length !== false ) {
                $realLen = strlen( $data );
                if ( $realLen < $length ) {
index af4b4bb..07bb42b 100644 (file)
@@ -926,22 +926,22 @@ class Html {
                global $wgStylePath;
 
                if ( $useStylePath ) {
-                       $icon = $wgStylePath.'/common/images/'.$icon;
+                       $icon = $wgStylePath . '/common/images/' . $icon;
                }
 
                $s = Html::openElement( 'div', array( 'class' => "mw-infobox $class" ) );
 
-               $s .= Html::openElement( 'div', array( 'class' => 'mw-infobox-left' ) ).
+               $s .= Html::openElement( 'div', array( 'class' => 'mw-infobox-left' ) ) .
                                Html::element( 'img',
                                        array(
                                                'src' => $icon,
                                                'alt' => $alt,
                                        )
-                               ).
+                               ) .
                                Html::closeElement( 'div' );
 
-               $s .= Html::openElement( 'div', array( 'class' => 'mw-infobox-right' ) ).
-                               $text.
+               $s .= Html::openElement( 'div', array( 'class' => 'mw-infobox-right' ) ) .
+                               $text .
                                Html::closeElement( 'div' );
                $s .= Html::element( 'div', array( 'style' => 'clear: left;' ), ' ' );
 
index 1556ad9..8f8022f 100644 (file)
@@ -302,7 +302,7 @@ class ImageGallery {
                                $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( self::THUMB_PADDING + $this->mHeights ) . 'px;">'
                                        . htmlspecialchars( $img->getLastError() ) . '</div>';
                        } else {
-                               $vpad = ( self::THUMB_PADDING + $this->mHeights - $thumb->height ) /2;
+                               $vpad = ( self::THUMB_PADDING + $this->mHeights - $thumb->height ) / 2;
 
                                $imageParameters = array(
                                        'desc-link' => true,
index 04d99e1..03a1cfe 100644 (file)
@@ -432,7 +432,7 @@ class WikiImporter {
                        $lookup[$this->reader->nodeType],
                        $this->reader->name,
                        $this->reader->value
-               )."\n\n" );
+               ) . "\n\n" );
        }
 
        /**
@@ -444,7 +444,7 @@ class WikiImporter {
                $this->reader->read();
 
                if ( $this->reader->name != 'mediawiki' ) {
-                       throw new MWException( "Expected <mediawiki> tag, got ".
+                       throw new MWException( "Expected <mediawiki> tag, got " .
                                $this->reader->name );
                }
                $this->debug( "<mediawiki> tag is correct." );
index 7592530..11fc574 100644 (file)
@@ -231,7 +231,7 @@ class MimeMagic {
                        }
 
                        $mime = substr( $s, 0, $i );
-                       $ext = trim( substr( $s, $i+1 ) );
+                       $ext = trim( substr( $s, $i + 1 ) );
 
                        if ( empty( $ext ) ) {
                                continue;
@@ -628,7 +628,7 @@ class MimeMagic {
                        $doctype = strpos( $head, "\x42\x82" );
                        if ( $doctype ) {
                                // Next byte is datasize, then data (sizes larger than 1 byte are very stupid muxers)
-                               $data = substr( $head, $doctype+3, 8 );
+                               $data = substr( $head, $doctype + 3, 8 );
                                if ( strncmp( $data, "matroska", 8 ) == 0 ) {
                                        wfDebug( __METHOD__ . ": recognized file as video/x-matroska\n" );
                                        return "video/x-matroska";
@@ -897,7 +897,7 @@ class MimeMagic {
                                $m = finfo_file( $mime_magic_resource, $file );
                                finfo_close( $mime_magic_resource );
                        } else {
-                               wfDebug( __METHOD__ . ": finfo_open failed on ".FILEINFO_MIME."!\n" );
+                               wfDebug( __METHOD__ . ": finfo_open failed on " . FILEINFO_MIME . "!\n" );
                        }
                } elseif ( function_exists( "mime_content_type" ) ) {
 
index 6d6e581..79c3dd3 100644 (file)
@@ -432,7 +432,7 @@ class Preferences {
                                                                SpecialPage::getTitleFor( 'Confirmemail' ),
                                                                $context->msg( 'emailconfirmlink' )->escaped()
                                                        ) . '<br />';
-                                               $emailauthenticationclass="mw-email-not-authenticated";
+                                               $emailauthenticationclass = "mw-email-not-authenticated";
                                        }
                                } else {
                                        $disableEmailPrefs = true;
index 7ebefec..de5e9db 100644 (file)
@@ -371,7 +371,7 @@ class ProtectionForm {
                foreach( $this->mRestrictions as $action => $selected ) {
                        /* Not all languages have V_x <-> N_x relation */
                        $msg = wfMessage( 'restriction-' . $action );
-                       $out .= "<tr><td>".
+                       $out .= "<tr><td>" .
                        Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', null, $msg->exists() ? $msg->text() : $action ) .
                        Xml::openElement( 'table', array( 'id' => "mw-protect-table-$action" ) ) .
index b7be29d..4de7333 100644 (file)
@@ -306,12 +306,12 @@ class SiteStatsUpdate implements DeferrableUpdate {
                                }
                                $pd = $this->getPendingDeltas();
                                // Piggy-back the async deltas onto those of this stats update....
-                               $this->views    += ( $pd['ss_total_views']['+'] - $pd['ss_total_views']['-'] );
-                               $this->edits    += ( $pd['ss_total_edits']['+'] - $pd['ss_total_edits']['-'] );
+                               $this->views += ( $pd['ss_total_views']['+'] - $pd['ss_total_views']['-'] );
+                               $this->edits += ( $pd['ss_total_edits']['+'] - $pd['ss_total_edits']['-'] );
                                $this->articles += ( $pd['ss_good_articles']['+'] - $pd['ss_good_articles']['-'] );
-                               $this->pages    += ( $pd['ss_total_pages']['+'] - $pd['ss_total_pages']['-'] );
-                               $this->users    += ( $pd['ss_users']['+'] - $pd['ss_users']['-'] );
-                               $this->images   += ( $pd['ss_images']['+'] - $pd['ss_images']['-'] );
+                               $this->pages += ( $pd['ss_total_pages']['+'] - $pd['ss_total_pages']['-'] );
+                               $this->users += ( $pd['ss_users']['+'] - $pd['ss_users']['-'] );
+                               $this->images += ( $pd['ss_images']['+'] - $pd['ss_images']['-'] );
                        }
 
                        // Need a separate transaction because this a global lock
@@ -356,7 +356,7 @@ class SiteStatsUpdate implements DeferrableUpdate {
                                'rc_user != 0',
                                'rc_bot' => 0,
                                'rc_log_type != ' . $dbr->addQuotes( 'newusers' ) . ' OR rc_log_type IS NULL',
-                               'rc_timestamp >= ' . $dbr->addQuotes( $dbr->timestamp( wfTimestamp( TS_UNIX ) - $wgActiveUserDays*24*3600 ) ),
+                               'rc_timestamp >= ' . $dbr->addQuotes( $dbr->timestamp( wfTimestamp( TS_UNIX ) - $wgActiveUserDays * 24 * 3600 ) ),
                        ),
                        __METHOD__
                );
index fee3058..9014c7f 100644 (file)
@@ -127,7 +127,7 @@ class SkinTemplate extends Skin {
         *
         * @param $out OutputPage
         */
-       function outputPage( OutputPage $out=null ) {
+       function outputPage( OutputPage $out = null ) {
                global $wgContLang;
                global $wgScript, $wgStylePath;
                global $wgMimeType, $wgJsMimeType;
@@ -761,7 +761,7 @@ class SkinTemplate extends Skin {
 
        function makeArticleUrlDetails( $name, $urlaction = '' ) {
                $title = Title::newFromText( $name );
-               $title= $title->getSubjectPage();
+               $title = $title->getSubjectPage();
                self::checkTitle( $title, $name );
                return array(
                        'href' => $title->getLocalURL( $urlaction ),
index 5d6236f..d8ea24a 100644 (file)
@@ -190,7 +190,7 @@ class Status {
                                $s = wfMessage( $longContext, "* $s\n" )->plain();
                        }
                } else {
-                       $s = '* '. implode( "\n* ",
+                       $s = '* ' . implode( "\n* ",
                                $this->getErrorMessageArray( $this->errors ) ) . "\n";
                        if ( $longContext ) {
                                $s = wfMessage( $longContext, $s )->plain();
index f4c98f1..21a392a 100644 (file)
@@ -452,16 +452,16 @@ class ReplacementArray {
         */
        function replace( $subject ) {
                if ( function_exists( 'fss_prep_replace' ) ) {
-                       wfProfileIn( __METHOD__.'-fss' );
+                       wfProfileIn( __METHOD__ . '-fss' );
                        if ( $this->fss === false ) {
                                $this->fss = fss_prep_replace( $this->data );
                        }
                        $result = fss_exec_replace( $this->fss, $subject );
-                       wfProfileOut( __METHOD__.'-fss' );
+                       wfProfileOut( __METHOD__ . '-fss' );
                } else {
-                       wfProfileIn( __METHOD__.'-strtr' );
+                       wfProfileIn( __METHOD__ . '-strtr' );
                        $result = strtr( $subject, $this->data );
-                       wfProfileOut( __METHOD__.'-strtr' );
+                       wfProfileOut( __METHOD__ . '-strtr' );
                }
                return $result;
        }
index b042d8c..6219b3d 100644 (file)
@@ -304,7 +304,7 @@ class UIDGenerator {
                        if ( $ct >= $time ) { // http://php.net/manual/en/language.operators.comparison.php
                                return $ct; // current timestamp is higher than $time
                        }
-               } while ( ( ( $time[0] - $ct[0] )*1000 + ( $time[1] - $ct[1] ) ) <= 10 );
+               } while ( ( ( $time[0] - $ct[0] ) * 1000 + ( $time[1] - $ct[1] ) ) <= 10 );
 
                return false;
        }
index 5b7cbf2..ed97deb 100644 (file)
@@ -1229,7 +1229,7 @@ class User {
                $defOpt['variant'] = $wgContLang->getCode();
                $defOpt['language'] = $wgContLang->getCode();
                foreach( SearchEngine::searchableNamespaces() as $nsnum => $nsname ) {
-                       $defOpt['searchNs'.$nsnum] = !empty( $wgNamespacesToBeSearchedDefault[$nsnum] );
+                       $defOpt['searchNs' . $nsnum] = !empty( $wgNamespacesToBeSearchedDefault[$nsnum] );
                }
                $defOpt['skin'] = $wgDefaultSkin;
 
@@ -1268,7 +1268,7 @@ class User {
                }
 
                wfProfileIn( __METHOD__ );
-               wfDebug( __METHOD__.": checking...\n" );
+               wfDebug( __METHOD__ . ": checking...\n" );
 
                // Initialize data...
                // Otherwise something ends up stomping on $this->mBlockedby when
@@ -3244,7 +3244,7 @@ class User {
                                }
                        }
                        if ( !$loaded ) {
-                               throw new MWException( __METHOD__. ": hit a key conflict attempting " .
+                               throw new MWException( __METHOD__ . ": hit a key conflict attempting " .
                                        "to insert a user row, but then it doesn't exist when we select it!" );
                        }
                        return Status::newFatal( 'userexists' );
@@ -4254,7 +4254,7 @@ class User {
                } elseif ( $type == ':B:' ) {
                        # Salted
                        list( $salt, $realHash ) = explode( ':', substr( $hash, 3 ), 2 );
-                       return md5( $salt.'-'.md5( $password ) ) === $realHash;
+                       return md5( $salt . '-' . md5( $password ) ) === $realHash;
                } else {
                        # Old-style
                        return self::oldCrypt( $password, $userId ) === $hash;
index a1dbbfc..ab3d68d 100644 (file)
@@ -73,7 +73,7 @@ class WikiMap {
         * @param string $text link's text; optional, default to "User:$user"
         * @return String: HTML link or false if the wiki was not found
         */
-       public static function foreignUserLink( $wikiID, $user, $text=null ) {
+       public static function foreignUserLink( $wikiID, $user, $text = null ) {
                return self::makeForeignLink( $wikiID, "User:$user", $text );
        }
 
@@ -85,7 +85,7 @@ class WikiMap {
         * @param string $text link's text; optional, default to $page
         * @return String: HTML link or false if the wiki was not found
         */
-       public static function makeForeignLink( $wikiID, $page, $text=null ) {
+       public static function makeForeignLink( $wikiID, $page, $text = null ) {
                if ( !$text ) {
                        $text = $page;
                }
index c016b18..228f295 100644 (file)
@@ -797,7 +797,7 @@ class WikiPage implements Page, IDBAccessObject {
        public function setCachedLastEditTime( $timestamp ) {
                global $wgMemc;
                $key = wfMemcKey( 'page-lastedit', md5( $this->mTitle->getPrefixedDBkey() ) );
-               $wgMemc->set( $key, wfTimestamp( TS_MW, $timestamp ), 60*15 );
+               $wgMemc->set( $key, wfTimestamp( TS_MW, $timestamp ), 60 * 15 );
        }
 
        /**
index 7cecf3a..29c240e 100644 (file)
@@ -200,9 +200,9 @@ class Xml {
                        $encYear = '';
                }
                $inputAttribs = array( 'id' => 'year', 'maxlength' => 4, 'size' => 7 );
-               return self::label( wfMessage( 'year' )->text(), 'year' ) . ' '.
-                       Html::input( 'year', $encYear, 'number', $inputAttribs ) . ' '.
-                       self::label( wfMessage( 'month' )->text(), 'month' ) . ' '.
+               return self::label( wfMessage( 'year' )->text(), 'year' ) . ' ' .
+                       Html::input( 'year', $encYear, 'number', $inputAttribs ) . ' ' .
+                       self::label( wfMessage( 'month' )->text(), 'month' ) . ' ' .
                        self::monthSelector( $encMonth, -1 );
        }
 
@@ -330,7 +330,7 @@ class Xml {
         * @param array $attribs other attributes
         * @return string HTML
         */
-       public static function check( $name, $checked = false, $attribs=array() ) {
+       public static function check( $name, $checked = false, $attribs = array() ) {
                return self::element( 'input', array_merge(
                        array(
                                'name' => $name,
@@ -389,7 +389,7 @@ class Xml {
         * @param array $attribs other attributes
         * @return string HTML
         */
-       public static function inputLabel( $label, $name, $id, $size=false, $value=false, $attribs = array() ) {
+       public static function inputLabel( $label, $name, $id, $size = false, $value = false, $attribs = array() ) {
                list( $label, $input ) = self::inputLabelSep( $label, $name, $id, $size, $value, $attribs );
                return $label . '&#160;' . $input;
        }
@@ -466,7 +466,7 @@ class Xml {
         * @param array $attribs optional additional HTML attributes
         * @return string HTML
         */
-       public static function option( $text, $value=null, $selected = false,
+       public static function option( $text, $value = null, $selected = false,
                        $attribs = array() ) {
                if( !is_null( $value ) ) {
                        $attribs['value'] = $value;
@@ -488,7 +488,7 @@ class Xml {
         * @param $tabindex Mixed: Value of the tabindex attribute
         * @return string
         */
-       public static function listDropDown( $name= '', $list = '', $other = '', $selected = '', $class = '', $tabindex = null ) {
+       public static function listDropDown( $name = '', $list = '', $other = '', $selected = '', $class = '', $tabindex = null ) {
                $optgroup = false;
 
                $options = self::option( $other, 'other', $selected === 'other' );
index 2e18460..5e4f118 100644 (file)
@@ -47,7 +47,7 @@ class XmlTypeCheck {
         *        namespace, name, and attributes, but not to text contents.
         *        Filter should return 'true' to toggle on $this->filterMatch
         */
-       function __construct( $file, $filterCallback=null ) {
+       function __construct( $file, $filterCallback = null ) {
                $this->filterCallback = $filterCallback;
                $this->run( $file );
        }
index 646180d..307efce 100644 (file)
@@ -162,7 +162,7 @@ class ZipDirectoryReader {
                                        || $this->eocdr['CD entries total'] == 0xffff )
                                {
                                        $this->error( 'zip-unsupported', 'Central directory header indicates ZIP64, ' .
-                                               'but we are in legacy mode. Rejecting this upload is necessary to avoid '.
+                                               'but we are in legacy mode. Rejecting this upload is necessary to avoid ' .
                                                'opening vulnerabilities on clients using OpenJDK 7 or later.' );
                                }
 
index 8729426..7296126 100644 (file)
@@ -661,7 +661,7 @@ class HistoryPager extends ReverseChronologicalPager {
                wfRunHooks( 'HistoryRevisionTools', array( $rev, &$tools ) );
 
                if ( $tools ) {
-                       $s2 .= ' '. $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
+                       $s2 .= ' ' . $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
                }
 
                # Tags
index 4916145..ab60008 100644 (file)
@@ -100,7 +100,7 @@ class ApiEditPage extends ApiBase {
                        $name = $titleObj->getPrefixedDBkey();
                        $model = $contentHandler->getModelID();
 
-                       $this->dieUsage( "The requested format $contentFormat is not supported for content model ".
+                       $this->dieUsage( "The requested format $contentFormat is not supported for content model " .
                                                        " $model used by $name", 'badformat' );
                }
 
index abd47b2..76f9b42 100644 (file)
@@ -863,7 +863,7 @@ class ApiMain extends ApiBase {
                        ' ' . $request->getMethod() .
                        ' ' . wfUrlencode( str_replace( ' ', '_', $this->getUser()->getName() ) ) .
                        ' ' . $request->getIP() .
-                       ' T=' . $milliseconds .'ms';
+                       ' T=' . $milliseconds . 'ms';
                foreach ( $this->getParamsUsed() as $name ) {
                        $value = $request->getVal( $name );
                        if ( $value === null ) {
index 192fe87..317b7ba 100644 (file)
@@ -550,7 +550,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                                if ( !$content->isSupportedFormat( $format ) ) {
                                        $name = $title->getPrefixedDBkey();
 
-                                       $this->dieUsage( "The requested format {$this->contentFormat} is not supported ".
+                                       $this->dieUsage( "The requested format {$this->contentFormat} is not supported " .
                                                                        "for content model $model used by $name", 'badformat' );
                                }
 
@@ -593,7 +593,7 @@ class ApiQueryRevisions extends ApiQueryBase {
 
                                                $name = $title->getPrefixedDBkey();
 
-                                               $this->dieUsage( "The requested format {$this->contentFormat} is not supported for ".
+                                               $this->dieUsage( "The requested format {$this->contentFormat} is not supported for " .
                                                                                        "content model $model used by $name", 'badformat' );
                                        }
 
index 30a7217..74feffb 100644 (file)
@@ -163,7 +163,7 @@ abstract class FileCacheBase {
 
                $this->checkCacheDirs(); // build parent dir
                if ( !file_put_contents( $this->cachePath(), $text, LOCK_EX ) ) {
-                       wfDebug( __METHOD__ . "() failed saving ". $this->cachePath() . "\n" );
+                       wfDebug( __METHOD__ . "() failed saving " . $this->cachePath() . "\n" );
                        $this->mCached = null;
                        return false;
                }
index a15e80b..7a29154 100644 (file)
@@ -59,7 +59,7 @@ class RedisConnectionPool {
         */
        protected function __construct( array $options ) {
                if ( !extension_loaded( 'redis' ) ) {
-                       throw new MWException( __CLASS__. ' requires the phpredis extension: ' .
+                       throw new MWException( __CLASS__ . ' requires the phpredis extension: ' .
                                'https://github.com/nicolasff/phpredis' );
                }
                $this->connectTimeout = $options['connectTimeout'];
@@ -164,7 +164,7 @@ class RedisConnectionPool {
                        // TCP connection
                        $hostPort = IP::splitHostAndPort( $server );
                        if ( !$hostPort ) {
-                               throw new MWException( __CLASS__.": invalid configured server \"$server\"" );
+                               throw new MWException( __CLASS__ . ": invalid configured server \"$server\"" );
                        }
                        list( $host, $port ) = $hostPort;
                        if ( $port === false ) {
index 628a2af..55095c3 100644 (file)
@@ -188,7 +188,7 @@ class DBConnectionError extends DBError {
                                        # Hack: extend the body for error messages
                                        $cache = str_replace( array( '</html>', '</body>' ), '', $cache );
                                        # Add cache notice...
-                                       $cache .= '<div style="color:red;font-size:150%;font-weight:bold;">'.
+                                       $cache .= '<div style="color:red;font-size:150%;font-weight:bold;">' .
                                                htmlspecialchars( $this->msg( 'dberr-cachederror',
                                                        'This is a cached copy of the requested page, and may not be up to date. ' ) ) .
                                                '</div>';
index e59ca95..a57b24b 100644 (file)
@@ -919,7 +919,7 @@ class DatabaseOracle extends DatabaseBase {
                        if ( isset( $this->mFieldInfoCache["$table.$field"] ) ) {
                                return $this->mFieldInfoCache["$table.$field"];
                        }
-                       $tableWhere = '= \''.$table.'\'';
+                       $tableWhere = '= \'' . $table . '\'';
                }
 
                $fieldInfoStmt = oci_parse( $this->mConn, 'SELECT * FROM wiki_field_info_full WHERE table_name ' . $tableWhere . ' and column_name = \'' . $field . '\'' );
index 52fab13..bb35dc3 100644 (file)
@@ -320,7 +320,7 @@ class DatabasePostgres extends DatabaseBase {
 
        function hasConstraint( $name ) {
                $SQL = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n WHERE c.connamespace = n.oid AND conname = '" .
-                               pg_escape_string( $this->mConn, $name ) . "' AND n.nspname = '" . pg_escape_string( $this->mConn, $this->getCoreSchema() ) ."'";
+                               pg_escape_string( $this->mConn, $name ) . "' AND n.nspname = '" . pg_escape_string( $this->mConn, $this->getCoreSchema() ) . "'";
                $res = $this->doQuery( $SQL );
                return $this->numRows( $res );
        }
@@ -705,7 +705,7 @@ __INDEXATTR__;
        }
 
        function indexUnique( $table, $index, $fname = 'DatabasePostgres::indexUnique' ) {
-               $sql = "SELECT indexname FROM pg_indexes WHERE tablename='{$table}'".
+               $sql = "SELECT indexname FROM pg_indexes WHERE tablename='{$table}'" .
                        " AND indexdef LIKE 'CREATE UNIQUE%(" .
                        $this->strencode( $this->indexName( $index ) ) .
                        ")'";
@@ -960,7 +960,7 @@ __INDEXATTR__;
                        FROM pg_class c, pg_attribute a, pg_type t
                        WHERE relname='$table' AND a.attrelid=c.oid AND
                                a.atttypid=t.oid and a.attname='$field'";
-               $res =$this->query( $sql );
+               $res = $this->query( $sql );
                $row = $this->fetchObject( $res );
                if ( $row->ftype == 'varchar' ) {
                        $size = $row->size - 4;
@@ -1024,7 +1024,7 @@ __INDEXATTR__;
         */
        function pg_array_parse( $text, &$output, $limit = false, $offset = 1 ) {
                if( false === $limit ) {
-                       $limit = strlen( $text )-1;
+                       $limit = strlen( $text ) - 1;
                        $output = array();
                }
                if( '{}' == $text ) {
@@ -1042,7 +1042,7 @@ __INDEXATTR__;
                                        return $output;
                                }
                        } else {
-                               $offset = $this->pg_array_parse( $text, $output, $limit, $offset+1 );
+                               $offset = $this->pg_array_parse( $text, $output, $limit, $offset + 1 );
                        }
                } while ( $limit > $offset );
                return $output;
@@ -1476,7 +1476,7 @@ SQL;
                                sleep( 1 );
                        }
                }
-               wfDebug( __METHOD__." failed to acquire lock\n" );
+               wfDebug( __METHOD__ . " failed to acquire lock\n" );
                return false;
        }
 
index 196e7f2..46a863f 100644 (file)
@@ -64,7 +64,7 @@ class ExternalStoreDB extends ExternalStoreMedium {
                        __METHOD__ );
                $id = $dbw->insertId();
                if ( !$id ) {
-                       throw new MWException( __METHOD__.': no insert ID' );
+                       throw new MWException( __METHOD__ . ': no insert ID' );
                }
                if ( $dbw->getFlag( DBO_TRX ) ) {
                        $dbw->commit( __METHOD__ );
index 18a59fa..5a91f9e 100644 (file)
@@ -1578,7 +1578,7 @@ abstract class FileBackendStore extends FileBackend {
         * @param $val mixed Information to cache
         */
        final protected function setContainerCache( $container, $val ) {
-               $this->memCache->add( $this->containerCacheKey( $container ), $val, 14*86400 );
+               $this->memCache->add( $this->containerCacheKey( $container ), $val, 14 * 86400 );
        }
 
        /**
@@ -1673,7 +1673,7 @@ abstract class FileBackendStore extends FileBackend {
                if ( $path === null ) {
                        return; // invalid storage path
                }
-               $this->memCache->add( $this->fileCacheKey( $path ), $val, 7*86400 );
+               $this->memCache->add( $this->fileCacheKey( $path ), $val, 7 * 86400 );
        }
 
        /**
index 2f7e256..00c0ff8 100644 (file)
@@ -132,7 +132,7 @@ class SwiftFileBackend extends FileBackendStore {
                        : false;
                $this->swiftCDNExpiry = isset( $config['swiftCDNExpiry'] )
                        ? $config['swiftCDNExpiry']
-                       : 12*3600; // 12 hours is safe (tokens last 24 hours per http://docs.openstack.org)
+                       : 12 * 3600; // 12 hours is safe (tokens last 24 hours per http://docs.openstack.org)
                $this->swiftCDNPurgable = isset( $config['swiftCDNPurgable'] )
                        ? $config['swiftCDNPurgable']
                        : true;
@@ -1397,12 +1397,12 @@ class SwiftFileBackend extends FileBackendStore {
                        if ( is_array( $creds ) ) { // cache hit
                                $this->auth->load_cached_credentials(
                                        $creds['auth_token'], $creds['storage_url'], $creds['cdnm_url'] );
-                               $this->sessionStarted = time() - ceil( $this->authTTL/2 ); // skew for worst case
+                               $this->sessionStarted = time() - ceil( $this->authTTL / 2 ); // skew for worst case
                        } else { // cache miss
                                try {
                                        $this->auth->authenticate();
                                        $creds = $this->auth->export_credentials();
-                                       $this->srvCache->add( $cacheKey, $creds, ceil( $this->authTTL/2 ) ); // cache
+                                       $this->srvCache->add( $cacheKey, $creds, ceil( $this->authTTL / 2 ) ); // cache
                                        $this->sessionStarted = time();
                                } catch ( CloudFilesException $e ) {
                                        $this->connException = $e; // don't keep re-trying
index f534eff..9b7a7ff 100644 (file)
@@ -76,10 +76,10 @@ abstract class LockManager {
                if ( isset( $config['lockTTL'] ) ) {
                        $this->lockTTL = max( 1, $config['lockTTL'] );
                } elseif ( PHP_SAPI === 'cli' ) {
-                       $this->lockTTL = 2*3600;
+                       $this->lockTTL = 2 * 3600;
                } else {
                        $met = ini_get( 'max_execution_time' ); // this is 0 in CLI mode
-                       $this->lockTTL = max( 5*60, 2*(int)$met );
+                       $this->lockTTL = max( 5 * 60, 2 * (int)$met );
                }
        }
 
index fafc588..757aeee 100644 (file)
@@ -145,7 +145,7 @@ class MemcLockManager extends QuorumLockManager {
                        foreach ( $paths as $path ) {
                                $locksKey = $this->recordKeyForPath( $path );
                                $locksHeld = $lockRecords[$locksKey];
-                               $ok = $memc->set( $locksKey, $locksHeld, 7*86400 );
+                               $ok = $memc->set( $locksKey, $locksHeld, 7 * 86400 );
                                if ( !$ok ) {
                                        $status->fatal( 'lockmanager-fail-acquirelock', $path );
                                } else {
@@ -297,7 +297,7 @@ class MemcLockManager extends QuorumLockManager {
                $start = microtime( true );
                do {
                        if ( ( ++$rounds % 4 ) == 0 ) {
-                               usleep( 1000*50 ); // 50 ms
+                               usleep( 1000 * 50 ); // 50 ms
                        }
                        foreach ( array_diff( $keys, $lockedKeys ) as $key ) {
                                if ( $memc->add( "$key:mutex", 1, 180 ) ) { // lock record
index b331b54..3b96ad6 100644 (file)
@@ -125,7 +125,7 @@ abstract class QuorumLockManager extends LockManager {
 
                $yesVotes = 0; // locks made on trustable servers
                $votesLeft = count( $this->srvsByBucket[$bucket] ); // remaining peers
-               $quorum = floor( $votesLeft/2 + 1 ); // simple majority
+               $quorum = floor( $votesLeft / 2 + 1 ); // simple majority
                // Get votes for each peer, in order, until we have enough...
                foreach ( $this->srvsByBucket[$bucket] as $lockSrv ) {
                        if ( !$this->isServerUp( $lockSrv ) ) {
index 366dd8a..0e30017 100644 (file)
@@ -259,19 +259,19 @@ class FileRepo {
         */
        public function resolveVirtualUrl( $url ) {
                if ( substr( $url, 0, 9 ) != 'mwrepo://' ) {
-                       throw new MWException( __METHOD__.': unknown protocol' );
+                       throw new MWException( __METHOD__ . ': unknown protocol' );
                }
                $bits = explode( '/', substr( $url, 9 ), 3 );
                if ( count( $bits ) != 3 ) {
-                       throw new MWException( __METHOD__.": invalid mwrepo URL: $url" );
+                       throw new MWException( __METHOD__ . ": invalid mwrepo URL: $url" );
                }
                list( $repo, $zone, $rel ) = $bits;
                if ( $repo !== $this->name ) {
-                       throw new MWException( __METHOD__.": fetching from a foreign repo is not supported" );
+                       throw new MWException( __METHOD__ . ": fetching from a foreign repo is not supported" );
                }
                $base = $this->getZonePath( $zone );
                if ( !$base ) {
-                       throw new MWException( __METHOD__.": invalid zone: $zone" );
+                       throw new MWException( __METHOD__ . ": invalid zone: $zone" );
                }
                return $base . '/' . rawurldecode( $rel );
        }
@@ -987,7 +987,7 @@ class FileRepo {
 
                $temp = $this->getVirtualUrl( 'temp' );
                if ( substr( $virtualUrl, 0, strlen( $temp ) ) != $temp ) {
-                       wfDebug( __METHOD__.": Invalid temp virtual URL\n" );
+                       wfDebug( __METHOD__ . ": Invalid temp virtual URL\n" );
                        return false;
                }
 
@@ -1306,9 +1306,9 @@ class FileRepo {
                foreach ( $sourceDestPairs as $pair ) {
                        list( $srcRel, $archiveRel ) = $pair;
                        if ( !$this->validateFilename( $srcRel ) ) {
-                               throw new MWException( __METHOD__.':Validation error in $srcRel' );
+                               throw new MWException( __METHOD__ . ':Validation error in $srcRel' );
                        } elseif ( !$this->validateFilename( $archiveRel ) ) {
-                               throw new MWException( __METHOD__.':Validation error in $archiveRel' );
+                               throw new MWException( __METHOD__ . ':Validation error in $archiveRel' );
                        }
 
                        $publicRoot = $this->getZonePath( 'public' );
index be11b23..d017e13 100644 (file)
@@ -47,7 +47,7 @@ class LocalRepo extends FileRepo {
                } elseif ( isset( $row->oi_name ) ) {
                        return call_user_func( $this->oldFileFromRowFactory, $row, $this );
                } else {
-                       throw new MWException( __METHOD__.': invalid row' );
+                       throw new MWException( __METHOD__ . ': invalid row' );
                }
        }
 
@@ -281,17 +281,17 @@ class LocalRepo extends FileRepo {
                return $result;
        }
 
-       /**\r
-        * Return an array of files where the name starts with $prefix.\r
-        *\r
-        * @param string $prefix The prefix to search for\r
-        * @param int $limit The maximum amount of files to return\r
-        * @return array\r
-        */\r
+       /**
+        * Return an array of files where the name starts with $prefix.
+        *
+        * @param string $prefix The prefix to search for
+        * @param int $limit The maximum amount of files to return
+        * @return array
+        */
        public function findFilesByPrefix( $prefix, $limit ) {
                $selectOptions = array( 'ORDER BY' => 'img_name', 'LIMIT' => intval( $limit ) );
 
-               // Query database\r
+               // Query database
                $dbr = $this->getSlaveDB();
                $res = $dbr->select(
                        'image',
@@ -306,7 +306,7 @@ class LocalRepo extends FileRepo {
                foreach ( $res as $row ) {
                        $files[] = $this->newFileFromRow( $row );
                }
-               return $files;\r
+               return $files;
        }
 
        /**
index 64155e6..255da17 100644 (file)
@@ -1096,7 +1096,7 @@ abstract class File {
         *
         * @return array
         */
-       function getHistory( $limit = null, $start = null, $end = null, $inc=true ) {
+       function getHistory( $limit = null, $start = null, $end = null, $inc = true ) {
                return array();
        }
 
index f8887cc..b481e83 100644 (file)
@@ -1406,7 +1406,7 @@ class LocalFile extends File {
 
                $this->lock(); // begin
 
-               $archiveName = wfTimestamp( TS_MW ) . '!'. $this->getName();
+               $archiveName = wfTimestamp( TS_MW ) . '!' . $this->getName();
                $archiveRel = 'archive/' . $this->getHashPath() . $archiveName;
                $flags = $flags & File::DELETE_SOURCE ? LocalRepo::DELETE_SOURCE : 0;
                $status = $this->repo->publish( $srcPath, $dstRel, $archiveRel, $flags, $options );
index daac558..0dca23d 100644 (file)
@@ -464,7 +464,7 @@ abstract class Installer {
                $type = strtolower( $type );
 
                if ( !isset( $this->dbInstallers[$type] ) ) {
-                       $class = ucfirst( $type ). 'Installer';
+                       $class = ucfirst( $type ) . 'Installer';
                        $this->dbInstallers[$type] = new $class( $this );
                }
 
index 632015f..e85d07f 100644 (file)
@@ -66,8 +66,8 @@ class OracleInstaller extends DatabaseInstaller {
                        $this->getTextBox( '_OracleDefTS', 'config-oracle-def-ts' ) .
                        $this->getTextBox( '_OracleTempTS', 'config-oracle-temp-ts', array(), $this->parent->getHelpBox( 'config-db-oracle-help' ) ) .
                        Html::closeElement( 'fieldset' ) .
-                       $this->parent->getWarningBox( wfMessage( 'config-db-account-oracle-warn' )->text() ).
-                       $this->getInstallUserBox().
+                       $this->parent->getWarningBox( wfMessage( 'config-db-account-oracle-warn' )->text() ) .
+                       $this->getInstallUserBox() .
                        $this->getWebUserBox();
        }
 
index cafe8cd..56d9f21 100644 (file)
@@ -183,7 +183,12 @@ class OracleUpdater extends DatabaseUpdater {
         * cascading taken in account in the deleting function
         */
        protected function doRecentchangesFK2Cascade() {
-               $meta = $this->db->query( 'SELECT 1 FROM all_constraints WHERE owner = \''.strtoupper($this->db->getDBname()).'\' AND constraint_name = \''.$this->db->tablePrefix().'RECENTCHANGES_FK2\' AND delete_rule = \'CASCADE\'' );
+               $meta = $this->db->query( 'SELECT 1 FROM all_constraints WHERE owner = \'' .
+                       strtoupper( $this->db->getDBname() ) .
+                       '\' AND constraint_name = \'' .
+                       $this->db->tablePrefix() .
+                       'RECENTCHANGES_FK2\' AND delete_rule = \'CASCADE\''
+               );
                $row = $meta->fetchRow();
                if ( $row ) {
                        return;
@@ -198,7 +203,10 @@ class OracleUpdater extends DatabaseUpdater {
        protected function doPageRestrictionsPKUKFix() {
                $this->output( "Altering PAGE_RESTRICTIONS keys ... " );
 
-               $meta = $this->db->query( 'SELECT column_name FROM all_cons_columns WHERE owner = \''.strtoupper($this->db->getDBname()).'\' AND constraint_name = \'MW_PAGE_RESTRICTIONS_PK\' AND rownum = 1' );
+               $meta = $this->db->query( 'SELECT column_name FROM all_cons_columns WHERE owner = \'' .
+                       strtoupper( $this->db->getDBname() ) .
+                       '\' AND constraint_name = \'MW_PAGE_RESTRICTIONS_PK\' AND rownum = 1'
+               );
                $row = $meta->fetchRow();
                if ( $row['column_name'] == 'PR_ID' ) {
                        $this->output( "seems to be up to date.\n" );
@@ -234,7 +242,7 @@ class OracleUpdater extends DatabaseUpdater {
                # We can't guarantee that the user will be able to use TRUNCATE,
                # but we know that DELETE is available to us
                $this->output( "Purging caches..." );
-               $this->db->delete( '/*Q*/'.$this->db->tableName( 'objectcache' ), '*', __METHOD__ );
+               $this->db->delete( '/*Q*/' . $this->db->tableName( 'objectcache' ), '*', __METHOD__ );
                $this->output( "done.\n" );
        }
 
index 08797b2..2615fc6 100644 (file)
@@ -744,7 +744,7 @@ END;
        protected function dropIndex( $table, $index, $patch = '', $fullpath = false ) {
                if ( $this->db->indexExists( $table, $index ) ) {
                        $this->output( "Dropping obsolete index '$index'\n" );
-                       $this->db->query( "DROP INDEX \"". $index ."\"" );
+                       $this->db->query( "DROP INDEX \"" . $index . "\"" );
                }
        }
 
@@ -752,7 +752,7 @@ END;
                $pu = $this->db->indexAttributes( $index );
                if ( !empty( $pu ) && $pu != $should_be ) {
                        $this->output( "Dropping obsolete version of index '$index'\n" );
-                       $this->db->query( "DROP INDEX \"". $index ."\"" );
+                       $this->db->query( "DROP INDEX \"" . $index . "\"" );
                        $pu = array();
                } else {
                        $this->output( "...no need to drop index '$index'\n" );
index ac66cd9..30aa956 100644 (file)
@@ -640,7 +640,7 @@ class WebInstaller extends Installer {
         */
        public function getInfoBox( $text, $icon = false, $class = false ) {
                $text = $this->parse( $text, true );
-               $icon = ( $icon == false ) ? '../skins/common/images/info-32.png' : '../skins/common/images/'.$icon;
+               $icon = ( $icon == false ) ? '../skins/common/images/info-32.png' : '../skins/common/images/' . $icon;
                $alt = wfMessage( 'config-information' )->text();
                return Html::infoBox( $text, $icon, $alt, $class, false );
        }
index d61d843..a6a8667 100644 (file)
@@ -223,7 +223,7 @@ class WebInstallerOutput {
                        $this->parent->request->response()->header( 'X-Frame-Options: DENY' );
                }
                if ( $this->redirectTarget ) {
-                       $this->parent->request->response()->header( 'Location: '.$this->redirectTarget );
+                       $this->parent->request->response()->header( 'Location: ' . $this->redirectTarget );
                        return;
                }
 
index 8aec289..3f3e50a 100644 (file)
@@ -336,7 +336,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
        protected function showKeyForm() {
                $this->startForm();
                $this->addHTML(
-                       $this->parent->getInfoBox( wfMessage( 'config-localsettings-upgrade' )->plain() ).
+                       $this->parent->getInfoBox( wfMessage( 'config-localsettings-upgrade' )->plain() ) .
                        '<br />' .
                        $this->parent->getTextBox( array(
                                'var' => 'wgUpgradeKey',
@@ -1066,7 +1066,7 @@ class WebInstaller_Options extends WebInstallerPage {
                // If you change this height, also change it in config.css
                $expandJs = str_replace( '$1', '54em', $js );
                $reduceJs = str_replace( '$1', '70px', $js );
-               return '<p>'.
+               return '<p>' .
                        Html::element( 'img', array( 'src' => $this->getVar( 'wgRightsIcon' ) ) ) .
                        '&#160;&#160;' .
                        htmlspecialchars( $this->getVar( 'wgRightsText' ) ) .
index 15bb833..c364209 100644 (file)
@@ -93,7 +93,7 @@ class JobQueueAggregatorMemc extends JobQueueAggregator {
                                        'pendingDBs' => $this->findPendingWikiQueues(),
                                        'timestamp'  => time()
                                );
-                               for ( $attempts=1; $attempts <= 25; ++$attempts ) {
+                               for ( $attempts = 1; $attempts <= 25; ++$attempts ) {
                                        if ( $this->cache->add( "$key:lock", 1, 60 ) ) { // lock
                                                $this->cache->set( $key, $pendingDbInfo );
                                                $this->cache->delete( "$key:lock" ); // unlock
index 05abeee..0be03b3 100644 (file)
@@ -90,33 +90,33 @@ class DoubleRedirectJob extends Job {
 
                $targetRev = Revision::newFromTitle( $this->title, false, Revision::READ_LATEST );
                if ( !$targetRev ) {
-                       wfDebug( __METHOD__.": target redirect already deleted, ignoring\n" );
+                       wfDebug( __METHOD__ . ": target redirect already deleted, ignoring\n" );
                        return true;
                }
                $content = $targetRev->getContent();
                $currentDest = $content ? $content->getRedirectTarget() : null;
                if ( !$currentDest || !$currentDest->equals( $this->redirTitle ) ) {
-                       wfDebug( __METHOD__.": Redirect has changed since the job was queued\n" );
+                       wfDebug( __METHOD__ . ": Redirect has changed since the job was queued\n" );
                        return true;
                }
 
                # Check for a suppression tag (used e.g. in periodically archived discussions)
                $mw = MagicWord::get( 'staticredirect' );
                if ( $content->matchMagicWord( $mw ) ) {
-                       wfDebug( __METHOD__.": skipping: suppressed with __STATICREDIRECT__\n" );
+                       wfDebug( __METHOD__ . ": skipping: suppressed with __STATICREDIRECT__\n" );
                        return true;
                }
 
                # Find the current final destination
                $newTitle = self::getFinalDestination( $this->redirTitle );
                if ( !$newTitle ) {
-                       wfDebug( __METHOD__.": skipping: single redirect, circular redirect or invalid redirect destination\n" );
+                       wfDebug( __METHOD__ . ": skipping: single redirect, circular redirect or invalid redirect destination\n" );
                        return true;
                }
                if ( $newTitle->equals( $this->redirTitle ) ) {
                        # The redirect is already right, no need to change it
                        # This can happen if the page was moved back (say after vandalism)
-                       wfDebug( __METHOD__.": skipping, already good\n" );
+                       wfDebug( __METHOD__ . " : skipping, already good\n" );
                }
 
                # Preserve fragment (bug 14904)
index d4a2024..1a2143e 100644 (file)
@@ -97,7 +97,7 @@ class HTMLCacheUpdateJob extends Job {
                        # Check if the row count estimate was correct
                        if ( $titleArray->count() > $this->rowsPerJob * 2 ) {
                                # Not correct, do accurate partition
-                               wfDebug( __METHOD__.": row count estimate was incorrect, repartitioning\n" );
+                               wfDebug( __METHOD__ . ": row count estimate was incorrect, repartitioning\n" );
                                $this->insertJobsFromTitles( $titleArray );
                        } else {
                                $this->invalidateTitles( $titleArray ); // just do the query
@@ -169,13 +169,13 @@ class HTMLCacheUpdateJob extends Job {
                                'end'   => $this->params['end']
                        ) + $rootJobParams // carry over information for de-duplication
                );
-               wfDebug( __METHOD__.": repartitioning into " . count( $jobs ) . " jobs\n" );
+               wfDebug( __METHOD__ . ": repartitioning into " . count( $jobs ) . " jobs\n" );
 
                if ( count( $jobs ) < 2 ) {
                        # I don't think this is possible at present, but handling this case
                        # makes the code a bit more robust against future code updates and
                        # avoids a potential infinite loop of repartitioning
-                       wfDebug( __METHOD__.": repartitioning failed!\n" );
+                       wfDebug( __METHOD__ . ": repartitioning failed!\n" );
                        $this->invalidateTitles( $titleArray );
                } else {
                        JobQueueGroup::singleton()->push( $jobs );
index 8a9e6db..1e0e54f 100644 (file)
@@ -55,8 +55,8 @@ class DeleteLogFormatter extends LogFormatter {
                        ) {
                                $paramStart = $subtype === 'revision' ? 4 : 3;
 
-                               $old = $this->parseBitField( $params[$paramStart+1] );
-                               $new = $this->parseBitField( $params[$paramStart+2] );
+                               $old = $this->parseBitField( $params[$paramStart + 1] );
+                               $new = $this->parseBitField( $params[$paramStart + 2] );
                                list( $hid, $unhid, $extra ) = RevisionDeleter::getChanges( $new, $old );
                                $changes = array();
                                foreach ( $hid as $v ) {
index 501af7d..fd598df 100644 (file)
@@ -97,7 +97,7 @@ class LogEventsList extends ContextSource {
         * @param $filter: array
         * @param $tagFilter: array?
         */
-       public function showOptions( $types=array(), $user = '', $page = '', $pattern = '', $year = '',
+       public function showOptions( $types = array(), $user = '', $page = '', $pattern = '', $year = '',
                $month = '', $filter = null, $tagFilter = '' ) {
                global $wgScript, $wgMiserMode;
 
@@ -467,7 +467,7 @@ class LogEventsList extends ContextSource {
         * @return Integer Number of total log items (not limited by $lim)
         */
        public static function showLogExtract(
-               &$out, $types=array(), $page = '', $user = '', $param = array()
+               &$out, $types = array(), $page = '', $user = '', $param = array()
        ) {
                $defaultParameters = array(
                        'lim' => 25,
index 4191c57..36ba200 100644 (file)
@@ -262,7 +262,7 @@ class LogPage {
                                        // User suppression
                                        if ( preg_match( '/^(block|suppress)\/(block|reblock)$/', $key ) ) {
                                                if ( $skin ) {
-                                                       $params[1] = '<span class="blockExpiry" dir="ltr" title="' . htmlspecialchars( $params[1] ). '">' .
+                                                       $params[1] = '<span class="blockExpiry" dir="ltr" title="' . htmlspecialchars( $params[1] ) . '">' .
                                                                $wgLang->translateBlockExpiry( $params[1] ) . '</span>';
                                                } else {
                                                        $params[1] = $wgContLang->translateBlockExpiry( $params[1] );
index 0a39a2c..a41521d 100644 (file)
@@ -185,7 +185,7 @@ class DjVuHandler extends ImageHandler {
                }
                $cmd .= ' > ' . wfEscapeShellArg( $dstPath ) . ') 2>&1';
                wfProfileIn( 'ddjvu' );
-               wfDebug( __METHOD__.": $cmd\n" );
+               wfDebug( __METHOD__ . ": $cmd\n" );
                $retval = '';
                $err = wfShellExec( $cmd, $retval );
                wfProfileOut( 'ddjvu' );
@@ -311,7 +311,7 @@ class DjVuHandler extends ImageHandler {
                        return false;
                }
 
-               $o = $tree->BODY[0]->OBJECT[$page-1];
+               $o = $tree->BODY[0]->OBJECT[$page - 1];
                if ( $o ) {
                        return array(
                                'width' => intval( $o['width'] ),
@@ -328,7 +328,7 @@ class DjVuHandler extends ImageHandler {
                        return false;
                }
 
-               $o = $tree->BODY[0]->PAGE[$page-1];
+               $o = $tree->BODY[0]->PAGE[$page - 1];
                if ( $o ) {
                        $txt = $o['value'];
                        return $txt;
index 0831e68..5d31898 100644 (file)
@@ -280,7 +280,7 @@ EOR;
                                $txt = preg_replace_callback( $reg, array( $this, 'pageTextCallback' ), $txt );
                                $txt = "<DjVuTxt>\n<HEAD></HEAD>\n<BODY>\n" . $txt . "</BODY>\n</DjVuTxt>\n";
                                $xml = preg_replace( "/<DjVuXML>/", "<mw-djvu><DjVuXML>", $xml, 1 );
-                               $xml = $xml . $txt. '</mw-djvu>';
+                               $xml = $xml . $txt . '</mw-djvu>';
                        }
                }
                wfProfileOut( __METHOD__ );
index 6a4e753..6a46cc0 100644 (file)
@@ -157,7 +157,7 @@ class GIFMetadataExtractor {
 
                                        $commentCount = count( $comment );
                                        if ( $commentCount === 0
-                                               || $comment[$commentCount-1] !== $data )
+                                               || $comment[$commentCount - 1] !== $data )
                                        {
                                                // Some applications repeat the same comment on each
                                                // frame of an animated GIF image, so if this comment
index a1b3fd8..6e04b3d 100644 (file)
@@ -396,7 +396,7 @@ class IPTC {
                        return null;
                }
 
-               $tz = ( intval( substr( $time, 7, 2 ) ) *60*60 )
+               $tz = ( intval( substr( $time, 7, 2 ) ) * 60 * 60 )
                        + ( intval( substr( $time, 9, 2 ) ) * 60 );
 
                if ( substr( $time, 6, 1 ) === '-' ) {
index 6ee0399..d2bf1f3 100644 (file)
@@ -58,7 +58,7 @@ abstract class ImageHandler extends MediaHandler {
                } elseif ( isset( $params['width'] ) ) {
                        $width = $params['width'];
                } else {
-                       throw new MWException( 'No width specified to '.__METHOD__ );
+                       throw new MWException( 'No width specified to ' . __METHOD__ );
                }
                # Removed for ProofreadPage
                #$width = intval( $width );
index 1c2dfdd..2616edb 100644 (file)
@@ -301,7 +301,7 @@ class ThumbnailImage extends MediaTransformOutput {
         */
        function toHtml( $options = array() ) {
                if ( count( func_get_args() ) == 2 ) {
-                       throw new MWException( __METHOD__ .' called in the old style' );
+                       throw new MWException( __METHOD__ . ' called in the old style' );
                }
 
                $alt = empty( $options['alt'] ) ? '' : $options['alt'];
index f21d6b0..128bba3 100644 (file)
@@ -126,7 +126,7 @@ class SVGReader {
                }
 
                if ( $this->reader->localName != 'svg' || $this->reader->namespaceURI != self::NS_SVG ) {
-                       throw new MWException( "Expected <svg> tag, got ".
+                       throw new MWException( "Expected <svg> tag, got " .
                                $this->reader->localName . " in NS " . $this->reader->namespaceURI );
                }
                $this->debug( "<svg> tag is correct." );
@@ -178,7 +178,7 @@ class SVGReader {
         * @param string $name of the element that we are reading from
         * @param string $metafield that we will fill with the result
         */
-       private function readField( $name, $metafield=null ) {
+       private function readField( $name, $metafield = null ) {
                $this->debug( "Read field $metafield" );
                if( !$metafield || $this->reader->nodeType != XmlReader::ELEMENT ) {
                        return;
@@ -200,7 +200,7 @@ class SVGReader {
         * @param string $metafield that we will fill with the result
         * @throws MWException
         */
-       private function readXml( $metafield=null ) {
+       private function readXml( $metafield = null ) {
                $this->debug( "Read top level metadata" );
                if( !$metafield || $this->reader->nodeType != XmlReader::ELEMENT ) {
                        return;
index f727400..3e29c12 100644 (file)
@@ -346,8 +346,8 @@ class XMPValidate {
                        $val, $m )
                ) {
                        $coord = intval( $m[1] );
-                       $coord += intval( $m[2] ) * (1/60);
-                       $coord += intval( $m[3] ) * (1/3600);
+                       $coord += intval( $m[2] ) * ( 1 / 60 );
+                       $coord += intval( $m[3] ) * ( 1 / 3600 );
                        if ( $m[4] === 'S' || $m[4] === 'W' ) {
                                $coord = -$coord;
                        }
@@ -358,7 +358,7 @@ class XMPValidate {
                        $val, $m )
                ) {
                        $coord = intval( $m[1] );
-                       $coord += floatval( $m[2] ) * (1/60);
+                       $coord += floatval( $m[2] ) * ( 1 / 60 );
                        if ( $m[3] === 'S' || $m[3] === 'W' ) {
                                $coord = -$coord;
                        }
index dd74467..fbde251 100644 (file)
@@ -175,7 +175,7 @@ abstract class BagOStuff {
                }
 
                $uRTT = ceil( 1e6 * ( microtime( true ) - $timestamp ) ); // estimate RTT (us)
-               $sleep = 2*$uRTT; // rough time to do get()+set()
+               $sleep = 2 * $uRTT; // rough time to do get()+set()
 
                $locked = false; // lock acquired
                $attempts = 0; // failed attempts
index 3192429..748c423 100644 (file)
@@ -87,13 +87,13 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff {
                                break;
                        case 'igbinary':
                                if ( !Memcached::HAVE_IGBINARY ) {
-                                       throw new MWException( __CLASS__.': the igbinary extension is not available ' .
+                                       throw new MWException( __CLASS__ . ': the igbinary extension is not available ' .
                                                'but igbinary serialization was requested.' );
                                }
                                $this->client->setOption( Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_IGBINARY );
                                break;
                        default:
-                               throw new MWException( __CLASS__.': invalid value for serializer parameter' );
+                               throw new MWException( __CLASS__ . ': invalid value for serializer parameter' );
                }
                $servers = array();
                foreach ( $params['servers'] as $host ) {
index 92afaac..e550c0d 100644 (file)
@@ -43,7 +43,7 @@ class MultiWriteBagOStuff extends BagOStuff {
         */
        public function __construct( $params ) {
                if ( !isset( $params['caches'] ) ) {
-                       throw new MWException( __METHOD__.': the caches parameter is required' );
+                       throw new MWException( __METHOD__ . ': the caches parameter is required' );
                }
 
                $this->caches = array();
index 08b1f3e..8103b60 100644 (file)
@@ -205,7 +205,7 @@ class DateFormatter {
                $key = $this->keys[$this->mSource];
                for ( $p = 0; $p < strlen( $key ); $p++ ) {
                        if ( $key[$p] != ' ' ) {
-                               $bits[$key[$p]] = $matches[$p+1];
+                               $bits[$key[$p]] = $matches[$p + 1];
                        }
                }
 
index 611eb02..0247d3e 100644 (file)
@@ -531,7 +531,7 @@ class Parser {
         *
         * @return string
         */
-       function recursiveTagParse( $text, $frame=false ) {
+       function recursiveTagParse( $text, $frame = false ) {
                wfProfileIn( __METHOD__ );
                wfRunHooks( 'ParserBeforeStrip', array( &$this, &$text, &$this->mStripState ) );
                wfRunHooks( 'ParserAfterStrip', array( &$this, &$text, &$this->mStripState ) );
@@ -1374,12 +1374,12 @@ class Parser {
                                        # If there are ever four apostrophes, assume the first is supposed to
                                        # be text, and the remaining three constitute mark-up for bold text.
                                        if ( strlen( $arr[$i] ) == 4 ) {
-                                               $arr[$i-1] .= "'";
+                                               $arr[$i - 1] .= "'";
                                                $arr[$i] = "'''";
                                        } elseif ( strlen( $arr[$i] ) > 5 ) {
                                                # If there are more than 5 apostrophes in a row, assume they're all
                                                # text except for the last 5.
-                                               $arr[$i-1] .= str_repeat( "'", strlen( $arr[$i] ) - 5 );
+                                               $arr[$i - 1] .= str_repeat( "'", strlen( $arr[$i] ) - 5 );
                                                $arr[$i] = "'''''";
                                        }
                                        # Count the number of occurrences of bold and italics mark-ups.
@@ -1406,8 +1406,8 @@ class Parser {
                                $firstspace = -1;
                                foreach ( $arr as $r ) {
                                        if ( ( $i % 2 == 1 ) and ( strlen( $r ) == 3 ) ) {
-                                               $x1 = substr( $arr[$i-1], -1 );
-                                               $x2 = substr( $arr[$i-1], -2, 1 );
+                                               $x1 = substr( $arr[$i - 1], -1 );
+                                               $x2 = substr( $arr[$i - 1], -2, 1 );
                                                if ( $x1 === ' ' ) {
                                                        if ( $firstspace == -1 ) {
                                                                $firstspace = $i;
@@ -1428,17 +1428,17 @@ class Parser {
                                # If there is a single-letter word, use it!
                                if ( $firstsingleletterword > -1 ) {
                                        $arr[$firstsingleletterword] = "''";
-                                       $arr[$firstsingleletterword-1] .= "'";
+                                       $arr[$firstsingleletterword - 1] .= "'";
                                } elseif ( $firstmultiletterword > -1 ) {
                                        # If not, but there's a multi-letter word, use that one.
                                        $arr[$firstmultiletterword] = "''";
-                                       $arr[$firstmultiletterword-1] .= "'";
+                                       $arr[$firstmultiletterword - 1] .= "'";
                                } elseif ( $firstspace > -1 ) {
                                        # ... otherwise use the first one that has neither.
                                        # (notice that it is possible for all three to be -1 if, for example,
                                        # there is only one pentuple-apostrophe in the line)
                                        $arr[$firstspace] = "''";
-                                       $arr[$firstspace-1] .= "'";
+                                       $arr[$firstspace - 1] .= "'";
                                }
                        }
 
@@ -1539,7 +1539,7 @@ class Parser {
                $s = array_shift( $bits );
 
                $i = 0;
-               while ( $i<count( $bits ) ) {
+               while ( $i < count( $bits ) ) {
                        $url = $bits[$i++];
                        $i++; // protocol
                        $text = $bits[$i++];
@@ -2155,7 +2155,7 @@ class Parser {
        function closeParagraph() {
                $result = '';
                if ( $this->mLastSection != '' ) {
-                       $result = '</' . $this->mLastSection  . ">\n";
+                       $result = '</' . $this->mLastSection . ">\n";
                }
                $this->mInPre = false;
                $this->mLastSection = '';
@@ -2350,13 +2350,13 @@ class Parser {
 
                                # Close all the prefixes which aren't shared.
                                while ( $commonPrefixLength < $lastPrefixLength ) {
-                                       $output .= $this->closeList( $lastPrefix[$lastPrefixLength-1] );
+                                       $output .= $this->closeList( $lastPrefix[$lastPrefixLength - 1] );
                                        --$lastPrefixLength;
                                }
 
                                # Continue the current prefix if appropriate.
                                if ( $prefixLength <= $commonPrefixLength && $commonPrefixLength > 0 ) {
-                                       $output .= $this->nextItem( $prefix[$commonPrefixLength-1] );
+                                       $output .= $this->nextItem( $prefix[$commonPrefixLength - 1] );
                                }
 
                                # Open prefixes where appropriate.
@@ -2383,8 +2383,8 @@ class Parser {
                                # XXX: use a stack for nestable elements like span, table and div
                                $openmatch = preg_match( '/(?:<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<dl|<li|<\\/tr|<\\/td|<\\/th)/iS', $t );
                                $closematch = preg_match(
-                                       '/(?:<\\/table|<\\/blockquote|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|'.
-                                       '<td|<th|<\\/?div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix . '-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)/iS', $t );
+                                       '/(?:<\\/table|<\\/blockquote|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|' .
+                                       '<td|<th|<\\/?div|<hr|<\\/pre|<\\/p|' . $this->mUniqPrefix . '-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)/iS', $t );
                                if ( $openmatch or $closematch ) {
                                        $paragraphStack = false;
                                        # TODO bug 5718: paragraph closed
@@ -2441,7 +2441,7 @@ class Parser {
                        }
                }
                while ( $prefixLength ) {
-                       $output .= $this->closeList( $prefix2[$prefixLength-1] );
+                       $output .= $this->closeList( $prefix2[$prefixLength - 1] );
                        --$prefixLength;
                }
                if ( $this->mLastSection != '' ) {
@@ -2477,7 +2477,7 @@ class Parser {
                if ( $lt === false || $lt > $pos ) {
                        # Easy; no tag nesting to worry about
                        $before = substr( $str, 0, $pos );
-                       $after = substr( $str, $pos+1 );
+                       $after = substr( $str, $pos + 1 );
                        wfProfileOut( __METHOD__ );
                        return $pos;
                }
@@ -3089,7 +3089,7 @@ class Parser {
                                $assocArgs[$index++] = $arg;
                        } else {
                                $name = trim( substr( $arg, 0, $eqpos ) );
-                               $value = trim( substr( $arg, $eqpos+1 ) );
+                               $value = trim( substr( $arg, $eqpos + 1 ) );
                                if ( $value === false ) {
                                        $value = '';
                                }
@@ -4094,7 +4094,7 @@ class Parser {
         * @return mixed|string
         * @private
         */
-       function formatHeadings( $text, $origText, $isMain=true ) {
+       function formatHeadings( $text, $origText, $isMain = true ) {
                global $wgMaxTocLevel, $wgHtml5, $wgExperimentalHtmlIds;
 
                # Inhibit editsection links if requested in the page
@@ -4111,7 +4111,7 @@ class Parser {
                # Get all headlines for numbering them and adding funky stuff like [edit]
                # links - this is for later, but we need the number of headlines right now
                $matches = array();
-               $numMatches = preg_match_all( '/<H(?P<level>[1-6])(?P<attrib>.*?'.'>)\s*(?P<header>[\s\S]*?)\s*<\/H[1-6] *>/i', $text, $matches );
+               $numMatches = preg_match_all( '/<H(?P<level>[1-6])(?P<attrib>.*?' . '>)\s*(?P<header>[\s\S]*?)\s*<\/H[1-6] *>/i', $text, $matches );
 
                # if there are fewer than 4 headlines in the article, do not show TOC
                # unless it's been explicitly enabled.
@@ -4260,14 +4260,14 @@ class Parser {
                        # We strip any parameter from accepted tags (second regex), except dir="rtl|ltr" from <span>,
                        # to allow setting directionality in toc items.
                        $tocline = preg_replace(
-                               array( '#<(?!/?(span|sup|sub|i|b)(?: [^>]*)?>).*?'.'>#', '#<(/?(?:span(?: dir="(?:rtl|ltr)")?|sup|sub|i|b))(?: .*?)?'.'>#' ),
+                               array( '#<(?!/?(span|sup|sub|i|b)(?: [^>]*)?>).*?' . '>#', '#<(/?(?:span(?: dir="(?:rtl|ltr)")?|sup|sub|i|b))(?: .*?)?' . '>#' ),
                                array( '', '<$1>' ),
                                $safeHeadline
                        );
                        $tocline = trim( $tocline );
 
                        # For the anchor, strip out HTML-y stuff period
-                       $safeHeadline = preg_replace( '/<.*?'.'>/', '', $safeHeadline );
+                       $safeHeadline = preg_replace( '/<.*?' . '>/', '', $safeHeadline );
                        $safeHeadline = Sanitizer::normalizeSectionNameWhitespace( $safeHeadline );
 
                        # Save headline for section edit hint before it's escaped
index 7cb91da..1e90928 100644 (file)
@@ -72,9 +72,8 @@ class Preprocessor_DOM implements Preprocessor {
                $xml = "<list>";
 
                foreach ( $values as $k => $val ) {
-
                        if ( is_int( $k ) ) {
-                               $xml .= "<part><name index=\"$k\"/><value>" . htmlspecialchars( $val ) ."</value></part>";
+                               $xml .= "<part><name index=\"$k\"/><value>" . htmlspecialchars( $val ) . "</value></part>";
                        } else {
                                $xml .= "<part><name>" . htmlspecialchars( $k ) . "</name>=<value>" . htmlspecialchars( $val ) . "</value></part>";
                        }
@@ -441,7 +440,7 @@ class Preprocessor_DOM implements Preprocessor {
                                }
 
                                $tagStartPos = $i;
-                               if ( $text[$tagEndPos-1] == '/' ) {
+                               if ( $text[$tagEndPos - 1] == '/' ) {
                                        $attrEnd = $tagEndPos - 1;
                                        $inner = null;
                                        $i = $tagEndPos + 1;
@@ -578,7 +577,7 @@ class Preprocessor_DOM implements Preprocessor {
                                                'open' => $curChar,
                                                'close' => $rule['end'],
                                                'count' => $count,
-                                               'lineStart' => ($i > 0 && $text[$i-1] == "\n"),
+                                               'lineStart' => ($i > 0 && $text[$i - 1] == "\n"),
                                        );
 
                                        $stack->push( $piece );
index 469ce80..465c5a6 100644 (file)
@@ -367,7 +367,7 @@ class Preprocessor_Hash implements Preprocessor {
                                }
 
                                $tagStartPos = $i;
-                               if ( $text[$tagEndPos-1] == '/' ) {
+                               if ( $text[$tagEndPos - 1] == '/' ) {
                                        // Short end tag
                                        $attrEnd = $tagEndPos - 1;
                                        $inner = null;
@@ -515,7 +515,7 @@ class Preprocessor_Hash implements Preprocessor {
                                                'open' => $curChar,
                                                'close' => $rule['end'],
                                                'count' => $count,
-                                               'lineStart' => ($i > 0 && $text[$i-1] == "\n"),
+                                               'lineStart' => ($i > 0 && $text[$i - 1] == "\n"),
                                        );
 
                                        $stack->push( $piece );
index 1d4873c..b59c528 100644 (file)
@@ -96,9 +96,9 @@ class ProfilerSimple extends Profiler {
                                $this->mCollated[$functionname] =& $entry;
                        }
                        $entry['cpu'] += $elapsedcpu;
-                       $entry['cpu_sq'] += $elapsedcpu*$elapsedcpu;
+                       $entry['cpu_sq'] += $elapsedcpu * $elapsedcpu;
                        $entry['real'] += $elapsedreal;
-                       $entry['real_sq'] += $elapsedreal*$elapsedreal;
+                       $entry['real_sq'] += $elapsedreal * $elapsedreal;
                        $entry['count']++;
 
                }
index 37350bf..1d57ea8 100644 (file)
@@ -51,17 +51,17 @@ class ProfilerSimpleText extends ProfilerSimple {
                        uasort( $this->mCollated, array( 'self', 'sort' ) );
                        array_walk( $this->mCollated, array( 'self', 'format' ), $totalReal );
                        if ( PHP_SAPI === 'cli' ) {
-                               print "<!--\n".self::$out."\n-->\n";
+                               print "<!--\n" . self::$out . "\n-->\n";
                        } elseif ( $this->getContentType() === 'text/html' ) {
                                if ( $this->visible ) {
-                                       print '<pre>'.self::$out.'</pre>';
+                                       print '<pre>' . self::$out . '</pre>';
                                } else {
-                                       print "<!--\n".self::$out."\n-->\n";
+                                       print "<!--\n" . self::$out . "\n-->\n";
                                }
                        } elseif ( $this->getContentType() === 'text/javascript' ) {
-                               print "\n/*\n".self::$out."*/\n";
+                               print "\n/*\n" . self::$out . "*/\n";
                        } elseif ( $this->getContentType() === 'text/css' ) {
-                               print "\n/*\n".self::$out."*/\n";
+                               print "\n/*\n" . self::$out . "*/\n";
                        }
                }
        }
@@ -71,7 +71,7 @@ class ProfilerSimpleText extends ProfilerSimple {
        }
 
        static function format( $item, $key, $totalReal ) {
-               $perc = $totalReal ? $item['real']/$totalReal*100 : 0;
+               $perc = $totalReal ? $item['real'] / $totalReal * 100 : 0;
                self::$out .= sprintf( "%6.2f%% %3.6f %6d - %s\n",
                        $perc, $item['real'], $item['count'], $key );
        }
index 5d335b0..6743619 100644 (file)
@@ -472,7 +472,7 @@ class ResourceLoader {
                        $this->hasErrors = true;
                }
 
-               wfProfileIn( __METHOD__.'-getModifiedTime' );
+               wfProfileIn( __METHOD__ . '-getModifiedTime' );
 
                // To send Last-Modified and support If-Modified-Since, we need to detect
                // the last modified time
@@ -491,7 +491,7 @@ class ResourceLoader {
                        }
                }
 
-               wfProfileOut( __METHOD__.'-getModifiedTime' );
+               wfProfileOut( __METHOD__ . '-getModifiedTime' );
 
                // If there's an If-Modified-Since header, respond with a 304 appropriately
                if ( $this->tryRespondLastModified( $context, $mtime ) ) {
index ae5d934..d2ce0b7 100644 (file)
@@ -673,7 +673,7 @@ class RevDel_FileItem extends RevDel_Item {
                        ' (' . $this->list->msg( 'nbytes' )->numParams( $this->file->getSize() )->text() . ')';
 
                return '<li>' . $this->getLink() . ' ' . $this->getUserTools() . ' ' .
-                       $data . ' ' . $this->getComment(). '</li>';
+                       $data . ' ' . $this->getComment() . '</li>';
        }
 }
 
index 6b3e62b..c0fb278 100644 (file)
@@ -1006,7 +1006,7 @@ class SearchHighlighter {
                                                                $len = strlen( $endMatches[2][0] );
                                                                $off = $endMatches[2][1];
                                                                $this->splitAndAdd( $otherExt, $count,
-                                                                       substr( $text, $start, $off + $len  - $start ) );
+                                                                       substr( $text, $start, $off + $len - $start ) );
                                                                $start = $off + $len;
                                                                $found = true;
                                                                break;
index 605a71b..ddfd1b3 100644 (file)
@@ -449,7 +449,7 @@ class SearchMySQL extends SearchEngine {
  * @ingroup Search
  */
 class MySQLSearchResultSet extends SqlSearchResultSet {
-       function __construct( $resultSet, $terms, $totalHits=null ) {
+       function __construct( $resultSet, $terms, $totalHits = null ) {
                parent::__construct( $resultSet, $terms );
                $this->mTotalHits = $totalHits;
        }
index b8d5dc1..148a657 100644 (file)
@@ -163,7 +163,7 @@ class SearchPostgres extends SearchEngine {
                $top = $top[0];
 
                if ( $top === "" ) { ## e.g. if only stopwords are used XXX return something better
-                       $query = "SELECT page_id, page_namespace, page_title, 0 AS score ".
+                       $query = "SELECT page_id, page_namespace, page_title, 0 AS score " .
                                "FROM page p, revision r, pagecontent c WHERE p.page_latest = r.rev_id " .
                                "AND r.rev_text_id = c.old_id AND 1=0";
                }
@@ -175,8 +175,8 @@ class SearchPostgres extends SearchEngine {
                                }
                        }
 
-                       $query = "SELECT page_id, page_namespace, page_title, ".
-                       "ts_rank($fulltext, to_tsquery($searchstring), 5) AS score ".
+                       $query = "SELECT page_id, page_namespace, page_title, " .
+                       "ts_rank($fulltext, to_tsquery($searchstring), 5) AS score " .
                        "FROM page p, revision r, pagecontent c WHERE p.page_latest = r.rev_id " .
                        "AND r.rev_text_id = c.old_id AND $fulltext @@ to_tsquery($searchstring)";
                }
@@ -208,7 +208,7 @@ class SearchPostgres extends SearchEngine {
 
        function update( $pageid, $title, $text ) {
                ## We don't want to index older revisions
-               $SQL = "UPDATE pagecontent SET textvector = NULL WHERE old_id IN ".
+               $SQL = "UPDATE pagecontent SET textvector = NULL WHERE old_id IN " .
                                "(SELECT rev_text_id FROM revision WHERE rev_page = " . intval( $pageid ) .
                                " ORDER BY rev_text_id DESC OFFSET 1)";
                $this->db->query( $SQL );
index ee30d9b..5b0b7f7 100644 (file)
@@ -333,7 +333,7 @@ class SearchSqlite extends SearchEngine {
  * @ingroup Search
  */
 class SqliteSearchResultSet extends SqlSearchResultSet {
-       function __construct( $resultSet, $terms, $totalHits=null ) {
+       function __construct( $resultSet, $terms, $totalHits = null ) {
                parent::__construct( $resultSet, $terms );
                $this->mTotalHits = $totalHits;
        }
index fc6172f..68b0024 100644 (file)
@@ -35,7 +35,7 @@ class SpecialImport extends SpecialPage {
        private $namespace;
        private $rootpage = '';
        private $frompage = '';
-       private $logcomment= false;
+       private $logcomment = false;
        private $history = true;
        private $includeTemplates = false;
        private $pageLinkDepth;
@@ -188,7 +188,7 @@ class SpecialImport extends SpecialPage {
 
                if( $user->isAllowed( 'importupload' ) ) {
                        $out->addHTML(
-                               Xml::fieldset( $this->msg( 'import-upload' )->text() ).
+                               Xml::fieldset( $this->msg( 'import-upload' )->text() ) .
                                Xml::openElement( 'form', array( 'enctype' => 'multipart/form-data', 'method' => 'post',
                                        'action' => $action, 'id' => 'mw-import-upload-form' ) ) .
                                $this->msg( 'importtext' )->parseAsBlock() .
@@ -228,7 +228,7 @@ class SpecialImport extends SpecialPage {
                                                Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) .
                                        "</td>
                                </tr>" .
-                               Xml::closeElement( 'table' ).
+                               Xml::closeElement( 'table' ) .
                                Html::hidden( 'editToken', $user->getEditToken() ) .
                                Xml::closeElement( 'form' ) .
                                Xml::closeElement( 'fieldset' )
@@ -335,7 +335,7 @@ class SpecialImport extends SpecialPage {
                                                Xml::submitButton( $this->msg( 'import-interwiki-submit' )->text(), Linker::tooltipAndAccesskeyAttribs( 'import' ) ) .
                                        "</td>
                                </tr>" .
-                               Xml::closeElement( 'table' ).
+                               Xml::closeElement( 'table' ) .
                                Xml::closeElement( 'form' ) .
                                Xml::closeElement( 'fieldset' )
                        );
@@ -352,7 +352,7 @@ class SpecialImport extends SpecialPage {
  * @ingroup SpecialPage
  */
 class ImportReporter extends ContextSource {
-       private $reason=false;
+       private $reason = false;
        private $mOriginalLogCallback = null;
        private $mOriginalPageOutCallback = null;
        private $mLogItemCount = 0;
index 1bd33df..af5b0a1 100644 (file)
@@ -72,7 +72,7 @@ class LinkSearchPage extends QueryPage {
                } elseif ( !$pr_sl && $pr_cl ) {
                        // For protocols without '//' like 'mailto:'
                        $protocol = substr( $target2, 0, $pr_cl + 1 );
-                       $target2 = substr( $target2, $pr_cl+1 );
+                       $target2 = substr( $target2, $pr_cl + 1 );
                } elseif ( $protocol == '' && $target2 != '' ) {
                        // default
                        $protocol = 'http://';
index 4adb037..c35c44e 100644 (file)
@@ -532,7 +532,7 @@ class MovePageForm extends UnlistedSpecialPage {
                ) ) {
                        $conds = array(
                                'page_title' . $dbr->buildLike( $ot->getDBkey() . '/', $dbr->anyString() )
-                                       .' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() )
+                                       . ' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() )
                        );
                        $conds['page_namespace'] = array();
                        if( MWNamespace::hasSubpages( $nt->getNamespace() ) ) {
@@ -571,7 +571,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        }
 
                        $newPageName = preg_replace(
-                               '#^'.preg_quote( $ot->getDBkey(), '#' ).'#',
+                               '#^' . preg_quote( $ot->getDBkey(), '#' ) . '#',
                                StringUtils::escapeRegexReplacement( $nt->getDBkey() ), # bug 21234
                                $oldSubpage->getDBkey()
                        );
index d9145b8..6772cb5 100644 (file)
@@ -887,7 +887,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $links = array();
                foreach ( $filters as $key => $msg ) {
                        $link = $this->makeOptionsLink( $showhide[1 - $options[$key]],
-                               array( $key => 1-$options[$key] ), $nondefaults );
+                               array( $key => 1 - $options[$key] ), $nondefaults );
                        $links[] = $this->msg( $msg )->rawParams( $link )->escaped();
                }
 
index a4ab7a8..1bf5601 100644 (file)
@@ -733,7 +733,7 @@ class SpecialSearch extends SpecialPage {
                wfProfileIn( __METHOD__ );
                $terms = $wgContLang->convertForSearchResult( $matches->termMatches() );
 
-               $out = "<div id='mw-search-interwiki'><div id='mw-search-interwiki-caption'>".
+               $out = "<div id='mw-search-interwiki'><div id='mw-search-interwiki-caption'>" .
                        $this->msg( 'search-interwiki-caption' )->text() . "</div>\n";
                $out .= "<ul class='mw-search-iwresults'>\n";
 
index 57fffb8..b763322 100644 (file)
@@ -104,7 +104,7 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
 
                        $out->wrapWikiMsg( "<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n", "specialpages-group-$group" );
                        $out->addHTML(
-                               Html::openElement( 'table', array( 'style' => 'width:100%;', 'class' => 'mw-specialpages-table' ) ) ."\n" .
+                               Html::openElement( 'table', array( 'style' => 'width:100%;', 'class' => 'mw-specialpages-table' ) ) . "\n" .
                                Html::openElement( 'tr' ) . "\n" .
                                Html::openElement( 'td', array( 'style' => 'width:30%;vertical-align:top' ) ) . "\n" .
                                Html::openElement( 'ul' ) . "\n"
index 199460e..e1d6e20 100644 (file)
@@ -64,7 +64,7 @@ class SpecialStatistics extends SpecialPage {
                        if( !$wgMemc->get( $key ) ) {
                                $dbw = wfGetDB( DB_MASTER );
                                SiteStatsUpdate::cacheUpdate( $dbw );
-                               $wgMemc->set( $key, '1', 24*3600 ); // don't update for 1 day
+                               $wgMemc->set( $key, '1', 24 * 3600 ); // don't update for 1 day
                        }
                }
 
index 336363d..7935d13 100644 (file)
@@ -448,12 +448,12 @@ class UserrightsPage extends SpecialPage {
                $count = count( $list );
                if ( $count > 0 ) {
                        $grouplist = $this->msg( 'userrights-groupsmember', $count, $user->getName() )->parse();
-                       $grouplist = '<p>' . $grouplist  . ' ' . $displayedList . "</p>\n";
+                       $grouplist = '<p>' . $grouplist . ' ' . $displayedList . "</p>\n";
                }
                $count = count( $autoList );
                if ( $count > 0 ) {
                        $autogrouplistintro = $this->msg( 'userrights-groupsmember-auto', $count, $user->getName() )->parse();
-                       $grouplist .= '<p>' . $autogrouplistintro  . ' ' . $displayedAutolist . "</p>\n";
+                       $grouplist .= '<p>' . $autogrouplistintro . ' ' . $displayedAutolist . "</p>\n";
                }
 
                $userToolLinks = Linker::userToolLinks(
index 8dd38d4..581727d 100644 (file)
@@ -113,7 +113,7 @@ class SpecialVersion extends SpecialPage {
                global $wgLang;
 
                if ( defined( 'MEDIAWIKI_INSTALL' ) ) {
-                       $othersLink = '[http://www.mediawiki.org/wiki/Special:Version/Credits ' .       wfMessage( 'version-poweredby-others' )->text() . ']';
+                       $othersLink = '[http://www.mediawiki.org/wiki/Special:Version/Credits ' . wfMessage( 'version-poweredby-others' )->text() . ']';
                } else {
                        $othersLink = '[[Special:Version/Credits|' . wfMessage( 'version-poweredby-others' )->text() . ']]';
                }
@@ -395,7 +395,7 @@ class SpecialVersion extends SpecialPage {
                                $tags[$i] = "&lt;{$tags[$i]}&gt;";
                        }
                        $out .= $this->openExtType( $this->msg( 'version-parser-extensiontags' )->text(), 'parser-tags' );
-                       $out .= '<tr><td colspan="4">' . $this->listToText( $tags ). "</td></tr>\n";
+                       $out .= '<tr><td colspan="4">' . $this->listToText( $tags ) . "</td></tr>\n";
                }
 
                $fhooks = $wgParser->getFunctionHooks();
index bf809a1..c98c445 100644 (file)
@@ -900,7 +900,7 @@ abstract class UploadBase {
                                        "unrecognized extension '$extension', can't verify\n" );
                                return true;
                        } else {
-                               wfDebug( __METHOD__ . ": rejecting file with unknown detected mime type; ".
+                               wfDebug( __METHOD__ . ": rejecting file with unknown detected mime type; " .
                                        "recognized extension '$extension', so probably invalid file\n" );
                                return false;
                        }
@@ -1454,7 +1454,7 @@ abstract class UploadBase {
                                // Remove additional comments after a prefix
                                $comment = strpos( $line, '#' );
                                if ( $comment > 0 ) {
-                                       $line = substr( $line, 0, $comment-1 );
+                                       $line = substr( $line, 0, $comment - 1 );
                                }
                                $blacklist[] = trim( $line );
                        }
index 326d91d..a90fecf 100644 (file)
@@ -209,7 +209,7 @@ class UploadStash {
                list( $usec, $sec ) = explode( ' ', microtime() );
                $usec = substr( $usec, 2 );
                $key = wfBaseConvert( $sec . $usec, 10, 36 ) . '.' .
-                       wfBaseConvert( mt_rand(), 10, 36 ) . '.'.
+                       wfBaseConvert( mt_rand(), 10, 36 ) . '.' .
                        $this->userId . '.' .
                        $extension;
 
index b653f99..416b1cf 100644 (file)
@@ -1637,7 +1637,7 @@ class Language {
        private static function hebrewYearStart( $year ) {
                $a = intval( ( 12 * ( $year - 1 ) + 17 ) % 19 );
                $b = intval( ( $year - 1 ) % 4 );
-               $m = 32.044093161144 + 1.5542417966212 * $a +  $b / 4.0 - 0.0031777940220923 * ( $year - 1 );
+               $m = 32.044093161144 + 1.5542417966212 * $a + $b / 4.0 - 0.0031777940220923 * ( $year - 1 );
                if ( $m < 0 ) {
                        $m--;
                }
@@ -3022,7 +3022,7 @@ class Language {
                        $sign = "";
                        if ( intval( $number ) < 0 ) {
                                // For negative numbers apply the algorithm like positive number and add sign.
-                               $sign =  "-";
+                               $sign = "-";
                                $number = substr( $number, 1 );
                        }
                        $integerPart = array();
@@ -3031,7 +3031,7 @@ class Language {
                        preg_match( "/\d+/", $number, $integerPart );
                        preg_match( "/\.\d*/", $number, $decimalPart );
                        $groupedNumber = ( count( $decimalPart ) > 0 ) ? $decimalPart[0]:"";
-                       if ( $groupedNumber  === $number ) {
+                       if ( $groupedNumber === $number ) {
                                // the string does not have any number part. Eg: .12345
                                return $sign . $groupedNumber;
                        }
index 074ad13..9398899 100644 (file)
@@ -104,17 +104,17 @@ class LanguageKsh extends Language {
                        # däm WikiMaatplaz sing, dä Wikipeedija ier, däm Wikiwööterbooch sing
                        # dem/em WikiMaatplaz sing, de Wikipeedija ier, dem/em Wikiwööterbooch sing
                        $word = ( preg_match( '/ b/', $case )
-                                               ? ( $gender=='f' ? 'dä' : 'däm' )
-                                               : ( $gender=='f' ? 'de' : 'dem' )
+                                               ? ( $gender == 'f' ? 'dä' : 'däm' )
+                                               : ( $gender == 'f' ? 'de' : 'dem' )
                                        ) . ' ' . $word . ' ' .
-                                       ( $gender=='f' ? 'ier' : 'sing' ) .
+                                       ( $gender == 'f' ? 'ier' : 'sing' ) .
                                        ( preg_match( '/ m/', $case ) ? 'e' : ''
                                );
                } elseif ( preg_match( '/ e/', $case ) ) {
                        # en dämm WikiMaatPlaz, en dä Wikipeedija, en dämm Wikiwööterbooch
                        # em WikiMaatplaz, en de Wikipeedija, em Wikiwööterbooch
                        if ( preg_match( '/ b/', $case ) ) {
-                               $word = 'en '.( $gender == 'f' ? 'dä' : 'däm' ) . ' ' . $word;
+                               $word = 'en ' . ( $gender == 'f' ? 'dä' : 'däm' ) . ' ' . $word;
                        } else {
                                $word = ( $gender == 'f' ? 'en de' : 'em' ) . ' ' . $word;
                        }
@@ -124,13 +124,13 @@ class LanguageKsh extends Language {
                        if ( preg_match( '/ b/', $case ) ) {
                                $word = 'vun ' . ( $gender == 'f' ? 'dä' : 'däm' ) . ' ' . $word;
                        } else {
-                               $word = ( $gender== 'f' ? 'vun de' : 'vum' ) . ' ' . $word;
+                               $word = ( $gender == 'f' ? 'vun de' : 'vum' ) . ' ' . $word;
                        }
                } elseif ( preg_match( '/ [3d]/', $case ) ) {
                        # dämm WikiMaatPlaz, dä Wikipeedija, dämm Wikiwööterbooch
                        # dem/em WikiMaatplaz, de Wikipeedija, dem/em Wikiwööterbooch
                        if ( preg_match( '/ b/', $case ) ) {
-                               $word = ( $gender == 'f' ? 'dää' : 'dämm' ) .' ' . $word;
+                               $word = ( $gender == 'f' ? 'dää' : 'dämm' ) . ' ' . $word;
                        } else {
                                $word = ( $gender == 'f' ? 'de' : 'dem' ) . ' ' . $word;
                        }
@@ -160,7 +160,7 @@ class LanguageKsh extends Language {
                                                $lord = 'et';
                                }
                        }
-                       $word = $lord.' '.$word;
+                       $word = $lord . ' ' . $word;
                }
                return $word;
        }
index 6d147c8..fc1e8a8 100644 (file)
@@ -150,7 +150,7 @@ class LanguageTyv extends Language {
                                                $word = implode( "", $ar[0] ) . "Ñ‚Ñ‹";
                                        } else {
                                        }
-                               } elseif ( $wordEnding === "л"  || $wordEnding === "l" ) {
+                               } elseif ( $wordEnding === "л" || $wordEnding === "l" ) {
                                        if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
                                                $word = implode( "", $ar[0] ) . "дү";
                                        } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
index 9e90c7f..5fe4e8f 100644 (file)
@@ -84,16 +84,16 @@ class LanguageWa extends Language {
                $n = substr( $ts, 6, 2 );
                if ( $n == 1 ) {
                    $d = "1î d' " . $this->getMonthName( $m ) .
-                       " " .  substr( $ts, 0, 4 );
+                       " " . substr( $ts, 0, 4 );
                } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
                    $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
-                       " " .  substr( $ts, 0, 4 );
+                       " " . substr( $ts, 0, 4 );
                } elseif ( $m == 4 || $m == 8 || $m == 10 ) {
                    $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
-                       " " .  substr( $ts, 0, 4 );
+                       " " . substr( $ts, 0, 4 );
                } else {
                    $d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) .
-                       " " .  substr( $ts, 0, 4 );
+                       " " . substr( $ts, 0, 4 );
                }
                return $d;
        }
index a13453d..08d8641 100644 (file)
@@ -153,7 +153,7 @@ abstract class Maintenance {
                        return false; // last call should be to this function
                }
                $includeFuncs = array( 'require_once', 'require', 'include', 'include_once' );
-               for( $i=1; $i < $count; $i++ ) {
+               for( $i = 1; $i < $count; $i++ ) {
                        if ( !in_array( $bt[$i]['function'], $includeFuncs ) ) {
                                return false; // previous calls should all be "requires"
                        }
index 0b8b344..eaac02c 100644 (file)
@@ -298,7 +298,7 @@ class TextPassDumper extends BackupDumper {
        }
 
        function checkIfTimeExceeded() {
-               if ( $this->maxTimeAllowed &&  ( $this->lastTime - $this->timeOfCheckpoint  > $this->maxTimeAllowed ) ) {
+               if ( $this->maxTimeAllowed && ( $this->lastTime - $this->timeOfCheckpoint > $this->maxTimeAllowed ) ) {
                        return true;
                }
                return false;
index 98b35b5..9fb39fb 100644 (file)
@@ -48,20 +48,20 @@ abstract class Benchmarker extends Maintenance {
 
                foreach( $benchs as $bench ) {
                        // handle empty args
-                       if(!array_key_exists( 'args', $bench )) {
+                       if( !array_key_exists( 'args', $bench ) ) {
                                $bench['args'] = array();
                        }
 
                        $bench_number++;
                        $start = microtime( true );
-                       for( $i=0; $i<$count; $i++ ) {
+                       for( $i = 0; $i < $count; $i++ ) {
                                call_user_func_array( $bench['function'], $bench['args'] );
                        }
                        $delta = microtime( true ) - $start;
 
                        // function passed as a callback
                        if( is_array( $bench['function'] ) ) {
-                               $ret = get_class( $bench['function'][0] ). '->' . $bench['function'][1];
+                               $ret = get_class( $bench['function'][0] ) . '->' . $bench['function'][1];
                                $bench['function'] = $ret;
                        }
 
@@ -85,7 +85,7 @@ abstract class Benchmarker extends Maintenance {
                                join( ', ', $res['arguments'] )
                        );
                        $ret .= sprintf( "   %6.2fms (%6.2fms each)\n",
-                               $res['delta']   * 1000,
+                               $res['delta'] * 1000,
                                $res['average'] * 1000
                        );
                }
index 870d632..9e61bd4 100644 (file)
@@ -47,7 +47,7 @@ abstract class DumpIterator extends Maintenance {
        }
 
        public function execute() {
-               if (( $this->hasOption('file') ^ $this->hasOption('dump') ) ) {
+               if ( !( $this->hasOption('file') ^ $this->hasOption('dump') ) ) {
                        $this->error("You must provide a file or dump", true);
                }
 
@@ -96,7 +96,7 @@ abstract class DumpIterator extends Maintenance {
                if ( $this->getDbType() == Maintenance::DB_NONE ) {
                        global $wgUseDatabaseMessages, $wgLocalisationCacheConf, $wgHooks;
                        $wgUseDatabaseMessages = false;
-                       $wgLocalisationCacheConf['storeClass'] =  'LCStore_Null';
+                       $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null';
                        $wgHooks['InterwikiLoadPrefix'][] = 'DumpIterator::disableInterwikis';
                }
        }
index 691ed80..39731b1 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( __DIR__ .'/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that formats RELEASE-NOTE file to wiki text or HTML markup.
index 904b624..9553a1f 100644 (file)
@@ -266,7 +266,7 @@ TEXT;
                        $importer->setNoUpdates( true );
                }
                $importer->setPageCallback( array( &$this, 'reportPage' ) );
-               $this->importCallback =  $importer->setRevisionCallback(
+               $this->importCallback = $importer->setRevisionCallback(
                        array( &$this, 'handleRevision' ) );
                $this->uploadCallback = $importer->setUploadCallback(
                        array( &$this, 'handleUpload' ) );
index 782f502..9d9a77d 100644 (file)
@@ -107,12 +107,12 @@ $timestamp = isset( $options['timestamp'] ) ? $options['timestamp'] : false;
 $comment = 'Importing image file';
 
 if ( isset( $options['comment-file'] ) ) {
-       $comment =  file_get_contents( $options['comment-file'] );
+       $comment = file_get_contents( $options['comment-file'] );
        if ( $comment === false || $comment === null ) {
                die( "failed to read comment file: {$options['comment-file']}\n" );
        }
 } elseif ( isset( $options['comment'] ) ) {
-       $comment =  $options['comment'];
+       $comment = $options['comment'];
 }
 
 $commentExt = isset( $options['comment-ext'] ) ? $options['comment-ext'] : false;
index 935a296..242358b 100644 (file)
@@ -29,7 +29,7 @@ if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '
 define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
 define( 'MEDIAWIKI_INSTALL', true );
 
-require_once( dirname( __DIR__ )."/maintenance/Maintenance.php" );
+require_once( dirname( __DIR__ ) . "/maintenance/Maintenance.php" );
 
 /**
  * Maintenance script to install and configure MediaWiki
index 1860f4a..3fa8ede 100644 (file)
@@ -25,7 +25,7 @@
  * @ingroup MaintenanceLanguage
  */
 class CheckLanguageCLI {
-       protected $code  = null;
+       protected $code = null;
        protected $level = 2;
        protected $doLinks = false;
        protected $linksPrefix = '';
index 12823c0..786ba5b 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup MaintenanceLanguage
  */
 
-require_once( __DIR__ .'/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 /**
  * Generate first letter data files for Collation.php
@@ -102,7 +102,7 @@ class GenerateCollationData extends Maintenance {
                                $error .= "You are using outdated version of ICU ($icuVersion), intended for "
                                        . ( $unicodeVersion ? "Unicode $unicodeVersion" : "an unknown version of Unicode" )
                                        . "; this file might not be avalaible for it, and it's not supported by MediaWiki. "
-                                       ." You are on your own; consider upgrading PHP's intl extension or try "
+                                       . " You are on your own; consider upgrading PHP's intl extension or try "
                                        . "one of the files available at:";
                        } elseif ( version_compare( $icuVersion, "51.0", ">=" ) ) {
                                // Extra recent version
@@ -386,7 +386,7 @@ class UcdXmlReader {
                $this->xml = new XMLReader;
                $this->xml->open( $this->fileName );
                if ( !$this->xml ) {
-                       throw new MWException( __METHOD__.": unable to open {$this->fileName}" );
+                       throw new MWException( __METHOD__ . ": unable to open {$this->fileName}" );
                }
                while ( $this->xml->name !== 'ucd' && $this->xml->read() );
                $this->xml->read();
index b2e04c7..17e1b2e 100644 (file)
@@ -243,10 +243,10 @@ $blockComment
 
                        if( strpos( $value, $single ) === false ) {
                                # Nothing ugly, just use '
-                               $blockText .= $single.$value.$single;
+                               $blockText .= $single . $value . $single;
                        } elseif( strpos( $value, $double ) === false && !preg_match('/\$[a-zA-Z_\x7f-\xff]/', $value) ) {
                                # No "-quotes, no variables that need quoting, use "
-                               $blockText .= $double.$value.$double;
+                               $blockText .= $double . $value . $double;
                        } else {
                                # Something needs quoting, pick the quote which causes less quoting
                                $quote = substr_count( $value, $double ) + substr_count( $value, '$' ) >= substr_count( $value, $single ) ? $single : $double;
index 58e76b0..8ca9fbb 100644 (file)
@@ -90,7 +90,7 @@ class CLIParser extends Maintenance {
 
                if( $input_file === $php_stdin ) {
                        $ctrl = wfIsWindows() ? 'CTRL+Z' : 'CTRL+D';
-                       $this->error( basename(__FILE__) .": warning: reading wikitext from STDIN. Press $ctrl to parse.\n" );
+                       $this->error( basename(__FILE__) . ": warning: reading wikitext from STDIN. Press $ctrl to parse.\n" );
                }
 
                return file_get_contents( $input_file );
index fb66db0..0945c9d 100644 (file)
@@ -74,7 +74,7 @@ class PurgeList extends Maintenance {
                                }
                        }
                }
-               $this->output( "Purging " . count( $urls ). " urls\n" );
+               $this->output( "Purging " . count( $urls ) . " urls\n" );
                $this->sendPurgeRequest( $urls );
        }
 
index bfaaab5..ea2051e 100644 (file)
@@ -61,9 +61,9 @@ class RebuildRecentchanges extends Maintenance {
                $this->output( '$wgRCMaxAge=' . $wgRCMaxAge );
                $days = $wgRCMaxAge / 24 / 3600;
                if ( intval( $days ) == $days ) {
-                               $this->output( " (" . $days . " days)\n" );
+                       $this->output( " (" . $days . " days)\n" );
                } else {
-                               $this->output( " (approx. " .  intval( $days ) . " days)\n" );
+                       $this->output( " (approx. " . intval( $days ) . " days)\n" );
                }
 
                $cutoff = time() - $wgRCMaxAge;
index d636283..8d372e1 100644 (file)
@@ -357,10 +357,10 @@ class CompressOld extends Maintenance {
                                                }
                                                # Store External Storage URLs instead of Stub placeholders
                                                foreach ($stubs as $stub) {
-                                                       if ($stub===false)
+                                                       if ( $stub === false )
                                                                continue;
                                                        # $stored should provide base path to a BLOB
-                                                       $url = $stored."/".$stub->getHash();
+                                                       $url = $stored . "/" . $stub->getHash();
                                                        $dbw->update( 'text',
                                                                array( /* SET */
                                                                        'old_text' => $url,
index 21b07f7..ae97a8a 100644 (file)
@@ -127,7 +127,7 @@ class CologneBlueTemplate extends BaseTemplate {
         *
         * @return string
         */
-       function processBottomLink( $key, $navlink, $message=null ) {
+       function processBottomLink( $key, $navlink, $message = null ) {
                if ( !$navlink ) {
                        // Empty navlinks might be passed.
                        return null;
@@ -246,7 +246,7 @@ class CologneBlueTemplate extends BaseTemplate {
         * @param $navlink array Navigational link generated by SkinTemplate
         * @param $idPrefix mixed Prefix to add to id of this navlink. If false, id is removed entirely. Default is 'cb-'.
         */
-       function processNavlinkForDocument( $navlink, $idPrefix='cb-' ) {
+       function processNavlinkForDocument( $navlink, $idPrefix = 'cb-' ) {
                if ( $navlink['id'] ) {
                        $navlink['single-id'] = $navlink['id']; // to allow for tooltip generation
                        $navlink['tooltiponly'] = true; // but no accesskeys
@@ -255,7 +255,7 @@ class CologneBlueTemplate extends BaseTemplate {
                        if ( $idPrefix === false ) {
                                unset( $navlink['id'] );
                        } else {
-                               $navlink['id'] =  $idPrefix . $navlink['id'];
+                               $navlink['id'] = $idPrefix . $navlink['id'];
                        }
                }
 
index 0f37182..b862040 100644 (file)
@@ -233,35 +233,35 @@ class BlockTest extends MediaWikiLangTestCase {
 
                $blockList = array(
                        array( 'target' => '70.2.0.0/16',
-                               'type' =>  Block::TYPE_RANGE,
+                               'type' => Block::TYPE_RANGE,
                                'desc' => 'Range Hardblock',
                                'ACDisable' => false,
                                'isHardblock' => true,
                                'isAutoBlocking' => false,
                        ),
                        array( 'target' => '2001:4860:4001::/48',
-                               'type' =>  Block::TYPE_RANGE,
+                               'type' => Block::TYPE_RANGE,
                                'desc' => 'Range6 Hardblock',
                                'ACDisable' => false,
                                'isHardblock' => true,
                                'isAutoBlocking' => false,
                        ),
                        array( 'target' => '60.2.0.0/16',
-                               'type' =>  Block::TYPE_RANGE,
+                               'type' => Block::TYPE_RANGE,
                                'desc' => 'Range Softblock with AC Disabled',
                                'ACDisable' => true,
                                'isHardblock' => false,
                                'isAutoBlocking' => false,
                        ),
                        array( 'target' => '50.2.0.0/16',
-                               'type' =>  Block::TYPE_RANGE,
+                               'type' => Block::TYPE_RANGE,
                                'desc' => 'Range Softblock',
                                'ACDisable' => false,
                                'isHardblock' => false,
                                'isAutoBlocking' => false,
                        ),
                        array( 'target' => '50.1.1.1',
-                               'type' =>  Block::TYPE_IP,
+                               'type' => Block::TYPE_IP,
                                'desc' => 'Exact Softblock',
                                'ACDisable' => false,
                                'isHardblock' => false,