fix some spacing
authorumherirrender <umherirrender_de.wp@web.de>
Sun, 24 Mar 2013 10:01:51 +0000 (11:01 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 25 Mar 2013 22:22:46 +0000 (22:22 +0000)
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3

109 files changed:
includes/ArrayUtils.php
includes/Cdb_PHP.php
includes/ChangesFeed.php
includes/ChangesList.php
includes/Collation.php
includes/Defines.php
includes/Exception.php
includes/Export.php
includes/GlobalFunctions.php
includes/HTMLForm.php
includes/Hooks.php
includes/HttpFunctions.php
includes/ImagePage.php
includes/Import.php
includes/LinksUpdate.php
includes/MWFunction.php
includes/MimeMagic.php
includes/Namespace.php
includes/OutputPage.php
includes/Revision.php
includes/RevisionList.php
includes/Sanitizer.php
includes/SeleniumWebSettings.php
includes/Setup.php
includes/SiteConfiguration.php
includes/Skin.php
includes/Timestamp.php
includes/Title.php
includes/User.php
includes/UserArray.php
includes/WebRequest.php
includes/WikiMap.php
includes/WikiPage.php
includes/Xml.php
includes/api/ApiBase.php
includes/api/ApiImageRotate.php
includes/api/ApiMain.php
includes/api/ApiPageSet.php
includes/api/ApiQueryAllCategories.php
includes/api/ApiQueryBacklinks.php
includes/api/ApiQueryBlocks.php
includes/api/ApiQuerySiteinfo.php
includes/cache/SquidUpdate.php
includes/content/ContentHandler.php
includes/db/Database.php
includes/db/DatabaseMssql.php
includes/db/DatabaseOracle.php
includes/db/LBFactory.php
includes/diff/DairikiDiff.php
includes/filebackend/FileBackendMultiWrite.php
includes/filerepo/file/File.php
includes/filerepo/file/ForeignAPIFile.php
includes/installer/DatabaseInstaller.php
includes/installer/DatabaseUpdater.php
includes/installer/Installer.php
includes/installer/LocalSettingsGenerator.php
includes/installer/MysqlInstaller.php
includes/installer/OracleInstaller.php
includes/installer/PostgresInstaller.php
includes/installer/PostgresUpdater.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerPage.php
includes/media/BMP.php
includes/media/Bitmap.php
includes/media/DjVuImage.php
includes/media/ExifBitmap.php
includes/media/FormatMetadata.php
includes/media/ImageHandler.php
includes/media/Jpeg.php
includes/media/MediaHandler.php
includes/media/PNGMetadataExtractor.php
includes/media/SVGMetadataExtractor.php
includes/media/XMP.php
includes/media/XMPValidate.php
includes/objectcache/MemcachedClient.php
includes/parser/DateFormatter.php
includes/parser/LinkHolderArray.php
includes/parser/Parser.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/profiler/Profiler.php
includes/profiler/ProfilerSimpleUDP.php
includes/resourceloader/ResourceLoaderLanguageDataModule.php
includes/revisiondelete/RevisionDelete.php
includes/revisiondelete/RevisionDeleteAbstracts.php
includes/revisiondelete/RevisionDeleter.php
includes/search/SearchMySQL.php
includes/search/SearchOracle.php
includes/search/SearchPostgres.php
includes/search/SearchSqlite.php
includes/search/SearchUpdate.php
includes/site/MediaWikiSite.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialBlock.php
includes/specials/SpecialCategories.php
includes/specials/SpecialContributions.php
includes/specials/SpecialEmailuser.php
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialProtectedpages.php
includes/specials/SpecialProtectedtitles.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialSearch.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialWatchlist.php
includes/specials/SpecialWhatlinkshere.php
includes/templates/NoLocalSettings.php
includes/upload/UploadBase.php
includes/upload/UploadFromChunks.php

index 0b74f06..985271f 100644 (file)
@@ -39,7 +39,7 @@ class ArrayUtils {
         *
         * @return bool|int|string
         */
-       public static function pickRandom( $weights ){
+       public static function pickRandom( $weights ) {
                if ( !is_array( $weights ) || count( $weights ) == 0 ) {
                        return false;
                }
index 71b55f8..e16397b 100644 (file)
@@ -411,7 +411,7 @@ class CdbWriter_PHP extends CdbWriter {
                // Calculate the number of items that will be in each hashtable
                $counts = array_fill( 0, 256, 0 );
                foreach ( $this->hplist as $item ) {
-                       ++ $counts[ 255 & $item['h'] ];
+                       ++ $counts[255 & $item['h']];
                }
 
                // Fill in $starts with the *end* indexes
index 476de5b..ac6d332 100644 (file)
@@ -146,7 +146,7 @@ class ChangesFeed {
                        $feedLastmodUnix = wfTimestamp( TS_UNIX, $feedLastmod );
                        $lastmodUnix = wfTimestamp( TS_UNIX, $lastmod );
 
-                       if( $feedAge < $wgFeedCacheTimeout || $feedLastmodUnix > $lastmodUnix) {
+                       if( $feedAge < $wgFeedCacheTimeout || $feedLastmodUnix > $lastmodUnix ) {
                                wfDebug( "RC: loading feed from cache ($key; $feedLastmod; $lastmod)...\n" );
                                if ( $feedLastmodUnix < $lastmodUnix ) {
                                        $wgOut->setLastModified( $feedLastmod ); // bug 21916
index 8461001..0c4d69e 100644 (file)
@@ -936,7 +936,7 @@ class EnhancedChangesList extends ChangesList {
                krsort( $userlinks );
                asort( $userlinks );
                $users = array();
-               foreach( $userlinks as $userlink => $count) {
+               foreach( $userlinks as $userlink => $count ) {
                        $text = $userlink;
                        $text .= $this->getLanguage()->getDirMark();
                        if( $count > 1 ) {
index 3f0fa7b..107e8f9 100644 (file)
@@ -364,8 +364,8 @@ class IcuCollation extends Collation {
                        // Append additional characters
                        $letters = array_merge( $letters, self::$tailoringFirstLetters[$this->locale] );
                        // Remove unnecessary ones, if any
-                       if ( isset( self::$tailoringFirstLetters[ '-' . $this->locale ] ) ) {
-                               $letters = array_diff( $letters, self::$tailoringFirstLetters[ '-' . $this->locale ] );
+                       if ( isset( self::$tailoringFirstLetters['-' . $this->locale] ) ) {
+                               $letters = array_diff( $letters, self::$tailoringFirstLetters['-' . $this->locale] );
                        }
                } else {
                        $letters = wfGetPrecompiledData( "first-letters-{$this->locale}.ser" );
index c4a8633..28847db 100644 (file)
@@ -197,8 +197,8 @@ define( 'EDIT_AUTOSUMMARY', 64 );
 define( 'LIST_COMMA', 0 );
 define( 'LIST_AND', 1 );
 define( 'LIST_SET', 2 );
-define( 'LIST_NAMES', 3);
-define( 'LIST_OR', 4);
+define( 'LIST_NAMES', 3 );
+define( 'LIST_OR', 4 );
 /**@}*/
 
 /**
index 0bd7a2a..7d9f63d 100644 (file)
@@ -75,11 +75,11 @@ class MWException extends Exception {
                        return null; // Just silently ignore
                }
 
-               if ( !array_key_exists( $name, $wgExceptionHooks ) || !is_array( $wgExceptionHooks[ $name ] ) ) {
+               if ( !array_key_exists( $name, $wgExceptionHooks ) || !is_array( $wgExceptionHooks[$name] ) ) {
                        return null;
                }
 
-               $hooks = $wgExceptionHooks[ $name ];
+               $hooks = $wgExceptionHooks[$name];
                $callargs = array_merge( array( $this ), $args );
 
                foreach ( $hooks as $hook ) {
@@ -130,8 +130,7 @@ class MWException extends Exception {
                                '</p><p>Backtrace:</p><p>' . nl2br( htmlspecialchars( $this->getTraceAsString() ) ) .
                                "</p>\n";
                } else {
-                       return
-                               "<div class=\"errorbox\">" .
+                       return "<div class=\"errorbox\">" .
                                '[' . $this->getLogId() . '] ' .
                                gmdate( 'Y-m-d H:i:s' ) .
                                ": Fatal exception of type " . get_class( $this ) . "</div>\n" .
index d8cc024..8df7dcb 100644 (file)
@@ -563,8 +563,9 @@ class XmlDumpWriter {
                foreach ( $wgContLang->getFormattedNamespaces() as $ns => $title ) {
                        $spaces .= '      ' .
                                Xml::element( 'namespace',
-                                       array(  'key' => $ns,
-                                                       'case' => MWNamespace::isCapitalized( $ns ) ? 'first-letter' : 'case-sensitive',
+                                       array(
+                                               'key' => $ns,
+                                               'case' => MWNamespace::isCapitalized( $ns ) ? 'first-letter' : 'case-sensitive',
                                        ), $title ) . "\n";
                }
                $spaces .= "    </namespaces>";
index e1e1234..0b291ec 100644 (file)
@@ -3338,7 +3338,7 @@ function wfCheckEntropy() {
  */
 function wfFixSessionID() {
        // If the cookie or session id is already set we already have a session and should abort
-       if ( isset( $_COOKIE[ session_name() ] ) || session_id() ) {
+       if ( isset( $_COOKIE[session_name()] ) || session_id() ) {
                return;
        }
 
index 6863973..4a527bb 100644 (file)
@@ -256,7 +256,7 @@ class HTMLForm extends ContextSource {
         */
        public function setDisplayFormat( $format ) {
                if ( !in_array( $format, $this->availableDisplayFormats ) ) {
-                       throw new MWException ( 'Display format must be one of ' . print_r( $this->availableDisplayFormats, true ) );
+                       throw new MWException( 'Display format must be one of ' . print_r( $this->availableDisplayFormats, true ) );
                }
                $this->displayFormat = $format;
                return $this;
index 8cc7ace..e3ffb19 100644 (file)
@@ -190,7 +190,7 @@ class Hooks {
                                        }
                                } elseif ( is_string( $hook[0] ) ) {
                                        $func = $hook[0];
-                                       if ( count( $hook ) > 1) {
+                                       if ( count( $hook ) > 1 ) {
                                                $data = $hook[1];
                                                $have_data = true;
                                        }
index 9e280db..4730a97 100644 (file)
@@ -563,8 +563,8 @@ class MWHttpRequest {
                        $this->parseHeader();
                }
 
-               if ( isset( $this->respHeaders[strtolower ( $header ) ] ) ) {
-                       $v = $this->respHeaders[strtolower ( $header ) ];
+               if ( isset( $this->respHeaders[strtolower( $header )] ) ) {
+                       $v = $this->respHeaders[strtolower( $header )];
                        return $v[count( $v ) - 1];
                }
 
@@ -646,17 +646,17 @@ class MWHttpRequest {
                $headers = $this->getResponseHeaders();
 
                //return full url (fix for incorrect but handled relative location)
-               if ( isset( $headers[ 'location' ] ) ) {
-                       $locations = $headers[ 'location' ];
+               if ( isset( $headers['location'] ) ) {
+                       $locations = $headers['location'];
                        $domain = '';
                        $foundRelativeURI = false;
                        $countLocations = count( $locations );
 
                        for ( $i = $countLocations - 1; $i >= 0; $i-- ) {
-                               $url = parse_url( $locations[ $i ] );
+                               $url = parse_url( $locations[$i] );
 
                                if ( isset( $url['host'] ) ) {
-                                       $domain = $url[ 'scheme' ] . '://' . $url[ 'host' ];
+                                       $domain = $url['scheme'] . '://' . $url['host'];
                                        break; //found correct URI (with host)
                                } else {
                                        $foundRelativeURI = true;
@@ -665,15 +665,15 @@ class MWHttpRequest {
 
                        if ( $foundRelativeURI ) {
                                if ( $domain ) {
-                                       return $domain . $locations[ $countLocations - 1 ];
+                                       return $domain . $locations[$countLocations - 1];
                                } else {
                                        $url = parse_url( $this->url );
-                                       if ( isset($url[ 'host' ]) ) {
-                                               return $url[ 'scheme' ] . '://' . $url[ 'host' ] . $locations[ $countLocations - 1 ];
+                                       if ( isset( $url['host'] ) ) {
+                                               return $url['scheme'] . '://' . $url['host'] . $locations[$countLocations - 1];
                                        }
                                }
                        } else {
-                               return $locations[ $countLocations - 1 ];
+                               return $locations[$countLocations - 1];
                        }
                }
 
@@ -938,8 +938,7 @@ class PhpHttpRequest extends MWHttpRequest {
 
                // If everything went OK, or we received some error code
                // get the response body content.
-               if ( $this->status->isOK()
-                               || (int)$this->respStatus >= 300) {
+               if ( $this->status->isOK() || (int)$this->respStatus >= 300 ) {
                        while ( !feof( $fh ) ) {
                                $buf = fread( $fh, 8192 );
 
index b3a485a..aba9ab5 100644 (file)
@@ -719,7 +719,7 @@ EOT
                $limit = 100;
 
                $out = $this->getContext()->getOutput();
-               $res = $this->queryImageLinks( $this->getTitle()->getDbKey(), $limit + 1);
+               $res = $this->queryImageLinks( $this->getTitle()->getDbKey(), $limit + 1 );
                $rows = array();
                $redirects = array();
                foreach ( $res as $row ) {
index fee636f..f337043 100644 (file)
@@ -47,7 +47,7 @@ class WikiImporter {
 
                stream_wrapper_register( 'uploadsource', 'UploadSourceAdapter' );
                $id = UploadSourceAdapter::registerSource( $source );
-               if (defined( 'LIBXML_PARSEHUGE' ) ) {
+               if ( defined( 'LIBXML_PARSEHUGE' ) ) {
                        $this->reader->open( "uploadsource://$id", null, LIBXML_PARSEHUGE );
                } else {
                        $this->reader->open( "uploadsource://$id" );
index d99ae22..f79b423 100644 (file)
@@ -847,7 +847,7 @@ class LinksDeletionUpdate extends SqlDataUpdate {
                $res = $this->mDb->select( 'categorylinks', 'cl_to', array( 'cl_from' => $id ), __METHOD__ );
 
                foreach ( $res as $row ) {
-                       $cats [] = $row->cl_to;
+                       $cats[] = $row->cl_to;
                }
 
                $this->mPage->updateCategoryCounts( array(), $cats );
index 36fcc30..240a6d3 100644 (file)
@@ -32,7 +32,7 @@ class MWFunction {
                        if ( strpos( $callback, '::' ) !== false ) {
                                // PHP 5.1 cannot use call_user_func( 'Class::Method' )
                                // It can only handle only call_user_func( array( 'Class', 'Method' ) )
-                               $callback = explode( '::', $callback, 2);
+                               $callback = explode( '::', $callback, 2 );
                        }
                }
 
index edabd54..7592530 100644 (file)
@@ -432,7 +432,7 @@ class MimeMagic {
                $ext = explode( ' ', $ext );
 
                $extension = strtolower( $extension );
-               return  in_array( $extension, $ext );
+               return in_array( $extension, $ext );
        }
 
        /**
@@ -689,11 +689,11 @@ class MimeMagic {
                $script_type = null;
 
                # detect by shebang
-               if ( substr( $head, 0, 2) == "#!" ) {
+               if ( substr( $head, 0, 2 ) == "#!" ) {
                        $script_type = "ASCII";
-               } elseif ( substr( $head, 0, 5) == "\xef\xbb\xbf#!" ) {
+               } elseif ( substr( $head, 0, 5 ) == "\xef\xbb\xbf#!" ) {
                        $script_type = "UTF-8";
-               } elseif ( substr( $head, 0, 7) == "\xfe\xff\x00#\x00!" ) {
+               } elseif ( substr( $head, 0, 7 ) == "\xfe\xff\x00#\x00!" ) {
                        $script_type = "UTF-16BE";
                } elseif ( substr( $head, 0, 7 ) == "\xff\xfe#\x00!" ) {
                        $script_type = "UTF-16LE";
@@ -804,7 +804,7 @@ class MimeMagic {
                                 * These mime's are stored in the database, where we don't really want
                                 * x-opc+zip, because we use it only for internal purposes
                                 */
-                               if ( $this->isMatchingExtension( $ext, $mime) ) {
+                               if ( $this->isMatchingExtension( $ext, $mime ) ) {
                                        /* A known file extension for an OPC file,
                                         * find the proper mime type for that file extension
                                         */
@@ -817,10 +817,10 @@ class MimeMagic {
                } elseif ( substr( $header, 0, 8 ) == "\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1" &&
                                ($headerpos = strpos( $tail, "PK\x03\x04" ) ) !== false &&
                                preg_match( $openxmlRegex, substr( $tail, $headerpos + 30 ) ) ) {
-                       if ( substr( $header, 512, 4) == "\xEC\xA5\xC1\x00" ) {
+                       if ( substr( $header, 512, 4 ) == "\xEC\xA5\xC1\x00" ) {
                                $mime = "application/msword";
                        }
-                       switch( substr( $header, 512, 6) ) {
+                       switch( substr( $header, 512, 6 ) ) {
                                case "\xEC\xA5\xC1\x00\x0E\x00":
                                case "\xEC\xA5\xC1\x00\x1C\x00":
                                case "\xEC\xA5\xC1\x00\x43\x00":
index fccfbed..8001b41 100644 (file)
@@ -387,9 +387,9 @@ class MWNamespace {
                if ( in_array( $index, self::$alwaysCapitalizedNamespaces ) ) {
                        return true;
                }
-               if ( isset( $wgCapitalLinkOverrides[ $index ] ) ) {
+               if ( isset( $wgCapitalLinkOverrides[$index] ) ) {
                        // $wgCapitalLinkOverrides is explicitly set
-                       return $wgCapitalLinkOverrides[ $index ];
+                       return $wgCapitalLinkOverrides[$index];
                }
                // Default to the global setting
                return $wgCapitalLinks;
index 1e0c396..905b005 100644 (file)
@@ -1401,7 +1401,7 @@ class OutputPage extends ContextSource {
         * @param $timestamp Mixed: string, or null
         * @return Mixed: previous value
         */
-       public function setRevisionTimestamp( $timestamp) {
+       public function setRevisionTimestamp( $timestamp ) {
                return wfSetVar( $this->mRevisionTimestamp, $timestamp );
        }
 
index 2b34984..18cd94e 100644 (file)
@@ -1340,8 +1340,8 @@ class Revision implements IDBAccessObject {
                        $defaultModel = ContentHandler::getDefaultModelFor( $title );
                        $defaultFormat = ContentHandler::getForModelID( $defaultModel )->getDefaultFormat();
 
-                       $row[ 'rev_content_model' ] = ( $model === $defaultModel ) ? null : $model;
-                       $row[ 'rev_content_format' ] = ( $format === $defaultFormat ) ? null : $format;
+                       $row['rev_content_model'] = ( $model === $defaultModel ) ? null : $model;
+                       $row['rev_content_format'] = ( $format === $defaultFormat ) ? null : $format;
                }
 
                $dbw->insert( 'revision', $row, __METHOD__ );
@@ -1517,8 +1517,8 @@ class Revision implements IDBAccessObject {
                        );
 
                        if ( $wgContentHandlerUseDB ) {
-                               $row[ 'content_model' ] = $current->rev_content_model;
-                               $row[ 'content_format' ] = $current->rev_content_format;
+                               $row['content_model'] = $current->rev_content_model;
+                               $row['content_format'] = $current->rev_content_format;
                        }
 
                        $revision = new Revision( $row );
index d87c540..666df96 100644 (file)
@@ -352,8 +352,7 @@ class RevisionItem extends RevisionItemBase {
                if ( $this->isDeleted() && !$this->canViewContent() ) {
                        return $this->context->msg( 'diff' )->escaped();
                } else {
-                       return
-                               Linker::link(
+                       return Linker::link(
                                        $this->list->title,
                                        $this->context->msg( 'diff' )->escaped(),
                                        array(),
index 2dff081..3acb740 100644 (file)
@@ -507,7 +507,7 @@ class Sanitizer {
                                                !in_array( 'table', $tagstack ) ) {
                                                        $badtag = true;
                                                } elseif ( in_array( $t, $tagstack ) &&
-                                               !isset( $htmlnest [$t ] ) ) {
+                                               !isset( $htmlnest[$t] ) ) {
                                                        $badtag = true;
                                                # Is it a self closed htmlpair ? (bug 5487)
                                                } elseif ( $brace == '/>' &&
@@ -555,12 +555,14 @@ class Sanitizer {
                                                continue;
                                        }
                                }
-                               $text .= '&lt;' . str_replace( '>', '&gt;', $x);
+                               $text .= '&lt;' . str_replace( '>', '&gt;', $x );
                        }
                        # Close off any remaining tags
-                       while ( is_array( $tagstack ) && ($t = array_pop( $tagstack )) ) {
+                       while ( is_array( $tagstack ) && ( $t = array_pop( $tagstack ) ) ) {
                                $text .= "</$t>\n";
-                               if ( $t == 'table' ) { $tagstack = array_pop( $tablestack ); }
+                               if ( $t == 'table' ) {
+                                       $tagstack = array_pop( $tablestack );
+                               }
                        }
                } else {
                        # this might be possible using tidy itself
@@ -585,7 +587,7 @@ class Sanitizer {
                                                continue;
                                        }
                                }
-                               $text .= '&lt;' . str_replace( '>', '&gt;', $x);
+                               $text .= '&lt;' . str_replace( '>', '&gt;', $x );
                        }
                }
                wfProfileOut( __METHOD__ );
@@ -723,7 +725,7 @@ class Sanitizer {
                        }
 
                        # Allow any attribute beginning with "data-", if in HTML5 mode
-                       if ( !($wgHtml5 && preg_match( '/^data-/i', $attribute )) && !isset( $whitelist[$attribute] ) ) {
+                       if ( !( $wgHtml5 && preg_match( '/^data-/i', $attribute ) ) && !isset( $whitelist[$attribute] ) ) {
                                continue;
                        }
 
@@ -1357,9 +1359,9 @@ class Sanitizer {
                if( $matches[1] != '' ) {
                        return Sanitizer::decodeEntity( $matches[1] );
                } elseif( $matches[2] != '' ) {
-                       return  Sanitizer::decodeChar( intval( $matches[2] ) );
+                       return Sanitizer::decodeChar( intval( $matches[2] ) );
                } elseif( $matches[3] != '' ) {
-                       return  Sanitizer::decodeChar( hexdec( $matches[3] ) );
+                       return Sanitizer::decodeChar( hexdec( $matches[3] ) );
                }
                # Last case should be an ampersand by itself
                return $matches[0];
@@ -1443,30 +1445,31 @@ class Sanitizer {
                if ( $wgAllowRdfaAttributes ) {
                        #RDFa attributes as specified in section 9 of http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014
                        $common = array_merge( $common, array(
-                           'about', 'property', 'resource', 'datatype', 'typeof',
+                               'about', 'property', 'resource', 'datatype', 'typeof',
                        ) );
                }
 
                if ( $wgHtml5 && $wgAllowMicrodataAttributes ) {
                        # add HTML5 microdata tags as specified by http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#the-microdata-model
                        $common = array_merge( $common, array(
-                           'itemid', 'itemprop', 'itemref', 'itemscope', 'itemtype'
+                               'itemid', 'itemprop', 'itemref', 'itemscope', 'itemtype'
                        ) );
                }
 
                $block = array_merge( $common, array( 'align' ) );
                $tablealign = array( 'align', 'char', 'charoff', 'valign' );
-               $tablecell = array( 'abbr',
-                                   'axis',
-                                   'headers',
-                                   'scope',
-                                   'rowspan',
-                                   'colspan',
-                                   'nowrap', # deprecated
-                                   'width',  # deprecated
-                                   'height', # deprecated
-                                   'bgcolor' # deprecated
-                                   );
+               $tablecell = array(
+                       'abbr',
+                       'axis',
+                       'headers',
+                       'scope',
+                       'rowspan',
+                       'colspan',
+                       'nowrap', # deprecated
+                       'width', # deprecated
+                       'height', # deprecated
+                       'bgcolor', # deprecated
+               );
 
                # Numbers refer to sections in HTML 4.01 standard describing the element.
                # See: http://www.w3.org/TR/html4/
index 7715484..26c2df5 100644 (file)
@@ -67,7 +67,7 @@ if ( isset( $_GET['setupTestSuite'] ) ) {
        $testGlobalConfigs = array(); // an array containing all the global configs needed for this test
        $testResourceFiles = array(); // an array containing all the resource files needed for this test
        $callback = $wgSeleniumTestConfigs[$setupTestSuiteName];
-       call_user_func_array( $callback, array( &$testIncludes, &$testGlobalConfigs, &$testResourceFiles));
+       call_user_func_array( $callback, array( &$testIncludes, &$testGlobalConfigs, &$testResourceFiles ) );
 
        if ( isset( $testResourceFiles['images'] ) ) {
                $testImageZip = $testResourceFiles['images'];
@@ -112,7 +112,7 @@ if ( isset( $_COOKIE[$cookieName] ) ) {
        $testGlobalConfigs = array(); // an array containing all the global configs needed for this test
        $testResourceFiles = array(); // an array containing all the resource files needed for this test
        $callback = $wgSeleniumTestConfigs[$testSuiteName];
-       call_user_func_array( $callback, array( &$testIncludes, &$testGlobalConfigs, &$testResourceFiles));
+       call_user_func_array( $callback, array( &$testIncludes, &$testGlobalConfigs, &$testResourceFiles ) );
 
        if ( isset( $testResourceFiles['db'] ) ) {
                $testResourceName = getTestResourceNameFromTestSuiteName( $testSuiteName );
index e87b200..a602b79 100644 (file)
@@ -426,7 +426,7 @@ wfMemoryLimit();
  * that happens whenever you use a date function without the timezone being
  * explicitly set. Inspired by phpMyAdmin's treatment of the problem.
  */
-if ( is_null( $wgLocaltimezone) ) {
+if ( is_null( $wgLocaltimezone ) ) {
        wfSuppressWarnings();
        $wgLocaltimezone = date_default_timezone_get();
        wfRestoreWarnings();
index bbc14a1..2d250df 100644 (file)
@@ -228,7 +228,7 @@ class SiteConfiguration {
                                                        $retval = $thisSetting[$suffix];
                                                }
                                                break;
-                                       } elseif ( array_key_exists( "+$suffix", $thisSetting ) && is_array($thisSetting["+$suffix"]) ) {
+                                       } elseif ( array_key_exists( "+$suffix", $thisSetting ) && is_array( $thisSetting["+$suffix"] ) ) {
                                                if ( !isset( $retval ) ) {
                                                        $retval = array();
                                                }
index 0cc1086..a34afb6 100644 (file)
@@ -1252,7 +1252,7 @@ abstract class Skin extends ContextSource {
                                                }
 
                                                global $wgExternalLinkTarget;
-                                               if ( $wgExternalLinkTarget) {
+                                               if ( $wgExternalLinkTarget ) {
                                                        $extraAttribs['target'] = $wgExternalLinkTarget;
                                                }
                                        } else {
index 1cf99a7..7dbfabf 100644 (file)
@@ -141,7 +141,7 @@ class MWTimestamp {
 
                try {
                        $final = new DateTime( $strtime, new DateTimeZone( 'GMT' ) );
-               } catch(Exception $e) {
+               } catch( Exception $e ) {
                        throw new TimestampException( __METHOD__ . ' Invalid timestamp format.' );
                }
 
index 974ea91..80be529 100644 (file)
@@ -993,7 +993,7 @@ class Title {
         */
        public function getSkinFromCssJsSubpage() {
                $subpage = explode( '/', $this->mTextform );
-               $subpage = $subpage[ count( $subpage ) - 1 ];
+               $subpage = $subpage[count( $subpage ) - 1];
                $lastdot = strrpos( $subpage, '.' );
                if ( $lastdot === false )
                        return $subpage; # Never happens: only called for names ending in '.css' or '.js'
index 6b7348a..0e63704 100644 (file)
@@ -710,7 +710,7 @@ class User {
                                return 'passwordtooshort';
                        } elseif ( $wgContLang->lc( $password ) == $wgContLang->lc( $this->mName ) ) {
                                return 'password-name-match';
-                       } elseif ( isset( $blockedLogins[ $this->getName() ] ) && $password == $blockedLogins[ $this->getName() ] ) {
+                       } elseif ( isset( $blockedLogins[$this->getName()] ) && $password == $blockedLogins[$this->getName()] ) {
                                return 'password-login-forbidden';
                        } else {
                                //it seems weird returning true here, but this is because of the
@@ -1521,7 +1521,7 @@ class User {
                // Set the user limit key
                if ( $userLimit !== false ) {
                        wfDebug( __METHOD__ . ": effective user limit: $userLimit\n" );
-                       $keys[ wfMemcKey( 'limiter', $action, 'user', $id ) ] = $userLimit;
+                       $keys[wfMemcKey( 'limiter', $action, 'user', $id )] = $userLimit;
                }
 
                $triggered = false;
@@ -4018,7 +4018,7 @@ class User {
                }
 
                // Re-map numeric keys of AddToSelf/RemoveFromSelf to the 'user' key for backwards compatibility
-               if( empty( $wgGroupsAddToSelf['user']) || $wgGroupsAddToSelf['user'] !== true ) {
+               if( empty( $wgGroupsAddToSelf['user'] ) || $wgGroupsAddToSelf['user'] !== true ) {
                        foreach( $wgGroupsAddToSelf as $key => $value ) {
                                if( is_int( $key ) ) {
                                        $wgGroupsAddToSelf['user'][] = $value;
@@ -4026,7 +4026,7 @@ class User {
                        }
                }
 
-               if( empty( $wgGroupsRemoveFromSelf['user']) || $wgGroupsRemoveFromSelf['user'] !== true ) {
+               if( empty( $wgGroupsRemoveFromSelf['user'] ) || $wgGroupsRemoveFromSelf['user'] !== true ) {
                        foreach( $wgGroupsRemoveFromSelf as $key => $value ) {
                                if( is_int( $key ) ) {
                                        $wgGroupsRemoveFromSelf['user'][] = $value;
index 3b8f5c1..1f55ef3 100644 (file)
@@ -44,7 +44,7 @@ abstract class UserArray implements Iterator {
                $ids = array_map( 'intval', (array)$ids ); // paranoia
                if ( !$ids ) {
                        // Database::select() doesn't like empty arrays
-                       return new ArrayIterator(array());
+                       return new ArrayIterator( array() );
                }
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->select( 'user', '*', array( 'user_id' => $ids ),
index 98007ef..15da246 100644 (file)
@@ -224,7 +224,7 @@ class WebRequest {
                }
 
                $matches = self::getPathInfo( 'title' );
-               foreach( $matches as $key => $val) {
+               foreach( $matches as $key => $val ) {
                        $this->data[$key] = $_GET[$key] = $_REQUEST[$key] = $val;
                }
        }
@@ -603,7 +603,7 @@ class WebRequest {
         * @return Boolean
         */
        public function checkSessionCookie() {
-               return isset( $_COOKIE[ session_name() ] );
+               return isset( $_COOKIE[session_name()] );
        }
 
        /**
@@ -844,7 +844,7 @@ class WebRequest {
 
                if ( function_exists( 'apache_request_headers' ) ) {
                        foreach ( apache_request_headers() as $tempName => $tempValue ) {
-                               $this->headers[ strtoupper( $tempName ) ] = $tempValue;
+                               $this->headers[strtoupper( $tempName )] = $tempValue;
                        }
                } else {
                        foreach ( $_SERVER as $name => $value ) {
@@ -1103,7 +1103,7 @@ HTML;
                                $curIP = IP::canonicalize( $curIP );
                                if ( wfIsTrustedProxy( $curIP ) ) {
                                        if ( isset( $ipchain[$i + 1] ) ) {
-                                               if ( $wgUsePrivateIPs || IP::isPublic( $ipchain[$i + 1 ] ) ) {
+                                               if ( $wgUsePrivateIPs || IP::isPublic( $ipchain[$i + 1] ) ) {
                                                        $ip = $ipchain[$i + 1];
                                                }
                                        }
index b04a784..4697b12 100644 (file)
@@ -218,8 +218,7 @@ class WikiReference {
         * @return String: URL
         */
        public function getFullUrl( $page ) {
-               return
-                       $this->mServer .
+               return $this->mServer .
                        $this->getLocalUrl( $page );
        }
 }
index 8d9d740..f4d2e23 100644 (file)
@@ -1274,7 +1274,7 @@ class WikiPage implements Page, IDBAccessObject {
                );
 
                if ( $wgContentHandlerUseDB ) {
-                       $row[ 'page_content_model' ] = $revision->getContentModel();
+                       $row['page_content_model'] = $revision->getContentModel();
                }
 
                $dbw->update( 'page',
@@ -2591,8 +2591,8 @@ class WikiPage implements Page, IDBAccessObject {
                );
 
                if ( $wgContentHandlerUseDB ) {
-                       $row[ 'ar_content_model' ] = 'rev_content_model';
-                       $row[ 'ar_content_format' ] = 'rev_content_format';
+                       $row['ar_content_model'] = 'rev_content_model';
+                       $row['ar_content_format'] = 'rev_content_format';
                }
 
                $dbw->insertSelect( 'archive', array( 'page', 'revision' ),
index ee19dee..8697962 100644 (file)
@@ -493,17 +493,17 @@ class Xml {
 
                $options = self::option( $other, 'other', $selected === 'other' );
 
-               foreach ( explode( "\n", $list ) as $option) {
+               foreach ( explode( "\n", $list ) as $option ) {
                                $value = trim( $option );
                                if ( $value == '' ) {
                                        continue;
-                               } elseif ( substr( $value, 0, 1) == '*' && substr( $value, 1, 1) != '*' ) {
+                               } elseif ( substr( $value, 0, 1 ) == '*' && substr( $value, 1, 1 ) != '*' ) {
                                        // A new group is starting ...
                                        $value = trim( substr( $value, 1 ) );
                                        if( $optgroup ) $options .= self::closeElement( 'optgroup' );
                                        $options .= self::openElement( 'optgroup', array( 'label' => $value ) );
                                        $optgroup = true;
-                               } elseif ( substr( $value, 0, 2) == '**' ) {
+                               } elseif ( substr( $value, 0, 2 ) == '**' ) {
                                        // groupmember
                                        $value = trim( substr( $value, 2 ) );
                                        $options .= self::option( $value, $value, $selected === $value );
index d2d50ae..741e908 100644 (file)
@@ -1535,7 +1535,7 @@ abstract class ApiBase extends ContextSource {
        public function getWatchlistUser( $params ) {
                if ( !is_null( $params['owner'] ) && !is_null( $params['token'] ) ) {
                        $user = User::newFromName( $params['owner'], false );
-                       if ( !($user && $user->getId()) ) {
+                       if ( !( $user && $user->getId() ) ) {
                                $this->dieUsage( 'Specified user does not exist', 'bad_wlowner' );
                        }
                        $token = $user->getOption( 'watchlisttoken' );
index b2d7582..e261f38 100644 (file)
@@ -56,7 +56,7 @@ class ApiImageRotate extends ApiBase {
 
        public function execute() {
                $params = $this->extractRequestParams();
-               $rotation = $params[ 'rotation' ];
+               $rotation = $params['rotation'];
                $user = $this->getUser();
 
                $pageSet = $this->getPageSet();
@@ -111,12 +111,12 @@ class ApiImageRotate extends ApiBase {
                                continue;
                        }
                        $ext = strtolower( pathinfo( "$srcPath", PATHINFO_EXTENSION ) );
-                       $tmpFile = TempFSFile::factory( 'rotate_', $ext);
+                       $tmpFile = TempFSFile::factory( 'rotate_', $ext );
                        $dstPath = $tmpFile->getPath();
                        $err = $handler->rotate( $file, array(
                                "srcPath" => $srcPath,
                                "dstPath" => $dstPath,
-                               "rotation"=> $rotation
+                               "rotation" => $rotation
                        ) );
                        if ( !$err ) {
                                $comment = wfMessage( 'rotate-comment' )->numParams( $rotation )->text();
@@ -157,8 +157,8 @@ class ApiImageRotate extends ApiBase {
         */
        protected function checkPermissions( $user, $title ) {
                $permissionErrors = array_merge(
-                       $title->getUserPermissionsErrors( 'edit' , $user ),
-                       $title->getUserPermissionsErrors( 'upload' , $user )
+                       $title->getUserPermissionsErrors( 'edit', $user ),
+                       $title->getUserPermissionsErrors( 'upload', $user )
                );
 
                if ( $permissionErrors ) {
index 80bca2f..a6813e3 100644 (file)
@@ -83,7 +83,7 @@ class ApiMain extends ApiBase {
                'import' => 'ApiImport',
                'userrights' => 'ApiUserrights',
                'options' => 'ApiOptions',
-               'imagerotate' =>'ApiImageRotate',
+               'imagerotate' => 'ApiImageRotate',
        );
 
        /**
@@ -418,7 +418,7 @@ class ApiMain extends ApiBase {
                }
 
                // Log the request whether or not there was an error
-               $this->logRequest( microtime( true ) - $t);
+               $this->logRequest( microtime( true ) - $t );
 
                // Send cache headers after any code which might generate an error, to
                // avoid sending public cache headers for errors.
index 074efe4..c76e22b 100644 (file)
@@ -595,7 +595,7 @@ class ApiPageSet extends ApiBase {
                }
 
                foreach ( $this->mRequestedPageFields as $fieldName => &$fieldValues ) {
-                       $fieldValues[$pageId] = $row-> $fieldName;
+                       $fieldValues[$pageId] = $row->$fieldName;
                }
        }
 
index 496a0eb..952c2dc 100644 (file)
@@ -76,7 +76,7 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
                if ( $dir == 'newer' ) {
                        $this->addWhereRange( 'cat_pages', 'newer', $min, $max );
                } else {
-                       $this->addWhereRange( 'cat_pages', 'older', $max, $min);
+                       $this->addWhereRange( 'cat_pages', 'older', $max, $min );
                }
 
                if ( isset( $params['prefix'] ) ) {
index 3ef6b84..6899808 100644 (file)
@@ -294,9 +294,9 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                                        // We've reached the one extra which shows that there are additional pages to be had. Stop here...
                                        // We need to keep the parent page of this redir in
                                        if ( $this->hasNS ) {
-                                               $parentID = $this->pageMap[$row-> { $this->bl_ns } ][$row-> { $this->bl_title } ];
+                                               $parentID = $this->pageMap[$row->{$this->bl_ns}][$row->{$this->bl_title}];
                                        } else {
-                                               $parentID = $this->pageMap[NS_FILE][$row-> { $this->bl_title } ];
+                                               $parentID = $this->pageMap[NS_FILE][$row->{$this->bl_title}];
                                        }
                                        $this->continueStr = $this->getContinueRedirStr( $parentID, $row->page_id );
                                        break;
@@ -377,8 +377,8 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                if ( $row->page_is_redirect ) {
                        $a['redirect'] = '';
                }
-               $ns = $this->hasNS ? $row-> { $this->bl_ns } : NS_FILE;
-               $parentID = $this->pageMap[$ns][$row-> { $this->bl_title } ];
+               $ns = $this->hasNS ? $row->{$this->bl_ns} : NS_FILE;
+               $parentID = $this->pageMap[$ns][$row->{$this->bl_title}];
                // Put all the results in an array first
                $this->resultArr[$parentID]['redirlinks'][] = $a;
                $this->getResult()->setIndexedTagName( $this->resultArr[$parentID]['redirlinks'], $this->bl_code );
index d9be9f2..ba90452 100644 (file)
@@ -63,7 +63,7 @@ class ApiQueryBlocks extends ApiQueryBase {
                $this->addTables( 'ipblocks' );
                $this->addFields( 'ipb_auto' );
 
-               $this->addFieldsIf ( 'ipb_id', $fld_id );
+               $this->addFieldsIf( 'ipb_id', $fld_id );
                $this->addFieldsIf( array( 'ipb_address', 'ipb_user' ), $fld_user || $fld_userid );
                $this->addFieldsIf( 'ipb_by_text', $fld_by );
                $this->addFieldsIf( 'ipb_by', $fld_byid );
index 810e1d6..1488b2d 100644 (file)
@@ -675,7 +675,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                                ' variables             - Returns a list of variable IDs',
                                ' protocols             - Returns a list of protocols that are allowed in external links.',
                        ),
-                       'filteriw' =>  'Return only local or only nonlocal entries of the interwiki map',
+                       'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
                        'showalldb' => 'List all database servers, not just the one lagging the most',
                        'numberingroup' => 'Lists the number of users in user groups',
                        'inlanguagecode' => 'Language code for localised language names (best effort, use CLDR extension)',
index 39bf4c9..69f0bf7 100644 (file)
@@ -219,7 +219,7 @@ class SquidUpdate {
                                // implementation exists, so adapt to Squid
                                $htcpPacket = pack( 'nxxnCxNxxa*n',
                                        $htcpLen, $htcpDataLen, $htcpOpCLR,
-                                       $htcpTransID, $htcpSpecifier, 2);
+                                       $htcpTransID, $htcpSpecifier, 2 );
 
                                // Send out
                                wfDebug( "Purging URL $url via HTCP\n" );
index 9c20195..9c5ebcd 100644 (file)
@@ -1086,8 +1086,8 @@ abstract class ContentHandler {
                                $contentObjects[$k] = $v;
 
                                $v = $v->serialize();
-                               $contentTexts[ $k ] = $v;
-                               $args[ $k ] = $v;
+                               $contentTexts[$k] = $v;
+                               $args[$k] = $v;
                        }
                }
 
@@ -1098,7 +1098,7 @@ abstract class ContentHandler {
                foreach ( $contentTexts as $k => $orig ) {
                        /* @var Content $content */
 
-                       $modified = $args[ $k ];
+                       $modified = $args[$k];
                        $content = $contentObjects[$k];
 
                        if ( $modified !== $orig ) {
@@ -1106,7 +1106,7 @@ abstract class ContentHandler {
                                $content = $content->getContentHandler()->unserializeContent( $modified );
                        }
 
-                       $args[ $k ] = $content;
+                       $args[$k] = $content;
                }
 
                return $ok;
index 5ad196d..d0b877f 100644 (file)
@@ -1582,19 +1582,19 @@ abstract class DatabaseBase implements DatabaseType {
        static function generalizeSQL( $sql ) {
                # This does the same as the regexp below would do, but in such a way
                # as to avoid crashing php on some large strings.
-               # $sql = preg_replace ( "/'([^\\\\']|\\\\.)*'|\"([^\\\\\"]|\\\\.)*\"/", "'X'", $sql);
+               # $sql = preg_replace( "/'([^\\\\']|\\\\.)*'|\"([^\\\\\"]|\\\\.)*\"/", "'X'", $sql );
 
-               $sql = str_replace ( "\\\\", '', $sql );
-               $sql = str_replace ( "\\'", '', $sql );
-               $sql = str_replace ( "\\\"", '', $sql );
-               $sql = preg_replace ( "/'.*'/s", "'X'", $sql );
-               $sql = preg_replace ( '/".*"/s', "'X'", $sql );
+               $sql = str_replace( "\\\\", '', $sql );
+               $sql = str_replace( "\\'", '', $sql );
+               $sql = str_replace( "\\\"", '', $sql );
+               $sql = preg_replace( "/'.*'/s", "'X'", $sql );
+               $sql = preg_replace( '/".*"/s', "'X'", $sql );
 
                # All newlines, tabs, etc replaced by single space
-               $sql = preg_replace ( '/\s+/', ' ', $sql );
+               $sql = preg_replace( '/\s+/', ' ', $sql );
 
                # All numbers => N
-               $sql = preg_replace ( '/-?[0-9]+/s', 'N', $sql );
+               $sql = preg_replace( '/-?[0-9]+/s', 'N', $sql );
 
                return $sql;
        }
index 575f629..dde3af5 100644 (file)
@@ -148,7 +148,7 @@ class DatabaseMssql extends DatabaseBase {
                }
 
                // MSSQL doesn't have EXTRACT(epoch FROM XXX)
-               if ( preg_match('#\bEXTRACT\s*?\(\s*?EPOCH\s+FROM\b#i', $sql, $matches ) ) {
+               if ( preg_match( '#\bEXTRACT\s*?\(\s*?EPOCH\s+FROM\b#i', $sql, $matches ) ) {
                        // This is same as UNIX_TIMESTAMP, we need to calc # of seconds from 1970
                        $sql = str_replace( $matches[0], "DATEDIFF(s,CONVERT(datetime,'1/1/1970'),", $sql );
                }
@@ -202,9 +202,9 @@ class DatabaseMssql extends DatabaseBase {
                $retErrors = sqlsrv_errors( SQLSRV_ERR_ALL );
                if ( $retErrors != null ) {
                        foreach ( $retErrors as $arrError ) {
-                               $strRet .= "SQLState: " . $arrError[ 'SQLSTATE'] . "\n";
-                               $strRet .= "Error Code: " . $arrError[ 'code'] . "\n";
-                               $strRet .= "Message: " . $arrError[ 'message'] . "\n";
+                               $strRet .= "SQLState: " . $arrError['SQLSTATE'] . "\n";
+                               $strRet .= "Error Code: " . $arrError['code'] . "\n";
+                               $strRet .= "Message: " . $arrError['message'] . "\n";
                        }
                } else {
                        $strRet = "No errors found";
@@ -429,9 +429,9 @@ class DatabaseMssql extends DatabaseBase {
                        // if we have an identity column
                        if( $identity ) {
                                // iterate through
-                               foreach ($a as $k => $v ) {
+                               foreach ( $a as $k => $v ) {
                                        if ( $k == $identity ) {
-                                               if( !is_null($v) ) {
+                                               if( !is_null( $v ) ) {
                                                        // there is a value being passed to us, we need to turn on and off inserted identity
                                                        $sqlPre = "SET IDENTITY_INSERT $table ON;";
                                                        $sqlPost = ";SET IDENTITY_INSERT $table OFF;";
@@ -501,7 +501,7 @@ class DatabaseMssql extends DatabaseBase {
                        } elseif ( $ret != null ) {
                                // remember number of rows affected
                                $this->mAffectedRows = sqlsrv_rows_affected( $ret );
-                               if ( !is_null($identity) ) {
+                               if ( !is_null( $identity ) ) {
                                        // then we want to get the identity column value we were assigned and save it off
                                        $row = sqlsrv_fetch_object( $ret );
                                        $this->mInsertId = $row->$identity;
index 7db032f..e59ca95 100644 (file)
@@ -206,7 +206,7 @@ class DatabaseOracle extends DatabaseBase {
        }
 
        function __destruct() {
-               if ($this->mOpened) {
+               if ( $this->mOpened ) {
                        wfSuppressWarnings();
                        $this->close();
                        wfRestoreWarnings();
@@ -791,7 +791,7 @@ class DatabaseOracle extends DatabaseBase {
                $endArray[] = strtoupper( $prefix . 'PAGE' );
                $endArray[] = strtoupper( $prefix . 'IMAGE' );
                $fixedOrderTabs = $endArray;
-               while ( ($row = $result->fetchRow()) !== false ) {
+               while ( ( $row = $result->fetchRow() ) !== false ) {
                        if ( !in_array( $row['table_name'], $fixedOrderTabs ) )
                                $endArray[] = $row['table_name'];
                }
@@ -1125,12 +1125,12 @@ class DatabaseOracle extends DatabaseBase {
                $conds2 = array();
                foreach ( $conds as $col => $val ) {
                        if ( is_array( $val ) ) {
-                               $conds2[$col] = $this->wrapConditionsForWhere ( $table, $val, $col );
+                               $conds2[$col] = $this->wrapConditionsForWhere( $table, $val, $col );
                        } else {
                                if ( is_numeric( $col ) && $parentCol != null ) {
-                                       $this->wrapFieldForWhere ( $table, $parentCol, $val );
+                                       $this->wrapFieldForWhere( $table, $parentCol, $val );
                                } else {
-                                       $this->wrapFieldForWhere ( $table, $col, $val );
+                                       $this->wrapFieldForWhere( $table, $col, $val );
                                }
                                $conds2[$col] = $val;
                        }
index d469e86..85e7775 100644 (file)
@@ -201,7 +201,7 @@ class LBFactory_Simple extends LBFactory {
                                $flags |= DBO_COMPRESS;
                        }
 
-                       $servers = array(array(
+                       $servers = array( array(
                                'host' => $wgDBserver,
                                'user' => $wgDBuser,
                                'password' => $wgDBpassword,
index 1a26d0c..f9cb656 100644 (file)
@@ -508,7 +508,7 @@ class _DiffEngine {
                        reset( $seps );
                        $pt1 = $seps[0];
                        while ( $pt2 = next( $seps ) ) {
-                               $this->_compareseq ( $pt1[0], $pt2[0], $pt1[1], $pt2[1] );
+                               $this->_compareseq( $pt1[0], $pt2[0], $pt1[1], $pt2[1] );
                                $pt1 = $pt2;
                        }
                }
index 939315d..17b060c 100644 (file)
@@ -457,7 +457,7 @@ class FileBackendMultiWrite extends FileBackend {
         * @return bool Path container should have dir changes pushed to all backends
         */
        protected function replicateContainerDirChanges( $path ) {
-               list( , $shortCont,  ) = self::splitStoragePath( $path );
+               list( , $shortCont, ) = self::splitStoragePath( $path );
                return !in_array( $shortCont, $this->noPushDirConts );
        }
 
index cecd0ae..5eff954 100644 (file)
@@ -518,7 +518,7 @@ abstract class File {
         * @param $version integer version number.
         * @return Array containing metadata, or what was passed to it on fail (unserializing if not array)
         */
-       public function convertMetadataVersion($metadata, $version) {
+       public function convertMetadataVersion( $metadata, $version ) {
                $handler = $this->getHandler();
                if ( !is_array( $metadata ) ) {
                        // Just to make the return type consistent
@@ -681,7 +681,7 @@ abstract class File {
                if ( $mime === "unknown/unknown" ) {
                        return false; #unknown type, not trusted
                }
-               if ( in_array( $mime, $wgTrustedMediaFormats) ) {
+               if ( in_array( $mime, $wgTrustedMediaFormats ) ) {
                        return true;
                }
 
index a96c1f3..4cc6308 100644 (file)
@@ -67,7 +67,7 @@ class ForeignAPIFile extends File {
                                ? count( $data['query']['redirects'] ) - 1
                                : -1;
                        if( $lastRedirect >= 0 ) {
-                               $newtitle = Title::newFromText( $data['query']['redirects'][$lastRedirect]['to']);
+                               $newtitle = Title::newFromText( $data['query']['redirects'][$lastRedirect]['to'] );
                                $img = new self( $newtitle, $repo, $info, true );
                                if( $img ) {
                                        $img->redirectedFrom( $title->getDBkey() );
@@ -166,7 +166,7 @@ class ForeignAPIFile extends File {
                }
                $ret = array();
                foreach( $metadata as $meta ) {
-                       $ret[ $meta['name'] ] = self::parseMetadata( $meta['value'] );
+                       $ret[$meta['name']] = self::parseMetadata( $meta['value'] );
                }
                return $ret;
        }
index 8231e7f..cd14e4e 100644 (file)
@@ -510,8 +510,7 @@ abstract class DatabaseInstaller {
         * @return String
         */
        public function getInstallUserBox() {
-               return
-                       Html::openElement( 'fieldset' ) .
+               return Html::openElement( 'fieldset' ) .
                        Html::element( 'legend', array(), wfMessage( 'config-db-install-account' )->text() ) .
                        $this->getTextBox( '_InstallUser', 'config-db-username', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-install-username' ) ) .
                        $this->getPasswordBox( '_InstallPassword', 'config-db-password', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-install-password' ) ) .
index b88ae61..94164eb 100644 (file)
@@ -302,7 +302,7 @@ abstract class DatabaseUpdater {
         * @param string $fieldName The field to be modified
         * @param string $sqlPath The path to the SQL change path
         */
-       public function modifyExtensionField( $tableName, $fieldName, $sqlPath) {
+       public function modifyExtensionField( $tableName, $fieldName, $sqlPath ) {
                $this->extensionUpdates[] = array( 'modifyField', $tableName, $fieldName, $sqlPath, true );
        }
 
index 8aee15c..daac558 100644 (file)
@@ -997,7 +997,7 @@ abstract class Installer {
                }
 
                # Try the current value of LANG.
-               if ( isset( $candidatesByLocale[ getenv( 'LANG' ) ] ) ) {
+               if ( isset( $candidatesByLocale[getenv( 'LANG' )] ) ) {
                        $this->setVar( 'wgShellLocale', getenv( 'LANG' ) );
                        return true;
                }
@@ -1408,10 +1408,10 @@ abstract class Installer {
                // then adding any callbacks that wanted to attach after a given step
                foreach( $coreInstallSteps as $step ) {
                        $this->installSteps[] = $step;
-                       if( isset( $this->extraInstallSteps[ $step['name'] ] ) ) {
+                       if( isset( $this->extraInstallSteps[$step['name']] ) ) {
                                $this->installSteps = array_merge(
                                        $this->installSteps,
-                                       $this->extraInstallSteps[ $step['name'] ]
+                                       $this->extraInstallSteps[$step['name']]
                                );
                        }
                }
@@ -1598,7 +1598,7 @@ abstract class Installer {
                $status = Status::newGood();
                try {
                        $page = WikiPage::factory( Title::newMainPage() );
-                       $content = new WikitextContent (
+                       $content = new WikitextContent(
                                wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
                                wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text()
                        );
@@ -1608,7 +1608,7 @@ abstract class Installer {
                                        EDIT_NEW,
                                        false,
                                        User::newFromName( 'MediaWiki default' ) );
-               } catch (MWException $e) {
+               } catch ( MWException $e ) {
                        //using raw, because $wgShowExceptionDetails can not be set yet
                        $status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
                }
index 7cb3779..aa7fc97 100644 (file)
@@ -227,7 +227,7 @@ class LocalSettingsGenerator {
                        case 'db':
                        case 'memcached':
                        case 'accel':
-                               $cacheType = 'CACHE_' . strtoupper( $this->values['wgMainCacheType']);
+                               $cacheType = 'CACHE_' . strtoupper( $this->values['wgMainCacheType'] );
                                break;
                        case 'none':
                        default:
index 06821f8..72514f2 100644 (file)
@@ -86,8 +86,7 @@ class MysqlInstaller extends DatabaseInstaller {
         * @return string
         */
        public function getConnectForm() {
-               return
-                       $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
+               return $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
                        Html::openElement( 'fieldset' ) .
                        Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
                        $this->getTextBox( 'wgDBname', 'config-db-name', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-name-help' ) ) .
index e853889..632015f 100644 (file)
@@ -59,8 +59,7 @@ class OracleInstaller extends DatabaseInstaller {
                if ( $this->getVar( 'wgDBserver' ) == 'localhost' ) {
                        $this->parent->setVar( 'wgDBserver', '' );
                }
-               return
-                       $this->getTextBox( 'wgDBserver', 'config-db-host-oracle', array(), $this->parent->getHelpBox( 'config-db-host-oracle-help' ) ) .
+               return $this->getTextBox( 'wgDBserver', 'config-db-host-oracle', array(), $this->parent->getHelpBox( 'config-db-host-oracle-help' ) ) .
                        Html::openElement( 'fieldset' ) .
                        Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
                        $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) .
index 4e5ae8c..e7ae8d5 100644 (file)
@@ -56,8 +56,7 @@ class PostgresInstaller extends DatabaseInstaller {
        }
 
        function getConnectForm() {
-               return
-                       $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
+               return $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
                        $this->getTextBox( 'wgDBport', 'config-db-port' ) .
                        Html::openElement( 'fieldset' ) .
                        Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
@@ -137,7 +136,8 @@ class PostgresInstaller extends DatabaseInstaller {
                                $this->getVar( 'wgDBserver' ),
                                $user,
                                $password,
-                               $dbName);
+                               $dbName
+                       );
                        $status->value = $db;
                } catch ( DBConnectionError $e ) {
                        $status->fatal( 'config-connection-error', $e->getMessage() );
index 0a4b5e6..17285c5 100644 (file)
@@ -613,7 +613,7 @@ END;
                }
        }
 
-       protected function changeNullableField( $table, $field, $null) {
+       protected function changeNullableField( $table, $field, $null ) {
                $fi = $this->db->fieldInfo( $table, $field );
                if ( is_null( $fi ) ) {
                        $this->output( "...ERROR: expected column $table.$field to exist\n" );
index 35d649b..ac66cd9 100644 (file)
@@ -353,7 +353,7 @@ class WebInstaller extends Installer {
        public function getFingerprint() {
                // Get the base URL of the installation
                $url = $this->request->getFullRequestURL();
-               if ( preg_match( '!^(.*\?)!', $url, $m) ) {
+               if ( preg_match( '!^(.*\?)!', $url, $m ) ) {
                        // Trim query string
                        $url = $m[1];
                }
@@ -724,8 +724,7 @@ class WebInstaller extends Installer {
                        $attributes['for'] = $forId;
                }
 
-               return
-                       "<div class=\"config-block\">\n" .
+               return "<div class=\"config-block\">\n" .
                        "  <div class=\"config-block-label\">\n" .
                        Xml::tags( 'label',
                                $attributes,
@@ -767,8 +766,7 @@ class WebInstaller extends Installer {
                if ( !isset( $params['help'] ) ) {
                        $params['help'] = "";
                }
-               return
-                       $this->label(
+               return $this->label(
                                $params['label'],
                                $params['controlName'],
                                Xml::input(
@@ -814,8 +812,7 @@ class WebInstaller extends Installer {
                if ( !isset( $params['help'] ) ) {
                        $params['help'] = "";
                }
-               return
-                       $this->label(
+               return $this->label(
                                $params['label'],
                                $params['controlName'],
                                Xml::textarea(
@@ -898,8 +895,7 @@ class WebInstaller extends Installer {
                        $labelText = $this->parse( wfMessage( $params['label'] )->text() );
                }
 
-               return
-                       "<div class=\"config-input-check\">\n" .
+               return "<div class=\"config-input-check\">\n" .
                        $params['help'] .
                        "<label>\n" .
                        Xml::check(
index 9119c12..305c012 100644 (file)
@@ -1051,8 +1051,7 @@ class WebInstaller_Options extends WebInstallerPage {
                }
                $wrapperStyle = ($this->getVar( '_LicenseCode' ) == 'cc-choose') ? '' : 'display: none';
 
-               return
-                       "<div class=\"config-cc-wrapper\" id=\"config-cc-wrapper\" style=\"$wrapperStyle\">\n" .
+               return "<div class=\"config-cc-wrapper\" id=\"config-cc-wrapper\" style=\"$wrapperStyle\">\n" .
                        Html::element( 'iframe', $iframeAttribs, '', false /* not short */ ) .
                        "</div>\n";
        }
@@ -1062,8 +1061,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' ) ) .
@@ -1242,7 +1240,7 @@ class WebInstaller_Complete extends WebInstallerPage {
                        // JS appears the only method that works consistently with IE7+
                        $this->addHtml( "\n<script type=\"" . $GLOBALS['wgJsMimeType'] .
                                '">jQuery( document ).ready( function() { document.location=' .
-                               Xml::encodeJsVar( $lsUrl) . "; } );</script>\n" );
+                               Xml::encodeJsVar( $lsUrl ) . "; } );</script>\n" );
                } else {
                        $this->parent->request->response()->header( "Refresh: 0;url=$lsUrl" );
                }
index 46d1b95..e1bacf3 100644 (file)
@@ -65,8 +65,8 @@ class BmpHandler extends BitmapHandler {
                fclose( $f );
 
                // Extract binary form of width and height from the header
-               $w = substr( $header, 18, 4);
-               $h = substr( $header, 22, 4);
+               $w = substr( $header, 18, 4 );
+               $h = substr( $header, 22, 4 );
 
                // Convert the unsigned long 32 bits (little endian):
                try {
index e2dc68b..1d8337d 100644 (file)
@@ -765,16 +765,16 @@ class BitmapHandler extends ImageHandler {
        public function rotate( $file, $params ) {
                global $wgImageMagickConvertCommand;
 
-               $rotation = ( $params[ 'rotation' ] + $this->getRotation( $file ) ) % 360;
+               $rotation = ( $params['rotation'] + $this->getRotation( $file ) ) % 360;
                $scene = false;
 
                $scaler = self::getScalerType( null, false );
                switch ( $scaler ) {
                        case 'im':
                                $cmd = wfEscapeShellArg( $wgImageMagickConvertCommand ) . " " .
-                                       wfEscapeShellArg( $this->escapeMagickInput( $params[ 'srcPath' ], $scene ) ) .
+                                       wfEscapeShellArg( $this->escapeMagickInput( $params['srcPath'], $scene ) ) .
                                        " -rotate -$rotation " .
-                                       wfEscapeShellArg( $this->escapeMagickOutput( $params[ 'dstPath' ] ) ) . " 2>&1";
+                                       wfEscapeShellArg( $this->escapeMagickOutput( $params['dstPath'] ) ) . " 2>&1";
                                wfDebug( __METHOD__ . ": running ImageMagick: $cmd\n" );
                                wfProfileIn( 'convert' );
                                $retval = 0;
index 4698966..0831e68 100644 (file)
@@ -263,7 +263,7 @@ class DjVuImage {
                        $retval = '';
                        $txt = wfShellExec( $cmd, $retval, array(), array( 'memory' => self::DJVUTXT_MEMORY_LIMIT ) );
                        wfProfileOut( 'djvutxt' );
-                       if( $retval == 0) {
+                       if( $retval == 0 ) {
                                # Strip some control characters
                                $txt = preg_replace( "/[\013\035\037]/", "", $txt );
                                $reg = <<<EOR
index 1671ab2..98c423f 100644 (file)
@@ -51,11 +51,11 @@ class ExifBitmapHandler extends BitmapHandler {
 
                // Treat Software as a special case because in can contain
                // an array of (SoftwareName, Version).
-               if (isset( $metadata['Software'] )
+               if ( isset( $metadata['Software'] )
                        && is_array( $metadata['Software'] )
-                       && is_array( $metadata['Software'][0])
+                       && is_array( $metadata['Software'][0] )
                        && isset( $metadata['Software'][0][0] )
-                       && isset( $metadata['Software'][0][1])
+                       && isset( $metadata['Software'][0][1] )
                ) {
                        $metadata['Software'] = $metadata['Software'][0][0] . ' (Version '
                                . $metadata['Software'][0][1] . ')';
index 1a7d772..5bcb484 100644 (file)
@@ -79,7 +79,7 @@ class FormatMetadata {
                        }
 
                        //This is done differently as the tag is an array.
-                       if ( $tag == 'GPSTimeStamp' && count( $vals ) === 3) {
+                       if ( $tag == 'GPSTimeStamp' && count( $vals ) === 3 ) {
                                //hour min sec array
 
                                $h = explode( '/', $vals[0] );
@@ -682,7 +682,7 @@ class FormatMetadata {
                                                $urgency = 'high';
                                        } elseif ( $val == 5 ) {
                                                $urgency = 'normal';
-                                       } elseif ( $val <= 8 && $val > 5) {
+                                       } elseif ( $val <= 8 && $val > 5 ) {
                                                $urgency = 'low';
                                        }
 
index 419afee..ad9919b 100644 (file)
@@ -160,7 +160,7 @@ abstract class ImageHandler extends MediaHandler {
                $width = intval( $width );
 
                # Sanity check $width
-               if( $width <= 0) {
+               if( $width <= 0 ) {
                        wfDebug( __METHOD__ . ": Invalid destination width: $width\n" );
                        return false;
                }
index 3551943..cb0fbb3 100644 (file)
@@ -69,18 +69,18 @@ class JpegHandler extends ExifBitmapHandler {
        public function rotate( $file, $params ) {
                global $wgJpegTran;
 
-               $rotation = ( $params[ 'rotation' ] + $this->getRotation( $file ) ) % 360;
+               $rotation = ( $params['rotation'] + $this->getRotation( $file ) ) % 360;
 
-               if( $wgJpegTran && is_file( $wgJpegTran ) ){
+               if( $wgJpegTran && is_file( $wgJpegTran ) ) {
                        $cmd = wfEscapeShellArg( $wgJpegTran ) .
                                " -rotate " . wfEscapeShellArg( $rotation ) .
-                               " -outfile " . wfEscapeShellArg( $params[ 'dstPath' ] ) .
-                               " " . wfEscapeShellArg( $params[ 'srcPath' ] ) .  " 2>&1";
-                               wfDebug( __METHOD__ . ": running jpgtran: $cmd\n" );
-                               wfProfileIn( 'jpegtran' );
-                               $retval = 0;
-                               $err = wfShellExec( $cmd, $retval, $env );
-                               wfProfileOut( 'jpegtran' );
+                               " -outfile " . wfEscapeShellArg( $params['dstPath'] ) .
+                               " " . wfEscapeShellArg( $params['srcPath'] ) . " 2>&1";
+                       wfDebug( __METHOD__ . ": running jpgtran: $cmd\n" );
+                       wfProfileIn( 'jpegtran' );
+                       $retval = 0;
+                       $err = wfShellExec( $cmd, $retval, $env );
+                       wfProfileOut( 'jpegtran' );
                        if ( $retval !== 0 ) {
                                $this->logErrorForExternalProcess( $retval, $err, $cmd );
                                return new MediaTransformError( 'thumbnail_error', 0, 0, $err );
index b36bfa9..b67f3d3 100644 (file)
@@ -136,7 +136,7 @@ abstract class MediaHandler {
        static function getMetadataVersion() {
                $version = Array( '2' ); // core metadata version
                wfRunHooks( 'GetMetadataVersion', Array( &$version ) );
-               return implode( ';', $version);
+               return implode( ';', $version );
        }
 
        /**
index 87f705c..e65a558 100644 (file)
@@ -214,9 +214,9 @@ class PNGMetadataExtractor {
                                                        continue;
                                                }
                                        }
-                                       $finalKeyword = self::$text_chunks[ $items[1] ];
-                                       $text[ $finalKeyword ][ $items[3] ] = $items[5];
-                                       $text[ $finalKeyword ]['_type'] = 'lang';
+                                       $finalKeyword = self::$text_chunks[$items[1]];
+                                       $text[$finalKeyword][$items[3]] = $items[5];
+                                       $text[$finalKeyword]['_type'] = 'lang';
 
                                } else {
                                        // Error reading iTXt chunk
@@ -251,9 +251,9 @@ class PNGMetadataExtractor {
                                        throw new Exception( __METHOD__ . ": Read error (error with iconv)" );
                                }
 
-                               $finalKeyword = self::$text_chunks[ $keyword ];
-                               $text[ $finalKeyword ][ 'x-default' ] = $content;
-                               $text[ $finalKeyword ]['_type'] = 'lang';
+                               $finalKeyword = self::$text_chunks[$keyword];
+                               $text[$finalKeyword]['x-default'] = $content;
+                               $text[$finalKeyword]['_type'] = 'lang';
 
                        } elseif ( $chunk_type == 'zTXt' ) {
                                if ( function_exists( 'gzuncompress' ) ) {
@@ -303,9 +303,9 @@ class PNGMetadataExtractor {
                                                throw new Exception( __METHOD__ . ": Read error (error with iconv)" );
                                        }
 
-                                       $finalKeyword = self::$text_chunks[ $keyword ];
-                                       $text[ $finalKeyword ][ 'x-default' ] = $content;
-                                       $text[ $finalKeyword ]['_type'] = 'lang';
+                                       $finalKeyword = self::$text_chunks[$keyword];
+                                       $text[$finalKeyword]['x-default'] = $content;
+                                       $text[$finalKeyword]['_type'] = 'lang';
 
                                } else {
                                        wfDebug( __METHOD__ . " Cannot decompress zTXt chunk due to lack of zlib. Skipping." );
index e07fd86..f21d6b0 100644 (file)
@@ -179,7 +179,7 @@ class SVGReader {
         * @param string $metafield that we will fill with the result
         */
        private function readField( $name, $metafield=null ) {
-               $this->debug ( "Read field $metafield" );
+               $this->debug( "Read field $metafield" );
                if( !$metafield || $this->reader->nodeType != XmlReader::ELEMENT ) {
                        return;
                }
@@ -201,7 +201,7 @@ class SVGReader {
         * @throws MWException
         */
        private function readXml( $metafield=null ) {
-               $this->debug ( "Read top level metadata" );
+               $this->debug( "Read top level metadata" );
                if( !$metafield || $this->reader->nodeType != XmlReader::ELEMENT ) {
                        return;
                }
@@ -220,7 +220,7 @@ class SVGReader {
         * @param string $name of the element that we are reading from
         */
        private function animateFilter( $name ) {
-               $this->debug ( "animate filter for tag $name" );
+               $this->debug( "animate filter for tag $name" );
                if( $this->reader->nodeType != XmlReader::ELEMENT ) {
                        return;
                }
index d9cca3f..081433b 100644 (file)
@@ -993,15 +993,15 @@ class XMPReader {
                if ( $elm !== self::NS_RDF . ' li' ) {
                        throw new MWException( __METHOD__ . " <rdf:li> expected but got $elm." );
                }
-               if ( !isset( $attribs[ self::NS_XML . ' lang'] )
-                       || !preg_match( '/^[-A-Za-z0-9]{2,}$/D', $attribs[ self::NS_XML . ' lang' ] ) )
+               if ( !isset( $attribs[self::NS_XML . ' lang'] )
+                       || !preg_match( '/^[-A-Za-z0-9]{2,}$/D', $attribs[self::NS_XML . ' lang'] ) )
                {
                        throw new MWException( __METHOD__
                                . " <rdf:li> did not contain, or has invalid xml:lang attribute in lang alternative" );
                }
 
                // Lang is case-insensitive.
-               $this->itemLang = strtolower( $attribs[ self::NS_XML . ' lang' ] );
+               $this->itemLang = strtolower( $attribs[self::NS_XML . ' lang'] );
 
                // need to add curItem[0] on again since one is for the specific item
                // and one is for the entire group.
index b7b35dc..f727400 100644 (file)
@@ -214,7 +214,7 @@ class XMPValidate {
                        // this only validates standalone properties, not arrays, etc
                        return;
                }
-               if ( !preg_match( '/^[-A-Za-z0-9]{2,}$/D', $val) ) {
+               if ( !preg_match( '/^[-A-Za-z0-9]{2,}$/D', $val ) ) {
                        //this is a rather naive check.
                        wfDebugLog( 'XMP', __METHOD__ . " Expected Lang code but got $val" );
                        $val = null;
index 0d96ed6..bc2acb3 100644 (file)
@@ -55,9 +55,9 @@
  *              'compress_threshold' => 10240,
  *              'persistent' => true));
  *
- * $mc->add('key', array('some', 'array'));
- * $mc->replace('key', 'some random string');
- * $val = $mc->get('key');
+ * $mc->add( 'key', array( 'some', 'array' ) );
+ * $mc->replace( 'key', 'some random string' );
+ * $val = $mc->get( 'key' );
  *
  * @author  Ryan T. Dean <rtdean@cytherianage.net>
  * @version 0.1.2
@@ -489,17 +489,17 @@ class MWMemcached {
                        }
                        $key = is_array( $key ) ? $key[1] : $key;
                        if ( !isset( $sock_keys[$sock] ) ) {
-                               $sock_keys[ intval( $sock ) ] = array();
+                               $sock_keys[intval( $sock )] = array();
                                $socks[] = $sock;
                        }
-                       $sock_keys[ intval( $sock ) ][] = $key;
+                       $sock_keys[intval( $sock )][] = $key;
                }
 
                $gather = array();
                // Send out the requests
                foreach ( $socks as $sock ) {
                        $cmd = 'gets';
-                       foreach ( $sock_keys[ intval( $sock ) ] as $key ) {
+                       foreach ( $sock_keys[intval( $sock )] as $key ) {
                                $cmd .= ' ' . $key;
                        }
                        $cmd .= "\r\n";
index a2da307..08b1f3e 100644 (file)
@@ -337,7 +337,7 @@ class DateFormatter {
        function makeIsoYear( $year ) {
                # Assumes the year is in a nice format, as enforced by the regex
                if ( substr( $year, -2 ) == 'BC' ) {
-                       $num = intval(substr( $year, 0, -3 )) - 1;
+                       $num = intval( substr( $year, 0, -3 ) ) - 1;
                        # PHP bug note: sprintf( "%04d", -1 ) fails poorly
                        $text = sprintf( '-%04d', $num );
 
index 49b2d33..f125510 100644 (file)
@@ -406,7 +406,8 @@ class LinkHolderArray {
                $text = preg_replace_callback(
                        '/(<!--LINK .*?-->)/',
                        $replacer->cb(),
-                       $text);
+                       $text
+               );
 
                wfProfileOut( __METHOD__ . '-replace' );
                wfProfileOut( __METHOD__ );
index 8209f8a..59f32d0 100644 (file)
@@ -3592,7 +3592,7 @@ class Parser {
                }
 
                $dom = $this->preprocessToDom( $text, self::PTD_FOR_INCLUSION );
-               $this->mTplDomCache[ $titleText ] = $dom;
+               $this->mTplDomCache[$titleText] = $dom;
 
                if ( !$title->equals( $cacheTitle ) ) {
                        $this->mTplRedirCache[$cacheTitle->getPrefixedDBkey()] =
@@ -3811,8 +3811,8 @@ class Parser {
                $dbw->replace( 'transcache', array( 'tc_url' ), array(
                        'tc_url' => $url,
                        'tc_time' => $dbw->timestamp( time() ),
-                       'tc_contents' => $text)
-               );
+                       'tc_contents' => $text
+               ) );
                return $text;
        }
 
index d0c57ab..78ebbbb 100644 (file)
@@ -397,7 +397,7 @@ class Preprocessor_DOM implements Preprocessor {
 
                                                if ( $stack->top ) {
                                                        $part = $stack->top->getCurrentPart();
-                                                       if ( !(isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 )) {
+                                                       if ( !( isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 ) ) {
                                                                $part->visualEnd = $wsStart;
                                                        }
                                                        // Else comments abutting, no change in visual end
@@ -746,7 +746,7 @@ class PPDStack {
                        $class = $this->elementClass;
                        $this->stack[] = new $class( $data );
                }
-               $this->top = $this->stack[ count( $this->stack ) - 1 ];
+               $this->top = $this->stack[count( $this->stack ) - 1];
                $this->accum =& $this->top->getAccum();
        }
 
@@ -757,7 +757,7 @@ class PPDStack {
                $temp = array_pop( $this->stack );
 
                if ( count( $this->stack ) ) {
-                       $this->top = $this->stack[ count( $this->stack ) - 1 ];
+                       $this->top = $this->stack[count( $this->stack ) - 1];
                        $this->accum =& $this->top->getAccum();
                } else {
                        $this->top = self::$false;
@@ -1014,11 +1014,13 @@ class PPFrame_DOM implements PPFrame {
 
                while ( count( $iteratorStack ) > 1 ) {
                        $level = count( $outStack ) - 1;
-                       $iteratorNode =& $iteratorStack[ $level ];
+                       $iteratorNode =& $iteratorStack[$level];
                        $out =& $outStack[$level];
                        $index =& $indexStack[$level];
 
-                       if ( $iteratorNode instanceof PPNode_DOM ) $iteratorNode = $iteratorNode->node;
+                       if ( $iteratorNode instanceof PPNode_DOM ) {
+                               $iteratorNode = $iteratorNode->node;
+                       }
 
                        if ( is_array( $iteratorNode ) ) {
                                if ( $index >= count( $iteratorNode ) ) {
@@ -1148,9 +1150,7 @@ class PPFrame_DOM implements PPFrame {
 
                                        # Insert a heading marker only for <h> children of <root>
                                        # This is to stop extractSections from going over multiple tree levels
-                                       if ( $contextNode->parentNode->nodeName == 'root'
-                                         && $this->parser->ot['html'] )
-                                       {
+                                       if ( $contextNode->parentNode->nodeName == 'root' && $this->parser->ot['html'] ) {
                                                # Insert heading index marker
                                                $headingIndex = $contextNode->getAttribute( 'i' );
                                                $titleText = $this->title->getPrefixedDBkey();
index fad1adb..9f87ed7 100644 (file)
@@ -332,7 +332,7 @@ class Preprocessor_Hash implements Preprocessor {
 
                                                if ( $stack->top ) {
                                                        $part = $stack->top->getCurrentPart();
-                                                       if ( !(isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 )) {
+                                                       if ( !( isset( $part->commentEnd ) && $part->commentEnd == $wsStart - 1 ) ) {
                                                                $part->visualEnd = $wsStart;
                                                        }
                                                        // Else comments abutting, no change in visual end
@@ -952,7 +952,7 @@ class PPFrame_Hash implements PPFrame {
 
                while ( count( $iteratorStack ) > 1 ) {
                        $level = count( $outStack ) - 1;
-                       $iteratorNode =& $iteratorStack[ $level ];
+                       $iteratorNode =& $iteratorStack[$level];
                        $out =& $outStack[$level];
                        $index =& $indexStack[$level];
 
index 5ecdc4f..c732b8d 100644 (file)
@@ -537,7 +537,7 @@ class Profiler {
                                $eventCount = $this->mCalls[$name];
                                $timeSum = (float) ($elapsed * 1000);
                                $memorySum = (float)$this->mMemory[$name];
-                               $name = substr($name, 0, 255);
+                               $name = substr( $name, 0, 255 );
 
                                // Kludge
                                $timeSum = ($timeSum >= 0) ? $timeSum : 0;
index abefa81..1cf4fa7 100644 (file)
@@ -58,7 +58,7 @@ class ProfilerSimpleUDP extends ProfilerSimple {
                                continue;
                        }
                        $pfline = sprintf( "%s %s %d %f %f %f %f %s\n", $this->getProfileID(), "-", $pfdata['count'],
-                               $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry);
+                               $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry );
                        $length = strlen( $pfline );
                        /* printf("<!-- $pfline -->"); */
                        if ( $length + $plength > 1400 ) {
index 0f8e54c..e840300 100644 (file)
@@ -108,7 +108,7 @@ class ResourceLoaderLanguageDataModule extends ResourceLoaderModule {
         * @return array|int|Mixed
         */
        public function getModifiedTime( ResourceLoaderContext $context ) {
-               $this->language = Language::factory( $context ->getLanguage() );
+               $this->language = Language::factory( $context->getLanguage() );
                $cache = wfGetCache( CACHE_ANYTHING );
                $key = wfMemcKey( 'resourceloader', 'langdatamodule', 'changeinfo' );
 
index 1ace383..ae5d934 100644 (file)
@@ -242,8 +242,7 @@ class RevDel_RevisionItem extends RevDel_Item {
                if ( $this->isDeleted() && !$this->canViewContent() ) {
                        return $this->list->msg( 'diff' )->escaped();
                } else {
-                       return
-                               Linker::linkKnown(
+                       return Linker::linkKnown(
                                        $this->list->title,
                                        $this->list->msg( 'diff' )->escaped(),
                                        array(),
index b2108de..fcbec9e 100644 (file)
@@ -68,7 +68,7 @@ abstract class RevDel_List extends RevisionListBase {
 
                for ( $this->reset(); $this->current(); $this->next() ) {
                        $item = $this->current();
-                       unset( $missing[ $item->getId() ] );
+                       unset( $missing[$item->getId()] );
 
                        $oldBits = $item->getBits();
                        // Build the actual new rev_deleted bitfield
index fe351c5..d2e10e1 100644 (file)
@@ -40,7 +40,7 @@ class RevisionDeleter {
         */
        protected static function checkItem( $desc, $field, $diff, $new, &$arr ) {
                if( $diff & $field ) {
-                       $arr[ ( $new & $field ) ? 0 : 1 ][] = $desc;
+                       $arr[( $new & $field ) ? 0 : 1][] = $desc;
                }
        }
 
index 4a501fd..605a71b 100644 (file)
@@ -99,7 +99,7 @@ class SearchMySQL extends SearchEngine {
                                $strippedVariants = array_unique( $strippedVariants );
 
                                $searchon .= $modifier;
-                               if( count( $strippedVariants) > 1 )
+                               if( count( $strippedVariants ) > 1 )
                                        $searchon .= '(';
                                foreach( $strippedVariants as $stripped ) {
                                        $stripped = $this->normalizeText( $stripped );
@@ -111,7 +111,7 @@ class SearchMySQL extends SearchEngine {
                                        }
                                        $searchon .= "$quote$stripped$quote$wildcard ";
                                }
-                               if( count( $strippedVariants) > 1 )
+                               if( count( $strippedVariants ) > 1 )
                                        $searchon .= ')';
 
                                // Match individual terms or quoted phrase in result highlighting...
index b0ea97f..dd152f7 100644 (file)
  */
 class SearchOracle extends SearchEngine {
 
-       private $reservedWords = array ('ABOUT' => 1,
-                                                                       'ACCUM' => 1,
-                                                                       'AND' => 1,
-                                                                       'BT' => 1,
-                                                                       'BTG' => 1,
-                                                                       'BTI' => 1,
-                                                                       'BTP' => 1,
-                                                                       'FUZZY' => 1,
-                                                                       'HASPATH' => 1,
-                                                                       'INPATH' => 1,
-                                                                       'MINUS' => 1,
-                                                                       'NEAR' => 1,
-                                                                       'NOT' => 1,
-                                                                       'NT' => 1,
-                                                                       'NTG' => 1,
-                                                                       'NTI' => 1,
-                                                                       'NTP' => 1,
-                                                                       'OR' => 1,
-                                                                       'PT' => 1,
-                                                                       'RT' => 1,
-                                                                       'SQE' => 1,
-                                                                       'SYN' => 1,
-                                                                       'TR' => 1,
-                                                                       'TRSYN' => 1,
-                                                                       'TT' => 1,
-                                                                       'WITHIN' => 1);
+       private $reservedWords = array(
+               'ABOUT' => 1,
+               'ACCUM' => 1,
+               'AND' => 1,
+               'BT' => 1,
+               'BTG' => 1,
+               'BTI' => 1,
+               'BTP' => 1,
+               'FUZZY' => 1,
+               'HASPATH' => 1,
+               'INPATH' => 1,
+               'MINUS' => 1,
+               'NEAR' => 1,
+               'NOT' => 1,
+               'NT' => 1,
+               'NTG' => 1,
+               'NTI' => 1,
+               'NTP' => 1,
+               'OR' => 1,
+               'PT' => 1,
+               'RT' => 1,
+               'SQE' => 1,
+               'SYN' => 1,
+               'TR' => 1,
+               'TRSYN' => 1,
+               'TT' => 1,
+               'WITHIN' => 1,
+       );
 
        /**
         * Creates an instance of this class
@@ -199,8 +201,8 @@ class SearchOracle extends SearchEngine {
                                // Search terms in all variant forms, only
                                // apply on wiki with LanguageConverter
                                $temp_terms = $wgContLang->autoConvertToAllVariants( $terms[2] );
-                               if( is_array( $temp_terms )) {
-                                       $temp_terms = array_unique( array_values( $temp_terms ));
+                               if( is_array( $temp_terms ) ) {
+                                       $temp_terms = array_unique( array_values( $temp_terms ) );
                                        foreach( $temp_terms as $t ) {
                                                $searchon .= ($terms[1] == '-' ? ' ~' : ' & ') . $this->escapeTerm( $t );
                                        }
@@ -227,9 +229,9 @@ class SearchOracle extends SearchEngine {
        private function escapeTerm( $t ) {
                global $wgContLang;
                $t = $wgContLang->normalizeForSearch( $t );
-               $t = isset( $this->reservedWords[strtoupper( $t )] ) ? '{'.$t.'}' : $t;
-               $t = preg_replace('/^"(.*)"$/', '($1)', $t);
-               $t = preg_replace('/([-&|])/', '\\\\$1', $t);
+               $t = isset( $this->reservedWords[strtoupper( $t )] ) ? '{' . $t . '}' : $t;
+               $t = preg_replace( '/^"(.*)"$/', '($1)', $t );
+               $t = preg_replace( '/([-&|])/', '\\\\$1', $t );
                return $t;
        }
        /**
index 56464e9..b8d5dc1 100644 (file)
@@ -86,18 +86,18 @@ class SearchPostgres extends SearchEngine {
                wfDebug( "parseQuery received: $term \n" );
 
                ## No backslashes allowed
-               $term = preg_replace('/\\\/', '', $term);
+               $term = preg_replace( '/\\\/', '', $term );
 
                ## Collapse parens into nearby words:
-               $term = preg_replace('/\s*\(\s*/', ' (', $term);
-               $term = preg_replace('/\s*\)\s*/', ') ', $term);
+               $term = preg_replace( '/\s*\(\s*/', ' (', $term );
+               $term = preg_replace( '/\s*\)\s*/', ') ', $term );
 
                ## Treat colons as word separators:
-               $term = preg_replace('/:/', ' ', $term);
+               $term = preg_replace( '/:/', ' ', $term );
 
                $searchstring = '';
                $m = array();
-               if( preg_match_all('/([-!]?)(\S+)\s*/', $term, $m, PREG_SET_ORDER ) ) {
+               if( preg_match_all( '/([-!]?)(\S+)\s*/', $term, $m, PREG_SET_ORDER ) ) {
                        foreach( $m as $terms ) {
                                if ( strlen( $terms[1] ) ) {
                                        $searchstring .= ' & !';
@@ -118,19 +118,19 @@ class SearchPostgres extends SearchEngine {
                }
 
                ## Strip out leading junk
-               $searchstring = preg_replace('/^[\s\&\|]+/', '', $searchstring);
+               $searchstring = preg_replace( '/^[\s\&\|]+/', '', $searchstring );
 
                ## Remove any doubled-up operators
-               $searchstring = preg_replace('/([\!\&\|]) +(?:[\&\|] +)+/', "$1 ", $searchstring);
+               $searchstring = preg_replace( '/([\!\&\|]) +(?:[\&\|] +)+/', "$1 ", $searchstring );
 
                ## Remove any non-spaced operators (e.g. "Zounds!")
-               $searchstring = preg_replace('/([^ ])[\!\&\|]/', "$1", $searchstring);
+               $searchstring = preg_replace( '/([^ ])[\!\&\|]/', "$1", $searchstring );
 
                ## Remove any trailing whitespace or operators
-               $searchstring = preg_replace('/[\s\!\&\|]+$/', '', $searchstring);
+               $searchstring = preg_replace( '/[\s\!\&\|]+$/', '', $searchstring );
 
                ## Remove unnecessary quotes around everything
-               $searchstring = preg_replace('/^[\'"](.*)[\'"]$/', "$1", $searchstring);
+               $searchstring = preg_replace( '/^[\'"](.*)[\'"]$/', "$1", $searchstring );
 
                ## Quote the whole thing
                $searchstring = $this->db->addQuotes( $searchstring );
@@ -169,7 +169,7 @@ class SearchPostgres extends SearchEngine {
                }
                else {
                        $m = array();
-                       if( preg_match_all("/'([^']+)'/", $top, $m, PREG_SET_ORDER ) ) {
+                       if( preg_match_all( "/'([^']+)'/", $top, $m, PREG_SET_ORDER ) ) {
                                foreach( $m as $terms ) {
                                        $this->searchTerms[$terms[1]] = $terms[1];
                                }
index f3f4788..ee30d9b 100644 (file)
@@ -101,7 +101,7 @@ class SearchSqlite extends SearchEngine {
                                $strippedVariants = array_unique( $strippedVariants );
 
                                $searchon .= $modifier;
-                               if( count( $strippedVariants) > 1 )
+                               if( count( $strippedVariants ) > 1 )
                                        $searchon .= '(';
                                foreach( $strippedVariants as $stripped ) {
                                        if( $nonQuoted && strpos( $stripped, ' ' ) !== false ) {
@@ -112,7 +112,7 @@ class SearchSqlite extends SearchEngine {
                                        }
                                        $searchon .= "$quote$stripped$quote$wildcard ";
                                }
-                               if( count( $strippedVariants) > 1 )
+                               if( count( $strippedVariants ) > 1 )
                                        $searchon .= ')';
 
                                // Match individual terms or quoted phrase in result highlighting...
index eabcda3..35199d6 100644 (file)
@@ -66,7 +66,7 @@ class SearchUpdate implements DeferrableUpdate {
                $lc = SearchEngine::legalSearchChars() . '&#;';
 
                if( $this->mText === false ) {
-                       $search->updateTitle($this->mId,
+                       $search->updateTitle( $this->mId,
                                $search->normalizeText( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) );
                        wfProfileOut( __METHOD__ );
                        return;
index 0509272..21226fd 100644 (file)
@@ -185,7 +185,7 @@ class MediaWikiSite extends Site {
                // the single page in the "pages" substructure.
                if ( isset( $externalData['query']['pages'] ) ) {
                        $pages = array_values( $externalData['query']['pages'] );
-                       if ( count( $pages) === 1 ) {
+                       if ( count( $pages ) === 1 ) {
                                return $pages[0];
                        }
                }
index f9cb5cd..a9491d0 100644 (file)
@@ -88,7 +88,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                $namespaces = $wgContLang->getNamespaces();
 
                $out->setPageTitle(
-                       ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ?
+                       ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces ) ) ) ?
                        $this->msg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) :
                        $this->msg( 'allarticles' )
                );
index 50fdbc2..8dafbae 100644 (file)
@@ -634,7 +634,7 @@ class SpecialBlock extends FormSpecialPage {
                        return array( 'badipaddress' );
                }
 
-               if ( ( strlen( $data['Expiry'] ) == 0) || ( strlen( $data['Expiry'] ) > 50 )
+               if ( ( strlen( $data['Expiry'] ) == 0 ) || ( strlen( $data['Expiry'] ) > 50 )
                        || !self::parseExpiryInput( $data['Expiry'] ) )
                {
                        return array( 'ipb_expiry_invalid' );
index 9040c64..f56ca52 100644 (file)
@@ -126,8 +126,7 @@ class CategoryPager extends AlphabeticPager {
        public function getStartForm( $from ) {
                global $wgScript;
 
-               return
-                       Xml::tags( 'form', array( 'method' => 'get', 'action' => $wgScript ),
+               return Xml::tags( 'form', array( 'method' => 'get', 'action' => $wgScript ),
                                Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
                                Xml::fieldset( $this->msg( 'categories' )->text(),
                                        Xml::inputLabel( $this->msg( 'categoriesfrom' )->text(),
index b118059..75983e8 100644 (file)
@@ -747,7 +747,7 @@ class ContribsPager extends ReverseChronologicalPager {
                        if ( !$this->associated ) {
                                return array( "page_namespace $eq_op $selectedNS" );
                        } else {
-                               $associatedNS = $this->mDb->addQuotes (
+                               $associatedNS = $this->mDb->addQuotes(
                                        MWNamespace::getAssociated( $this->namespace )
                                );
                                return array(
index b5ad589..163e5c6 100644 (file)
@@ -119,11 +119,11 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                                throw new ThrottledError;
                        case 'mailnologin':
                        case 'usermaildisabled':
-                               throw new  ErrorPageError( $error, "{$error}text" );
+                               throw new ErrorPageError( $error, "{$error}text" );
                        default:
                                # It's a hook error
                                list( $title, $msg, $params ) = $error;
-                               throw new  ErrorPageError( $title, $msg, $params );
+                               throw new ErrorPageError( $title, $msg, $params );
                }
                // Got a valid target user name? Else ask for one.
                $ret = self::getTarget( $this->mTarget );
index d204d50..ab42549 100644 (file)
@@ -112,7 +112,7 @@ class SpecialJavaScriptTest extends SpecialPage {
                if( !in_array( $state, $validStates ) ) {
                        throw new MWException( __METHOD__
                                . ' given an invalid state. Must be one of "'
-                               . join( '", "', $validStates) . '".'
+                               . join( '", "', $validStates ) . '".'
                        );
                }
                return "<div id=\"mw-javascripttest-summary\" class=\"mw-javascripttest-$state\">$html</div>";
index eb89bec..9ddce0c 100644 (file)
@@ -202,16 +202,14 @@ class SpecialProtectedpages extends SpecialPage {
         * @return string Formatted HTML
         */
        protected function getExpiryCheck( $indefOnly ) {
-               return
-                       Xml::checkLabel( $this->msg( 'protectedpages-indef' )->text(), 'indefonly', 'indefonly', $indefOnly ) . "\n";
+               return Xml::checkLabel( $this->msg( 'protectedpages-indef' )->text(), 'indefonly', 'indefonly', $indefOnly ) . "\n";
        }
 
        /**
         * @return string Formatted HTML
         */
        protected function getCascadeCheck( $cascadeOnly ) {
-               return
-                       Xml::checkLabel( $this->msg( 'protectedpages-cascade' )->text(), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n";
+               return Xml::checkLabel( $this->msg( 'protectedpages-cascade' )->text(), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n";
        }
 
        /**
@@ -220,8 +218,7 @@ class SpecialProtectedpages extends SpecialPage {
        protected function getSizeLimit( $sizetype, $size ) {
                $max = $sizetype === 'max';
 
-               return
-                       Xml::radioLabel( $this->msg( 'minimum-size' )->text(), 'sizetype', 'min', 'wpmin', !$max ) .
+               return Xml::radioLabel( $this->msg( 'minimum-size' )->text(), 'sizetype', 'min', 'wpmin', !$max ) .
                        '&#160;' .
                        Xml::radioLabel( $this->msg( 'maximum-size' )->text(), 'sizetype', 'max', 'wpmax', $max ) .
                        '&#160;' .
index 6a94deb..8548a7b 100644 (file)
@@ -176,8 +176,7 @@ class SpecialProtectedtitles extends SpecialPage {
                        $options[] = Xml::option( $text, $type, $selected );
                }
 
-               return
-                       Xml::label( $this->msg( 'restriction-level' )->text(), $this->IdLevel ) . '&#160;' .
+               return Xml::label( $this->msg( 'restriction-level' )->text(), $this->IdLevel ) . '&#160;' .
                        Xml::tags( 'select',
                                array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ),
                                implode( "\n", $options ) );
@@ -200,7 +199,7 @@ class ProtectedTitlesPager extends AlphabeticPager {
                $this->mConds = $conds;
                $this->level = $level;
                $this->namespace = $namespace;
-               $this->size = intval($size);
+               $this->size = intval( $size );
                parent::__construct( $form->getContext() );
        }
 
index 391c4a7..99dac8f 100644 (file)
@@ -183,7 +183,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                                }
                        }
 
-                       if( $dbr->unionSupportsOrderAndLimit()) {
+                       if( $dbr->unionSupportsOrderAndLimit() ) {
                                $order = array( 'ORDER BY' => 'rc_timestamp DESC' );
                        } else {
                                $order = array();
@@ -198,7 +198,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                                $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) )
                        );
 
-                       if( $dbr->unionSupportsOrderAndLimit())
+                       if( $dbr->unionSupportsOrderAndLimit() )
                                $query = $dbr->limitResult( $query, $limit );
 
                        $subsql[] = $query;
index 5a5f8ff..d23e812 100644 (file)
@@ -581,7 +581,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                foreach( $this->checks as $item ) {
                        list( /* message */, $name, $field ) = $item;
                        $val = $this->getRequest()->getInt( $name, 0 /* unchecked */ );
-                       if( $val < -1 || $val > 1) {
+                       if( $val < -1 || $val > 1 ) {
                                $val = -1; // -1 for existing value
                        }
                        $bitfield[$field] = $val;
index 6c40148..380e20e 100644 (file)
@@ -912,8 +912,7 @@ class SpecialSearch extends SpecialPage {
                        $hidden .= Html::hidden( $key, $value );
                }
                // Return final output
-               return
-                       Xml::openElement(
+               return Xml::openElement(
                                'fieldset',
                                array( 'id' => 'mw-searchoptions', 'style' => 'margin:0em;' )
                        ) .
@@ -1098,7 +1097,8 @@ class SpecialSearch extends SpecialPage {
                        'a',
                        array(
                                'href' => $this->getTitle()->getLocalURL( $stParams ),
-                               'title' => $tooltip),
+                               'title' => $tooltip
+                       ),
                        $label
                );
        }
index e036348..ed550a0 100644 (file)
@@ -1041,9 +1041,10 @@ class SpecialUndelete extends SpecialPage {
                $user = $this->getUser();
                $lang = $this->getLanguage();
                $rdel = Linker::getRevDeleteLink( $user, $rev, $this->mTargetObj );
-               if ( $rdel ) $rdel = " $rdel";
-               return
-                       '<div id="mw-diff-' . $prefix . 'title1"><strong>' .
+               if ( $rdel ) {
+                       $rdel = " $rdel";
+               }
+               return '<div id="mw-diff-' . $prefix . 'title1"><strong>' .
                                Linker::link(
                                        $targetPage,
                                        $this->msg(
index c7f122b..afea377 100644 (file)
@@ -246,7 +246,7 @@ class SpecialWatchlist extends SpecialPage {
                # Show watchlist header
                $form .= $this->msg( 'watchlist-details' )->numParams( $nitems )->parse() . "\n";
 
-               if( $user->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist) {
+               if( $user->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist ) {
                        $form .= $this->msg( 'wlheader-enotif' )->parseAsBlock() . "\n";
                }
                if( $wgShowUpdatedMarker ) {
index cb3e985..8841af8 100644 (file)
@@ -170,21 +170,24 @@ class SpecialWhatLinksHere extends SpecialPage {
                        $options['ORDER BY'] = 'pl_from';
                        $plRes = $dbr->select( array( 'pagelinks', 'page', 'redirect' ), $fields,
                                $plConds, __METHOD__, $options,
-                               $joinConds);
+                               $joinConds
+                       );
                }
 
                if( !$hidetrans ) {
                        $options['ORDER BY'] = 'tl_from';
                        $tlRes = $dbr->select( array( 'templatelinks', 'page', 'redirect' ), $fields,
                                $tlConds, __METHOD__, $options,
-                               $joinConds);
+                               $joinConds
+                       );
                }
 
                if( !$hideimages ) {
                        $options['ORDER BY'] = 'il_from';
                        $ilRes = $dbr->select( array( 'imagelinks', 'page', 'redirect' ), $fields,
                                $ilConds, __METHOD__, $options,
-                               $joinConds);
+                               $joinConds
+                       );
                }
 
                if( ( !$fetchlinks || !$plRes->numRows() ) && ( $hidetrans || !$tlRes->numRows() ) && ( $hideimages || !$ilRes->numRows() ) ) {
index 2483e58..b0ec8b5 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
-        die( "NoLocalSettings.php is not a valid MediaWiki entry point\n" );
+       die( "NoLocalSettings.php is not a valid MediaWiki entry point\n" );
 }
 
 if ( !isset( $wgVersion ) ) {
index 8381b4c..78c64e1 100644 (file)
@@ -70,17 +70,18 @@ abstract class UploadBase {
         * @return string
         */
        public function getVerificationErrorCode( $error ) {
-               $code_to_status = array(self::EMPTY_FILE => 'empty-file',
-                                                               self::FILE_TOO_LARGE => 'file-too-large',
-                                                               self::FILETYPE_MISSING => 'filetype-missing',
-                                                               self::FILETYPE_BADTYPE => 'filetype-banned',
-                                                               self::MIN_LENGTH_PARTNAME => 'filename-tooshort',
-                                                               self::ILLEGAL_FILENAME => 'illegal-filename',
-                                                               self::OVERWRITE_EXISTING_FILE => 'overwrite',
-                                                               self::VERIFICATION_ERROR => 'verification-error',
-                                                               self::HOOK_ABORTED => 'hookaborted',
-                                                               self::WINDOWS_NONASCII_FILENAME => 'windows-nonascii-filename',
-                                                               self::FILENAME_TOO_LONG => 'filename-toolong',
+               $code_to_status = array(
+                       self::EMPTY_FILE => 'empty-file',
+                       self::FILE_TOO_LARGE => 'file-too-large',
+                       self::FILETYPE_MISSING => 'filetype-missing',
+                       self::FILETYPE_BADTYPE => 'filetype-banned',
+                       self::MIN_LENGTH_PARTNAME => 'filename-tooshort',
+                       self::ILLEGAL_FILENAME => 'illegal-filename',
+                       self::OVERWRITE_EXISTING_FILE => 'overwrite',
+                       self::VERIFICATION_ERROR => 'verification-error',
+                       self::HOOK_ABORTED => 'hookaborted',
+                       self::WINDOWS_NONASCII_FILENAME => 'windows-nonascii-filename',
+                       self::FILENAME_TOO_LONG => 'filename-toolong',
                );
                if( isset( $code_to_status[$error] ) ) {
                        return $code_to_status[$error];
@@ -360,7 +361,7 @@ abstract class UploadBase {
                global $wgVerifyMimeType;
                wfProfileIn( __METHOD__ );
                if ( $wgVerifyMimeType ) {
-                       wfDebug ( "\n\nmime: <$mime> extension: <{$this->mFinalExtension}>\n\n" );
+                       wfDebug( "\n\nmime: <$mime> extension: <{$this->mFinalExtension}>\n\n" );
                        global $wgMimeTypeBlacklist;
                        if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) {
                                wfProfileOut( __METHOD__ );
index e784e51..8144c34 100644 (file)
@@ -182,7 +182,7 @@ class UploadFromChunks extends UploadFromFile {
                // Get the offset before we add the chunk to the file system
                $preAppendOffset = $this->getOffset();
 
-               if ( $preAppendOffset + $chunkSize > $this->getMaxUploadSize()) {
+               if ( $preAppendOffset + $chunkSize > $this->getMaxUploadSize() ) {
                        $status = Status::newFatal( 'file-too-large' );
                } else {
                        // Make sure the client is uploading the correct chunk with a matching offset.