From 24bfde2710fca254e444a065c7f6d83fa83ca17a Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 24 Aug 2013 17:06:25 +0200 Subject: [PATCH] Fix spacing and break some lines Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac --- includes/AutoLoader.php | 13 ++--- includes/Autopromote.php | 3 +- includes/CategoryPage.php | 8 +++- includes/ChangeTags.php | 3 +- includes/ChangesFeed.php | 3 +- includes/Cookie.php | 3 +- includes/DefaultSettings.php | 2 +- includes/EditPage.php | 2 +- includes/GlobalFunctions.php | 4 +- includes/HttpFunctions.php | 2 +- includes/api/ApiQuerySiteinfo.php | 2 +- includes/cache/MessageCache.php | 4 +- includes/cache/SquidUpdate.php | 6 +-- includes/db/DatabaseMysqlBase.php | 2 +- includes/db/DatabaseOracle.php | 2 +- includes/filerepo/ForeignAPIRepo.php | 2 +- includes/gallery/PackedImageGallery.php | 2 +- includes/gallery/TraditionalImageGallery.php | 2 +- includes/installer/Installer.php | 2 +- includes/installer/OracleInstaller.php | 2 +- includes/limit.sh | 4 +- includes/media/MediaTransformOutput.php | 2 +- includes/media/PNGMetadataExtractor.php | 4 +- includes/media/SVG.php | 10 ++-- .../objectcache/MemcachedPeclBagOStuff.php | 2 +- includes/parser/Parser.php | 6 +-- includes/parser/Preprocessor_DOM.php | 4 +- includes/parser/Preprocessor_Hash.php | 4 +- includes/search/SearchUpdate.php | 2 +- includes/specials/SpecialMovepage.php | 2 +- includes/specials/SpecialRandomInCategory.php | 2 +- includes/specials/SpecialUserlogin.php | 6 +-- includes/upload/UploadFromChunks.php | 2 +- languages/data/plurals.xml | 2 +- maintenance/backupTextPass.inc | 7 ++- maintenance/checkUsernames.php | 2 +- maintenance/eraseArchivedFile.php | 4 +- maintenance/getConfiguration.php | 22 ++++----- maintenance/mergeMessageFileList.php | 2 +- maintenance/mwdocgen.php | 2 +- maintenance/runJobs.php | 4 +- maintenance/tables.sql | 2 +- skins/MonoBook.php | 2 +- skins/cologneblue/screen.css | 6 +-- skins/common/config.js | 10 ++-- skins/common/protect.js | 4 +- tests/parser/parserTest.inc | 2 +- tests/phpunit/MediaWikiPHPUnitCommand.php | 6 +-- .../phpunit/MediaWikiPHPUnitTestListener.php | 2 +- tests/phpunit/includes/EditPageTest.php | 2 +- .../includes/GlobalFunctions/GlobalTest.php | 2 +- .../GlobalFunctions/wfTimestampTest.php | 2 +- tests/phpunit/includes/HttpTest.php | 2 +- tests/phpunit/includes/IPTest.php | 48 +++++++++---------- tests/phpunit/includes/XmlTypeCheckTest.php | 2 +- .../phpunit/includes/api/ApiEditPageTest.php | 4 +- tests/phpunit/includes/api/ApiTest.php | 2 +- tests/phpunit/includes/api/ApiTestCase.php | 4 +- tests/phpunit/includes/api/ApiUploadTest.php | 14 +++--- .../installer/InstallDocFormatterTest.php | 2 +- .../includes/parser/MediaWikiParserTest.php | 18 +++---- tests/phpunit/phpunit.php | 2 +- 62 files changed, 159 insertions(+), 143 deletions(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 45ad16835e..2f92ab0927 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -1126,12 +1126,13 @@ class AutoLoader { static function autoload( $className ) { global $wgAutoloadClasses, $wgAutoloadLocalClasses; - // Workaround for PHP bug (5.3.2. is broken, it's fixed in 5.3.6). - // Strip leading backslashes from class names. When namespaces are used, leading backslashes are used to indicate - // the top-level namespace, e.g. \foo\Bar. When used like this in the code, the leading backslash isn't passed to - // the auto-loader ($className would be 'foo\Bar'). However, if a class is accessed using a string instead of a - // class literal (e.g. $class = '\foo\Bar'; new $class()), then some versions of PHP do not strip the leading - // backlash in this case, causing autoloading to fail. + // Workaround for PHP bug (5.3.2. is broken, it's + // fixed in 5.3.6). Strip leading backslashes from class names. When namespaces are used, + // leading backslashes are used to indicate the top-level namespace, e.g. \foo\Bar. When + // used like this in the code, the leading backslash isn't passed to the auto-loader + // ($className would be 'foo\Bar'). However, if a class is accessed using a string instead + // of a class literal (e.g. $class = '\foo\Bar'; new $class()), then some versions of PHP + // do not strip the leading backlash in this case, causing autoloading to fail. $className = ltrim( $className, '\\' ); if ( isset( $wgAutoloadLocalClasses[$className] ) ) { diff --git a/includes/Autopromote.php b/includes/Autopromote.php index ec9dcf5376..170d7abfdf 100644 --- a/includes/Autopromote.php +++ b/includes/Autopromote.php @@ -126,7 +126,8 @@ class Autopromote { return false; } elseif ( $cond[0] == '^' ) { // XOR (exactly one cond passes) if ( count( $cond ) > 3 ) { - wfWarn( 'recCheckCondition() given XOR ("^") condition on three or more conditions. Check your $wgAutopromote and $wgAutopromoteOnce settings.' ); + wfWarn( 'recCheckCondition() given XOR ("^") condition on three or more conditions.' . + ' Check your $wgAutopromote and $wgAutopromoteOnce settings.' ); } return self::recCheckCondition( $cond[1], $user ) xor self::recCheckCondition( $cond[2], $user ); diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 43ab4dbd69..ba71aa01a9 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -106,7 +106,13 @@ class CategoryPage extends Article { unset( $reqArray["from"] ); unset( $reqArray["to"] ); - $viewer = new $this->mCategoryViewerClass( $this->getContext()->getTitle(), $this->getContext(), $from, $until, $reqArray ); + $viewer = new $this->mCategoryViewerClass( + $this->getContext()->getTitle(), + $this->getContext(), + $from, + $until, + $reqArray + ); $this->getContext()->getOutput()->addHTML( $viewer->getHTML() ); } } diff --git a/includes/ChangeTags.php b/includes/ChangeTags.php index e94143aa2c..97e80f2a63 100644 --- a/includes/ChangeTags.php +++ b/includes/ChangeTags.php @@ -98,7 +98,8 @@ class ChangeTags { $tags = array_filter( $tags ); // Make sure we're submitting all tags... if ( !$rc_id && !$rev_id && !$log_id ) { - throw new MWException( "At least one of: RCID, revision ID, and log ID MUST be specified when adding a tag to a change!" ); + throw new MWException( 'At least one of: RCID, revision ID, and log ID MUST be ' . + 'specified when adding a tag to a change!' ); } $dbr = wfGetDB( DB_SLAVE ); diff --git a/includes/ChangesFeed.php b/includes/ChangesFeed.php index 1d89888814..0736c5076c 100644 --- a/includes/ChangesFeed.php +++ b/includes/ChangesFeed.php @@ -208,7 +208,8 @@ class ChangesFeed { FeedUtils::formatDiff( $obj ), $url, $obj->rc_timestamp, - ( $obj->rc_deleted & Revision::DELETED_USER ) ? wfMessage( 'rev-deleted-user' )->escaped() : $obj->rc_user_text, + ( $obj->rc_deleted & Revision::DELETED_USER ) + ? wfMessage( 'rev-deleted-user' )->escaped() : $obj->rc_user_text, $talkpage ); $feed->outItem( $item ); diff --git a/includes/Cookie.php b/includes/Cookie.php index 1b22c0e5c7..ecf4667d15 100644 --- a/includes/Cookie.php +++ b/includes/Cookie.php @@ -82,7 +82,8 @@ class Cookie { * http://publicsuffix.org/ * * @todo fixme fails to detect 3-letter top-level domains - * @todo fixme fails to detect 2-letter top-level domains for single-domain use (probably not a big problem in practice, but there are test cases) + * @todo fixme fails to detect 2-letter top-level domains for single-domain use (probably + * not a big problem in practice, but there are test cases) * * @param string $domain the domain to validate * @param string $originDomain (optional) the domain the cookie originates from diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 8396805b83..c04402e092 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2384,7 +2384,7 @@ $wgHTCPRouting = array(); /** * @deprecated since 1.22, please use $wgHTCPRouting instead. * - * Whenever this is set and $wgHTCPRouting evaluates to false, $wgHTCPRouting + * Whenever this is set and $wgHTCPRouting evaluates to false, $wgHTCPRouting * will be set to this value. * This is merely for back compatibility. * diff --git a/includes/EditPage.php b/includes/EditPage.php index 7c7bfe9116..61742c233e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1526,7 +1526,7 @@ class EditPage { // message with content equivalent to default (allow empty pages // in this case to disable messages, see bug 50124) $defaultMessageText = $this->mTitle->getDefaultMessageText(); - if( $this->mTitle->getNamespace() === NS_MEDIAWIKI && $defaultMessageText !== false ) { + if ( $this->mTitle->getNamespace() === NS_MEDIAWIKI && $defaultMessageText !== false ) { $defaultText = $defaultMessageText; } else { $defaultText = ''; diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index dd23538aaf..0060d15fb8 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3969,8 +3969,8 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) { } /** - * Determine whether the client at a given source IP is likely to be able to - * access the wiki via HTTPS. + * Determine whether the client at a given source IP is likely to be able to + * access the wiki via HTTPS. * * @param string $ip The IPv4/6 address in the normal human-readable form * @return boolean diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 444857a085..78c2ac7a38 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -66,7 +66,7 @@ class Http { if ( !isset( $options['timeout'] ) ) { $options['timeout'] = 'default'; } - if( !isset( $options['connectTimeout'] ) ) { + if ( !isset( $options['connectTimeout'] ) ) { $options['connectTimeout'] = 'default'; } diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 7bb7e382dd..9abfc785ee 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -691,7 +691,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { ' extensions - Returns extensions installed on the wiki', ' fileextensions - Returns list of file extensions allowed to be uploaded', ' rightsinfo - Returns wiki rights (license) information if available', - " languages - Returns a list of languages MediaWiki supports". + " languages - Returns a list of languages MediaWiki supports" . "(optionally localised by using {$p}inlanguagecode)", ' skins - Returns a list of all enabled skins', ' extensiontags - Returns a list of parser extension tags', diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index fcefc065f1..6ab10127cd 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -715,7 +715,7 @@ class MessageCache { } // Normalise title-case input (with some inlining) - $lckey = strtr( $key, ' ', '_'); + $lckey = strtr( $key, ' ', '_' ); if ( ord( $key ) < 128 ) { $lckey[0] = strtolower( $lckey[0] ); $uckey = ucfirst( $lckey ); @@ -743,7 +743,7 @@ class MessageCache { } // Post-processing if the message exists - if( $message !== false ) { + if ( $message !== false ) { // Fix whitespace $message = str_replace( array( diff --git a/includes/cache/SquidUpdate.php b/includes/cache/SquidUpdate.php index ebac7881c6..d060d4b60b 100644 --- a/includes/cache/SquidUpdate.php +++ b/includes/cache/SquidUpdate.php @@ -209,11 +209,11 @@ class SquidUpdate { continue; } - if( isset( $conf['host'] ) && isset( $conf['port'] ) ) { + if ( isset( $conf['host'] ) && isset( $conf['port'] ) ) { // Normalize single entries $conf = array( $conf ); } - foreach( $conf as $subconf ) { + foreach ( $conf as $subconf ) { if ( !isset( $subconf['host'] ) || !isset( $subconf['port'] ) ) { wfProfileOut( __METHOD__ ); throw new MWException( "Invalid HTCP rule for URL $url\n" ); @@ -241,7 +241,7 @@ class SquidUpdate { wfDebugLog( 'squid', __METHOD__ . "Purging URL $url via HTCP\n" ); - foreach( $conf as $subconf ) { + foreach ( $conf as $subconf ) { socket_sendto( $conn, $htcpPacket, $htcpLen, 0, $subconf['host'], $subconf['port'] ); } diff --git a/includes/db/DatabaseMysqlBase.php b/includes/db/DatabaseMysqlBase.php index cae133b9aa..5614ed209b 100644 --- a/includes/db/DatabaseMysqlBase.php +++ b/includes/db/DatabaseMysqlBase.php @@ -73,7 +73,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase { $this->installErrorHandler(); try { $this->mConn = $this->mysqlConnect( $realServer ); - } catch (Exception $ex) { + } catch ( Exception $ex ) { wfProfileOut( "dbconnect-$server" ); wfProfileOut( __METHOD__ ); throw $ex; diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 2ccc056273..fca979bb40 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -286,7 +286,7 @@ class DatabaseOracle extends DatabaseBase { wfSuppressWarnings(); if ( $this->mFlags & DBO_PERSISTENT ) { $this->mConn = oci_pconnect( $this->mUser, $this->mPassword, $this->mServer, $this->defaultCharset, $session_mode ); - } else if ( $this->mFlags & DBO_DEFAULT ) { + } elseif ( $this->mFlags & DBO_DEFAULT ) { $this->mConn = oci_new_connect( $this->mUser, $this->mPassword, $this->mServer, $this->defaultCharset, $session_mode ); } else { $this->mConn = oci_connect( $this->mUser, $this->mPassword, $this->mServer, $this->defaultCharset, $session_mode ); diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 6b0bc3a608..128412c1fd 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -265,7 +265,7 @@ class ForeignAPIRepo extends FileRepo { ) ); $info = $this->getImageInfo( $data ); - if( $data && $info && isset( $info['thumberror'] ) ) { + if ( $data && $info && isset( $info['thumberror'] ) ) { wfDebug( __METHOD__ . " got remote thumb error " . $info['thumberror'] . "\n" ); return new MediaTransformError( 'thumbnail_error_remote', diff --git a/includes/gallery/PackedImageGallery.php b/includes/gallery/PackedImageGallery.php index 9149f8cead..0095d3480b 100644 --- a/includes/gallery/PackedImageGallery.php +++ b/includes/gallery/PackedImageGallery.php @@ -30,7 +30,7 @@ class PackedImageGallery extends TraditionalImageGallery { const SCALE_FACTOR = 1.5; protected function getVPad( $boxHeight, $thumbHeight ) { - return ( $this->getThumbPadding() + $boxHeight - $thumbHeight/ self::SCALE_FACTOR ) / 2; + return ( $this->getThumbPadding() + $boxHeight - $thumbHeight / self::SCALE_FACTOR ) / 2; } protected function getThumbPadding() { diff --git a/includes/gallery/TraditionalImageGallery.php b/includes/gallery/TraditionalImageGallery.php index 223fb0799e..1f60fa69b5 100644 --- a/includes/gallery/TraditionalImageGallery.php +++ b/includes/gallery/TraditionalImageGallery.php @@ -168,7 +168,7 @@ class TraditionalImageGallery extends ImageGalleryBase { ''; - $galleryText = $textlink . $text . $fileSize; + $galleryText = $textlink . $text . $fileSize; $galleryText = $this->wrapGalleryText( $galleryText, $thumb ); # Weird double wrapping (the extra div inside the li) needed due to FF2 bug diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index d41f7b8f9f..04d2b20d7f 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1090,7 +1090,7 @@ abstract class Installer { */ protected function envCheckSuhosinMaxValueLength() { $maxValueLength = ini_get( 'suhosin.get.max_value_length' ); - if ( $maxValueLength > 0 && $maxValueLength < 1024 ) { + if ( $maxValueLength > 0 && $maxValueLength < 1024 ) { // Only warn if the value is below the sane 1024 $this->showMessage( 'config-suhosin-max-value-length', $maxValueLength ); } diff --git a/includes/installer/OracleInstaller.php b/includes/installer/OracleInstaller.php index e34bed3757..aa950938a7 100644 --- a/includes/installer/OracleInstaller.php +++ b/includes/installer/OracleInstaller.php @@ -311,7 +311,7 @@ class OracleInstaller extends DatabaseInstaller { * @return bool Whether the connection string is valid. */ public static function checkConnectStringFormat( $connect_string ) { - $isValid = preg_match( '/^[[:alpha:]][\w\-]*(?:\.[[:alpha:]][\w\-]*){0,2}$/', $connect_string ); // TNS name + $isValid = preg_match( '/^[[:alpha:]][\w\-]*(?:\.[[:alpha:]][\w\-]*){0,2}$/', $connect_string ); // TNS name $isValid |= preg_match( '/^(?:\/\/)?[\w\-\.]+(?::[\d]+)?(?:\/(?:[\w\-\.]+(?::(pooled|dedicated|shared))?)?(?:\/[\w\-\.]+)?)?$/', $connect_string ); // EZConnect return (bool)$isValid; } diff --git a/includes/limit.sh b/includes/limit.sh index bc1988de49..6c4690ecd7 100644 --- a/includes/limit.sh +++ b/includes/limit.sh @@ -55,7 +55,7 @@ fi # Clean up cgroup cleanup() { - # First we have to move the current task into a "garbage" group, otherwise + # First we have to move the current task into a "garbage" group, otherwise # the cgroup will not be empty, and attempting to remove it will fail with # "Device or resource busy" if [ -w "$MW_CGROUP"/tasks ]; then @@ -84,7 +84,7 @@ if [ -n "$MW_CGROUP" ]; then updateTaskCount if [ $NUM_TASKS -gt 1 ]; then - # Spawn a monitor process which will continue to poll for completion + # Spawn a monitor process which will continue to poll for completion # of all processes in the cgroup after termination of the parent shell ( while [ $NUM_TASKS -gt 1 ]; do diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index fde38bb279..c49d3f2094 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -209,7 +209,7 @@ abstract class MediaTransformOutput { if ( $this->page && $this->page !== 1 ) { $query['page'] = $this->page; } - if( $this->lang ) { + if ( $this->lang ) { $query['lang'] = $this->lang; } diff --git a/includes/media/PNGMetadataExtractor.php b/includes/media/PNGMetadataExtractor.php index 34e5fa722a..845d212ab5 100644 --- a/includes/media/PNGMetadataExtractor.php +++ b/includes/media/PNGMetadataExtractor.php @@ -202,7 +202,7 @@ class PNGMetadataExtractor { if ( $items[5] === false ) { // decompression failed - wfDebug( __METHOD__ . ' Error decompressing iTxt chunk - ' . $items[1] . "\n"); + wfDebug( __METHOD__ . ' Error decompressing iTxt chunk - ' . $items[1] . "\n" ); fseek( $fh, self::$CRC_size, SEEK_CUR ); continue; } @@ -290,7 +290,7 @@ class PNGMetadataExtractor { if ( $content === false ) { // decompression failed - wfDebug( __METHOD__ . ' Error decompressing zTXt chunk - ' . $keyword . "\n"); + wfDebug( __METHOD__ . ' Error decompressing zTXt chunk - ' . $keyword . "\n" ); fseek( $fh, self::$CRC_size, SEEK_CUR ); continue; } diff --git a/includes/media/SVG.php b/includes/media/SVG.php index f0356f51fd..28083a7fa2 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -180,7 +180,7 @@ class SvgHandler extends ImageHandler { ) . " 2>&1"; $env = array(); - if( $lang !== false ) { + if ( $lang !== false ) { $env['LANG'] = $lang; } @@ -376,9 +376,9 @@ class SvgHandler extends ImageHandler { if ( in_array( $name, array( 'width', 'height' ) ) ) { // Reject negative heights, widths return ( $value > 0 ); - } elseif( $name == 'lang' ) { + } elseif ( $name == 'lang' ) { // Validate $code - if( !Language::isValidBuiltinCode( $value ) ) { + if ( !Language::isValidBuiltinCode( $value ) ) { wfDebug( "Invalid user language code\n" ); return false; } @@ -394,7 +394,7 @@ class SvgHandler extends ImageHandler { */ function makeParamString( $params ) { $lang = ''; - if( isset( $params['lang'] ) && $params['lang'] !== 'en' ) { + if ( isset( $params['lang'] ) && $params['lang'] !== 'en' ) { $params['lang'] = mb_strtolower( $params['lang'] ); $lang = "lang{$params['lang']}-"; } @@ -408,7 +408,7 @@ class SvgHandler extends ImageHandler { $m = false; if ( preg_match( '/^lang([a-z]+(?:-[a-z]+)*)-(\d+)px$/', $str, $m ) ) { return array( 'width' => array_pop( $m ), 'lang' => $m[1] ); - } elseif( preg_match( '/^(\d+)px$/', $str, $m ) ) { + } elseif ( preg_match( '/^(\d+)px$/', $str, $m ) ) { return array( 'width' => $m[1], 'lang' => 'en' ); } else { return false; diff --git a/includes/objectcache/MemcachedPeclBagOStuff.php b/includes/objectcache/MemcachedPeclBagOStuff.php index f9621624b1..0c3b228f81 100644 --- a/includes/objectcache/MemcachedPeclBagOStuff.php +++ b/includes/objectcache/MemcachedPeclBagOStuff.php @@ -67,7 +67,7 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff { $this->client->setOption( Memcached::OPT_RETRY_TIMEOUT, $params['retry_timeout'] ); } - if ( isset ( $params['server_failure_limit'] ) ) { + if ( isset( $params['server_failure_limit'] ) ) { $this->client->setOption( Memcached::OPT_SERVER_FAILURE_LIMIT, $params['server_failure_limit'] ); } diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index a6823bfe36..1ab29eb159 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1423,7 +1423,7 @@ class Parser { // of bold and italics mark-ups. $numbold = 0; $numitalics = 0; - for ( $i = 1; $i < count( $arr ); $i+=2 ) { + for ( $i = 1; $i < count( $arr ); $i += 2 ) { // If there are ever four apostrophes, assume the first is supposed to // be text, and the remaining three constitute mark-up for bold text. // (bug 13227: ''''foo'''' turns into ' ''' foo ' ''') @@ -1456,7 +1456,7 @@ class Parser { $firstsingleletterword = -1; $firstmultiletterword = -1; $firstspace = -1; - for ( $i = 1; $i < count( $arr ); $i+=2 ) { + for ( $i = 1; $i < count( $arr ); $i += 2 ) { if ( strlen( $arr[$i] ) == 3 ) { $x1 = substr( $arr[$i - 1], -1 ); $x2 = substr( $arr[$i - 1], -2, 1 ); @@ -5159,7 +5159,7 @@ class Parser { if ( $magicName ) { $paramName = $paramMap[$magicName]; - switch( $paramName ) { + switch ( $paramName ) { case 'gallery-internal-alt': $alt = $this->stripAltText( $match, false ); break; diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 48318b36f2..dde0609519 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -415,10 +415,10 @@ class Preprocessor_DOM implements Preprocessor { foreach ( $comments as $j => $com ) { $startPos = $com[0]; $endPos = $com[1] + 1; - if ( $j == ( count( $comments ) - 1) ) { + if ( $j == ( count( $comments ) - 1 ) ) { break; } - $inner = substr( $text, $startPos, $endPos - $startPos); + $inner = substr( $text, $startPos, $endPos - $startPos ); $accum .= '' . htmlspecialchars( $inner ) . ''; } diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 3f5ca8efc5..2fc5e118ca 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -342,10 +342,10 @@ class Preprocessor_Hash implements Preprocessor { foreach ( $comments as $j => $com ) { $startPos = $com[0]; $endPos = $com[1] + 1; - if ( $j == ( count( $comments ) - 1) ) { + if ( $j == ( count( $comments ) - 1 ) ) { break; } - $inner = substr( $text, $startPos, $endPos - $startPos); + $inner = substr( $text, $startPos, $endPos - $startPos ); $accum->addNodeWithText( 'comment', $inner ); } diff --git a/includes/search/SearchUpdate.php b/includes/search/SearchUpdate.php index 22e4724fe1..214821015a 100644 --- a/includes/search/SearchUpdate.php +++ b/includes/search/SearchUpdate.php @@ -66,7 +66,7 @@ class SearchUpdate implements DeferrableUpdate { if ( $nt ) { $this->id = $id; // is_string() check is back-compat for ApprovedRevs - if( is_string( $c ) ) { + if ( is_string( $c ) ) { $this->content = new TextContent( $c ); } else { $this->content = $c ?: false; diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 1dc4244eb8..253e6cc37d 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -646,7 +646,7 @@ class MovePageForm extends UnlistedSpecialPage { $newSubpage = Title::makeTitleSafe( $newNs, $newPageName ); if ( !$newSubpage ) { $oldLink = Linker::linkKnown( $oldSubpage ); - $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink ) + $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink ) ->params( Title::makeName( $newNs, $newPageName ) )->escaped(); continue; } diff --git a/includes/specials/SpecialRandomInCategory.php b/includes/specials/SpecialRandomInCategory.php index 2e4bf2009f..368c467e11 100644 --- a/includes/specials/SpecialRandomInCategory.php +++ b/includes/specials/SpecialRandomInCategory.php @@ -215,7 +215,7 @@ class SpecialRandomInCategory extends SpecialPage { if ( !$this->minTimestamp || !$this->maxTimestamp ) { try { list( $this->minTimestamp, $this->maxTimestamp ) = $this->getMinAndMaxForCat( $this->category ); - } catch( MWException $e ) { + } catch ( MWException $e ) { // Possibly no entries in category. return false; } diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 997574179f..d4784a5322 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -1125,11 +1125,11 @@ class LoginForm extends SpecialPage { } // Decide if we default stickHTTPS on - if ( $wgSecureLoginDefaultHTTPS - && $this->mAction != 'submitlogin' + if ( $wgSecureLoginDefaultHTTPS + && $this->mAction != 'submitlogin' && !$this->mLoginattempt && wfCanIPUseHTTPS( $this->getRequest()->getIP() ) ) - { + { $this->mStickHTTPS = true; } diff --git a/includes/upload/UploadFromChunks.php b/includes/upload/UploadFromChunks.php index 17462069bd..2e0b944415 100644 --- a/includes/upload/UploadFromChunks.php +++ b/includes/upload/UploadFromChunks.php @@ -346,7 +346,7 @@ class UploadFromChunks extends UploadFromFile { $res = $this->verifyPartialFile(); $this->mDesiredDestName = $oldDesiredDestName; $this->mTitle = false; - if( is_array( $res ) ) { + if ( is_array( $res ) ) { throw new UploadChunkVerificationException( $res[0] ); } } diff --git a/languages/data/plurals.xml b/languages/data/plurals.xml index d1a403dc9a..d5a1cfe223 100644 --- a/languages/data/plurals.xml +++ b/languages/data/plurals.xml @@ -5,7 +5,7 @@ - + n is 0 n is 1 diff --git a/maintenance/backupTextPass.inc b/maintenance/backupTextPass.inc index 7aac4d4a6a..c515c6fec9 100644 --- a/maintenance/backupTextPass.inc +++ b/maintenance/backupTextPass.inc @@ -484,7 +484,12 @@ class TextPassDumper extends BackupDumper { $revLength = strlen( $text ); if ( $wgContentHandlerUseDB ) { - $row = $this->db->selectRow( 'revision', array( 'rev_len', 'rev_content_model' ), array( 'rev_id' => $revID ), __METHOD__ ); + $row = $this->db->selectRow( + 'revision', + array( 'rev_len', 'rev_content_model' ), + array( 'rev_id' => $revID ), + __METHOD__ + ); if ( $row ) { // only check the length for the wikitext content handler, // it's a wasted (and failed) check otherwise diff --git a/maintenance/checkUsernames.php b/maintenance/checkUsernames.php index 7deca8017d..6df189fcc8 100644 --- a/maintenance/checkUsernames.php +++ b/maintenance/checkUsernames.php @@ -61,7 +61,7 @@ class CheckUsernames extends Maintenance { } } $maxUserId = $row->user_id; - } while( $res->numRows() ); + } while ( $res->numRows() ); } } diff --git a/maintenance/eraseArchivedFile.php b/maintenance/eraseArchivedFile.php index 4b06513d37..1c3f0376d6 100644 --- a/maintenance/eraseArchivedFile.php +++ b/maintenance/eraseArchivedFile.php @@ -22,7 +22,7 @@ * @author Aaron Schulz */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script to delete archived (non-current) files from storage. @@ -116,4 +116,4 @@ class EraseArchivedFile extends Maintenance { } $maintClass = "EraseArchivedFile"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/getConfiguration.php b/maintenance/getConfiguration.php index d9ed95678f..5a5eb58749 100644 --- a/maintenance/getConfiguration.php +++ b/maintenance/getConfiguration.php @@ -63,19 +63,19 @@ class GetConfiguration extends Maintenance { $format = strtolower( $this->getOption( 'format', 'PHP' ) ); $validFormat = in_array( $format, self::$outFormats ); - if( ! $validFormat ) { - $this->error("--format set to an unrecognized format", 0); + if ( ! $validFormat ) { + $this->error( "--format set to an unrecognized format", 0 ); $error_out = true; } - if( $this->getOption( 'regex' ) && $this->getOption( 'iregex' ) ) { - $this->error("Can only use either --regex or --iregex"); + if ( $this->getOption( 'regex' ) && $this->getOption( 'iregex' ) ) { + $this->error( "Can only use either --regex or --iregex" ); $error_out = true; } parent::validateParamsAndArgs(); - if( $error_out ) { + if ( $error_out ) { # Force help and quit $this->maybeHelp( true ); } @@ -88,14 +88,14 @@ class GetConfiguration extends Maintenance { parent::finalSetup(); $this->regex = $this->getOption( 'regex' ) ? : $this->getOption( 'iregex' ); - if( $this->regex ) { + if ( $this->regex ) { $this->regex = '/' . $this->regex . '/'; if ( $this->hasOption( 'iregex' ) ) { $this->regex .= 'i'; # case insensitive regex } } - if( $this->hasOption( 'settings' ) ) { + if ( $this->hasOption( 'settings' ) ) { $this->settings_list = explode( ' ', $this->getOption( 'settings' ) ); # Values validation foreach ( $this->settings_list as $name ) { @@ -115,14 +115,14 @@ class GetConfiguration extends Maintenance { $res = array(); # Sane default: dump any wg / wmg variable - if( ! $this->regex && ! $this->getOption( 'settings' ) ) { + if ( ! $this->regex && ! $this->getOption( 'settings' ) ) { $this->regex = '/^wm?g/'; } # Filter out globals based on the regex if ( $this->regex ) { $res = array(); - foreach( $GLOBALS as $name => $value ) { + foreach ( $GLOBALS as $name => $value ) { if ( preg_match( $this->regex, $name ) ) { $res[$name] = $value; } @@ -131,7 +131,7 @@ class GetConfiguration extends Maintenance { # Explicitly dumps a list of provided global names if ( $this->settings_list ) { - foreach( $this->settings_list as $name ) { + foreach ( $this->settings_list as $name ) { $res[$name] = $GLOBALS[$name]; } } @@ -157,7 +157,7 @@ class GetConfiguration extends Maintenance { throw new MWException( "Failed to serialize the requested settings." ); } - if( $out ) { + if ( $out ) { $this->output( $out . "\n" ); } } diff --git a/maintenance/mergeMessageFileList.php b/maintenance/mergeMessageFileList.php index b36a319dea..75b7ef0b49 100644 --- a/maintenance/mergeMessageFileList.php +++ b/maintenance/mergeMessageFileList.php @@ -58,7 +58,7 @@ class MergeMessageFileList extends Maintenance { # Strip comments, discard empty lines, and trim leading and trailing # whitespace. Comments start with '#' and extend to the end of the line. - foreach( $lines as $line ) { + foreach ( $lines as $line ) { $line = trim( preg_replace( '/#.*/', '', $line ) ); if ( $line !== '' ) { $mmfl['setupFiles'][] = $line; diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index 9fb1314228..b22dd88552 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -79,7 +79,7 @@ class MWDocGen extends Maintenance { $this->input = ''; $inputs = explode( ',', $this->getOption( 'file', '' ) ); - foreach( $inputs as $input ) { + foreach ( $inputs as $input ) { # Doxygen inputs are space separted and double quoted $this->input .= " \"$IP/$input\""; } diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index 52f0462a11..429edf427b 100644 --- a/maintenance/runJobs.php +++ b/maintenance/runJobs.php @@ -155,14 +155,14 @@ class RunJobs extends Maintenance { $m = array(); if ( preg_match( '!^(\d+)(k|m|g|)$!i', ini_get( 'memory_limit' ), $m ) ) { list( , $num, $unit ) = $m; - $conv = array( 'g' => 1024*1024*1024, 'm' => 1024*1024, 'k' => 1024, '' => 1 ); + $conv = array( 'g' => 1024 * 1024 * 1024, 'm' => 1024 * 1024, 'k' => 1024, '' => 1 ); $maxBytes = $num * $conv[strtolower( $unit )]; } else { $maxBytes = 0; } } $usedBytes = memory_get_usage(); - if ( $maxBytes && $usedBytes >= .95*$maxBytes ) { + if ( $maxBytes && $usedBytes >= 0.95 * $maxBytes ) { throw new MWException( "Detected excessive memory usage ($usedBytes/$maxBytes)." ); } } diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 7fc6bb895c..df1bc06f84 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -761,7 +761,7 @@ CREATE TABLE /*_*/ipblocks ( -- Start and end of an address range, in hexadecimal -- Size chosen to allow IPv6 -- FIXME: these fields were originally blank for single-IP blocks, - -- but now they are populated. No migration was ever done. They + -- but now they are populated. No migration was ever done. They -- should be fixed to be blank again for such blocks (bug 49504). ipb_range_start tinyblob NOT NULL, ipb_range_end tinyblob NOT NULL, diff --git a/skins/MonoBook.php b/skins/MonoBook.php index f905587ab9..6d66cac380 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -90,7 +90,7 @@ class MonoBookTemplate extends BaseTemplate { data['newtalk'] ) { ?>
html( 'newtalk' ) ?>
-
msg('jumpto') ?> msg('jumptonavigation') ?>msg( 'comma-separator' ) ?>msg('jumptosearch') ?>
+
msg( 'jumpto' ) ?> msg( 'jumptonavigation' ) ?>msg( 'comma-separator' ) ?>msg( 'jumptosearch' ) ?>
html( 'bodytext' ) ?> diff --git a/skins/cologneblue/screen.css b/skins/cologneblue/screen.css index c6c906315e..bc5dd316cf 100644 --- a/skins/cologneblue/screen.css +++ b/skins/cologneblue/screen.css @@ -201,8 +201,8 @@ input.mw-searchInput { #sitetitle, #sitesub, #toplinks, #linkcollection { - margin-top: 0; - margin-bottom: 0; + margin-top: 0; + margin-bottom: 0; } #sitetitle, #toplinks { @@ -220,7 +220,7 @@ input.mw-searchInput { } #sitetitle a, #toplinks a { color: white; - text-decoration: none; + text-decoration: none; } /* Bring #sitetitle to top. Otherwise #toplinks is overlaid over it, making the link unclickable. */ #sitetitle a { diff --git a/skins/common/config.js b/skins/common/config.js index 73a6dba058..540eaf9f94 100644 --- a/skins/common/config.js +++ b/skins/common/config.js @@ -25,7 +25,7 @@ .find( '.mw-help-field-data' ) .slideToggle( 'fast' ); } ); - + // Show/hide code for DB-specific options // FIXME: Do we want slow, fast, or even non-animated (instantaneous) showing/hiding here? $( '.dbRadio' ).each( function () { @@ -40,12 +40,12 @@ $wrapper.show( 'slow' ); } } ); - + // Scroll to the bottom of upgrade log $( '#config-live-log' ).children( 'textarea' ).each( function () { this.scrollTop = this.scrollHeight; } ); - + // Show/hide Creative Commons thingy $( '.licenseRadio' ).click( function () { var $wrapper = $( '#config-cc-wrapper' ); @@ -55,7 +55,7 @@ $wrapper.hide( 'slow' ); } } ); - + // Show/hide random stuff (email, upload) $( '.showHideRadio' ).click( function () { var $wrapper = $( '#' + $(this).attr( 'rel' ) ); @@ -88,7 +88,7 @@ $textbox.prop( 'readonly', true ).closest( '.config-block' ).slideUp( 'fast' ); } } ); - + // Synchronize radio button label for sitename with textbox $label = $( 'label[for=config__NamespaceType_site-name]' ); labelText = $label.text(); diff --git a/skins/common/protect.js b/skins/common/protect.js index a23c0cbd8a..8df489493d 100644 --- a/skins/common/protect.js +++ b/skins/common/protect.js @@ -19,7 +19,7 @@ window.ProtectionForm = { var box = document.getElementById( opts.tableId ); if( !box ) return false; - + var boxbody = box.getElementsByTagName('tbody')[0]; var row = document.createElement( 'tr' ); boxbody.insertBefore( row, boxbody.firstChild.nextSibling ); @@ -45,7 +45,7 @@ window.ProtectionForm = { check.checked = !this.areAllTypesMatching(); this.enableUnchainedInputs( check.checked ); } - + $( '#mwProtect-reason' ).byteLimit( 180 ); this.updateCascadeCheckbox(); diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index e7c36db0c5..366aebb444 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -260,7 +260,7 @@ class ParserTest { 'iw_wikiid' => '', 'iw_local' => 1 ), ); - if( array_key_exists( $prefix, $testInterwikis ) ) { + if ( array_key_exists( $prefix, $testInterwikis ) ) { $iwData = $testInterwikis[$prefix]; } diff --git a/tests/phpunit/MediaWikiPHPUnitCommand.php b/tests/phpunit/MediaWikiPHPUnitCommand.php index 387107ba91..042956a915 100644 --- a/tests/phpunit/MediaWikiPHPUnitCommand.php +++ b/tests/phpunit/MediaWikiPHPUnitCommand.php @@ -21,15 +21,15 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command { } } - protected function handleArguments(array $argv) { + protected function handleArguments( array $argv ) { parent::handleArguments( $argv ); if ( !isset( $this->arguments['listeners'] ) ) { $this->arguments['listeners'] = array(); } - foreach ($this->options[0] as $option) { - switch ($option[0]) { + foreach ( $this->options[0] as $option ) { + switch ( $option[0] ) { case '--debug-tests': $this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener( 'PHPUnitCommand' ); break; diff --git a/tests/phpunit/MediaWikiPHPUnitTestListener.php b/tests/phpunit/MediaWikiPHPUnitTestListener.php index 18e3fb7fa1..7237ef320f 100644 --- a/tests/phpunit/MediaWikiPHPUnitTestListener.php +++ b/tests/phpunit/MediaWikiPHPUnitTestListener.php @@ -111,4 +111,4 @@ class MediaWikiPHPUnitTestListener implements PHPUnit_Framework_TestListener { public function endTest( PHPUnit_Framework_Test $test, $time ) { wfDebugLog( $this->logChannel, 'End test ' . $this->getTestName( $test ) ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/EditPageTest.php b/tests/phpunit/includes/EditPageTest.php index 848668a5ba..76ef782d11 100644 --- a/tests/phpunit/includes/EditPageTest.php +++ b/tests/phpunit/includes/EditPageTest.php @@ -233,7 +233,7 @@ class EditPageTest extends MediaWikiLangTestCase { "", "expected registered MediaWiki: page being created even if empty" )->doDeleteArticleReal( 'EditPageTest_testCreatePage' ); - + $this->assertEdit( 'MediaWiki:Ipb-default-expiry', null, diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 57f8c19935..6a2a0df783 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -424,7 +424,7 @@ class GlobalTest extends MediaWikiTestCase { /** array( shorthand, expected integer ) */ public static function provideShorthand() { return array( - # Null, empty ... + # Null, empty ... array( '', -1 ), array( ' ', -1 ), array( null, -1 ), diff --git a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php index 3ac33a4017..32bb49dc34 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php @@ -116,7 +116,7 @@ class WfTimestampTest extends MediaWikiTestCase { */ function testTimestampParameter() { $now = wfTimestamp( TS_UNIX ); - // We check that wfTimestamp doesn't return false (error) and use a LessThan assert + // We check that wfTimestamp doesn't return false (error) and use a LessThan assert // for the cases where the test is run in a second boundary. $zero = wfTimestamp( TS_UNIX, 0 ); diff --git a/tests/phpunit/includes/HttpTest.php b/tests/phpunit/includes/HttpTest.php index 12ba22612c..d8a0f74f7c 100644 --- a/tests/phpunit/includes/HttpTest.php +++ b/tests/phpunit/includes/HttpTest.php @@ -176,7 +176,7 @@ class HttpTest extends MediaWikiTestCase { */ class MWHttpRequestTester extends MWHttpRequest { - // function derived from the MWHttpRequest factory function but + // function derived from the MWHttpRequest factory function but // returns appropriate tester class here public static function factory( $url, $options = null ) { if ( !Http::$httpEngine ) { diff --git a/tests/phpunit/includes/IPTest.php b/tests/phpunit/includes/IPTest.php index c19317972e..e18295fccf 100644 --- a/tests/phpunit/includes/IPTest.php +++ b/tests/phpunit/includes/IPTest.php @@ -273,18 +273,18 @@ class IPTest extends MediaWikiTestCase { */ public static function provideToUnsigned() { return array( - array ( 1, '0.0.0.1' ), - array ( 16909060, '1.2.3.4' ), - array ( 2130706433, '127.0.0.1' ), - array ( '2147483648', '128.0.0.0' ), - array ( '3735931646', '222.173.202.254' ), - array ( pow( 2, 32 ) - 1, '255.255.255.255' ), - array ( false, 'IN.VA.LI.D' ), - array ( 1, '::1' ), - array ( '42540766452641154071740215577757643572', '2001:0db8:85a3:0000:0000:8a2e:0370:7334' ), - array ( '42540766452641154071740215577757643572', '2001:db8:85a3::8a2e:0370:7334' ), - array ( false, 'IN:VA::LI:D' ), - array ( false, ':::1' ) + array( 1, '0.0.0.1' ), + array( 16909060, '1.2.3.4' ), + array( 2130706433, '127.0.0.1' ), + array( '2147483648', '128.0.0.0' ), + array( '3735931646', '222.173.202.254' ), + array( pow( 2, 32 ) - 1, '255.255.255.255' ), + array( false, 'IN.VA.LI.D' ), + array( 1, '::1' ), + array( '42540766452641154071740215577757643572', '2001:0db8:85a3:0000:0000:8a2e:0370:7334' ), + array( '42540766452641154071740215577757643572', '2001:db8:85a3::8a2e:0370:7334' ), + array( false, 'IN:VA::LI:D' ), + array( false, ':::1' ) ); } @@ -303,18 +303,18 @@ class IPTest extends MediaWikiTestCase { */ public static function provideToHex() { return array( - array ( '00000001', '0.0.0.1' ), - array ( '01020304', '1.2.3.4' ), - array ( '7F000001', '127.0.0.1' ), - array ( '80000000', '128.0.0.0' ), - array ( 'DEADCAFE', '222.173.202.254' ), - array ( 'FFFFFFFF', '255.255.255.255' ), - array ( false, 'IN.VA.LI.D' ), - array ( 'v6-00000000000000000000000000000001', '::1' ), - array ( 'v6-20010DB885A3000000008A2E03707334', '2001:0db8:85a3:0000:0000:8a2e:0370:7334' ), - array ( 'v6-20010DB885A3000000008A2E03707334', '2001:db8:85a3::8a2e:0370:7334' ), - array ( false, 'IN:VA::LI:D' ), - array ( false, ':::1' ) + array( '00000001', '0.0.0.1' ), + array( '01020304', '1.2.3.4' ), + array( '7F000001', '127.0.0.1' ), + array( '80000000', '128.0.0.0' ), + array( 'DEADCAFE', '222.173.202.254' ), + array( 'FFFFFFFF', '255.255.255.255' ), + array( false, 'IN.VA.LI.D' ), + array( 'v6-00000000000000000000000000000001', '::1' ), + array( 'v6-20010DB885A3000000008A2E03707334', '2001:0db8:85a3:0000:0000:8a2e:0370:7334' ), + array( 'v6-20010DB885A3000000008A2E03707334', '2001:db8:85a3::8a2e:0370:7334' ), + array( false, 'IN:VA::LI:D' ), + array( false, ':::1' ) ); } diff --git a/tests/phpunit/includes/XmlTypeCheckTest.php b/tests/phpunit/includes/XmlTypeCheckTest.php index 18f363fa7c..6a9b44fc24 100644 --- a/tests/phpunit/includes/XmlTypeCheckTest.php +++ b/tests/phpunit/includes/XmlTypeCheckTest.php @@ -27,4 +27,4 @@ class XmlTypeCheckTest extends MediaWikiTestCase { $this->assertFalse( $testXML->wellFormed ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php index d7c8e2184f..e680af628d 100644 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ b/tests/phpunit/includes/api/ApiEditPageTest.php @@ -219,7 +219,7 @@ class ApiEditPageTest extends ApiTestCase { $this->assertEquals( 'Success', $re['edit']['result'] ); // Check the page text is correct $text = WikiPage::factory( Title::newFromText( $name ) )->getContent( Revision::RAW )->getNativeData(); - $this->assertEquals( $text, "== header ==\n\ntest"); + $this->assertEquals( $text, "== header ==\n\ntest" ); // Now on one that does $this->assertTrue( Title::newFromText( $name )->exists() ); @@ -233,7 +233,7 @@ class ApiEditPageTest extends ApiTestCase { $this->assertEquals( 'Success', $re2['edit']['result'] ); $text = WikiPage::factory( Title::newFromText( $name ) )->getContent( Revision::RAW )->getNativeData(); - $this->assertEquals( $text, "== header ==\n\ntest\n\n== header ==\n\ntest"); + $this->assertEquals( $text, "== header ==\n\ntest\n\n== header ==\n\ntest" ); } function testUndo() { diff --git a/tests/phpunit/includes/api/ApiTest.php b/tests/phpunit/includes/api/ApiTest.php index 21c6247eb0..5106be5634 100644 --- a/tests/phpunit/includes/api/ApiTest.php +++ b/tests/phpunit/includes/api/ApiTest.php @@ -251,7 +251,7 @@ class ApiTest extends ApiTestCase { } if ( isset( $rights['protect'] ) ) { - $this->assertArrayHasKey( 'protecttoken', $tokens ); + $this->assertArrayHasKey( 'protecttoken', $tokens ); } return $tokens; diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php index 374eded7ea..94ef9c6868 100644 --- a/tests/phpunit/includes/api/ApiTestCase.php +++ b/tests/phpunit/includes/api/ApiTestCase.php @@ -140,7 +140,7 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { } protected function doLogin( $user = 'sysop' ) { - if( !array_key_exists( $user, self::$users ) ){ + if ( !array_key_exists( $user, self::$users ) ) { throw new MWException( "Can not log in to undefined user $user" ); } @@ -170,7 +170,7 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { 'type' => 'edit|delete|protect|move|block|unblock|watch' ), $session, false, $user->user ); - if( !array_key_exists( 'tokens', $data[0] ) ){ + if ( !array_key_exists( 'tokens', $data[0] ) ) { throw new MWException( 'Api failed to return a token list' ); } diff --git a/tests/phpunit/includes/api/ApiUploadTest.php b/tests/phpunit/includes/api/ApiUploadTest.php index 2548273f91..94f193e973 100644 --- a/tests/phpunit/includes/api/ApiUploadTest.php +++ b/tests/phpunit/includes/api/ApiUploadTest.php @@ -450,7 +450,7 @@ class ApiUploadTest extends ApiTestCaseUpload { $this->deleteFileByFileName( $fileName ); $this->deleteFileByContent( $filePath ); - // Base upload params: + // Base upload params: $params = array( 'action' => 'upload', 'stash' => 1, @@ -462,7 +462,7 @@ class ApiUploadTest extends ApiTestCaseUpload { // Upload chunks $chunkSessionKey = false; $resultOffset = 0; - // Open the file: + // Open the file: $handle = @fopen( $filePath, "r" ); if ( $handle === false ) { $this->markTestIncomplete( "could not open file: $filePath" ); @@ -483,10 +483,10 @@ class ApiUploadTest extends ApiTestCaseUpload { } catch ( UsageException $e ) { $this->markTestIncomplete( $e->getMessage() ); } - // Make sure we got a valid chunk continue: + // Make sure we got a valid chunk continue: $this->assertTrue( isset( $result['upload'] ) ); $this->assertTrue( isset( $result['upload']['filekey'] ) ); - // If we don't get a session key mark test incomplete. + // If we don't get a session key mark test incomplete. if ( !isset( $result['upload']['filekey'] ) ) { $this->markTestIncomplete( "no filekey provided" ); } @@ -510,11 +510,11 @@ class ApiUploadTest extends ApiTestCaseUpload { } catch ( UsageException $e ) { $this->markTestIncomplete( $e->getMessage() ); } - // Make sure we got a valid chunk continue: + // Make sure we got a valid chunk continue: $this->assertTrue( isset( $result['upload'] ) ); $this->assertTrue( isset( $result['upload']['filekey'] ) ); - // Check if we were on the last chunk: + // Check if we were on the last chunk: if ( $params['offset'] + $chunkSize >= $fileSize ) { $this->assertEquals( 'Success', $result['upload']['result'] ); break; @@ -555,7 +555,7 @@ class ApiUploadTest extends ApiTestCaseUpload { // clean up $this->deleteFileByFilename( $fileName ); - // don't remove downloaded temporary file for fast subquent tests. + // don't remove downloaded temporary file for fast subquent tests. //unlink( $filePath ); } } diff --git a/tests/phpunit/includes/installer/InstallDocFormatterTest.php b/tests/phpunit/includes/installer/InstallDocFormatterTest.php index 2642541eb6..342f7d5a5e 100644 --- a/tests/phpunit/includes/installer/InstallDocFormatterTest.php +++ b/tests/phpunit/includes/installer/InstallDocFormatterTest.php @@ -1,5 +1,5 @@