From bfb75bc8e2820beedbbc6fca7b5e9af42b5292de Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 27 Apr 2013 13:23:52 +0200 Subject: [PATCH] Fixed spacing around parenthesis in languages/tests/maintenance Change-Id: Idd4299d17f1fcf98ab1d635484cb4e880f35ee24 --- languages/LanguageConverter.php | 4 ++-- languages/utils/CLDRPluralRuleEvaluator.php | 4 ++-- maintenance/Maintenance.php | 6 +++--- maintenance/cleanupUploadStash.php | 4 ++-- maintenance/convertLinks.php | 4 ++-- maintenance/createAndPromote.php | 2 +- maintenance/dumpBackup.php | 4 ++-- maintenance/dumpIterator.php | 6 +++--- maintenance/fetchText.php | 4 ++-- maintenance/fileOpPerfTest.php | 12 ++++++------ maintenance/generateSitemap.php | 4 ++-- maintenance/install.php | 2 +- maintenance/jsparse.php | 8 ++++---- maintenance/language/transstat.php | 2 +- maintenance/mwdoc-filter.php | 2 +- maintenance/oracle/alterSharedConstraints.php | 10 +++++----- maintenance/parse.php | 2 +- maintenance/proxyCheck.php | 10 +++++----- maintenance/rebuildrecentchanges.php | 2 +- maintenance/refreshImageMetadata.php | 6 +++--- maintenance/renderDump.php | 4 ++-- maintenance/sql.php | 2 +- maintenance/storage/checkStorage.php | 2 +- maintenance/storage/compressOld.php | 10 +++++----- maintenance/updateSpecialPages.php | 2 +- tests/RunSeleniumTests.php | 4 ++-- tests/parser/ParserTestResult.php | 2 +- tests/parserTests.php | 2 +- 28 files changed, 63 insertions(+), 63 deletions(-) diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 512736b594..d9227d7916 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -258,7 +258,7 @@ class LanguageConverter { // Get language variant preference from logged in users // Don't call this on stub objects because that causes infinite // recursion during initialisation - if ( $wgUser->isLoggedIn() ) { + if ( $wgUser->isLoggedIn() ) { $ret = $wgUser->getOption( 'variant' ); } else { // figure out user lang without constructing wgLang to avoid @@ -833,7 +833,7 @@ class LanguageConverter { * @author Nikola Smolenski * @since 1.19 */ - public function guessVariant($text, $variant) { + public function guessVariant( $text, $variant ) { return false; } diff --git a/languages/utils/CLDRPluralRuleEvaluator.php b/languages/utils/CLDRPluralRuleEvaluator.php index 1910aafa55..43e8aaf7d3 100644 --- a/languages/utils/CLDRPluralRuleEvaluator.php +++ b/languages/utils/CLDRPluralRuleEvaluator.php @@ -67,7 +67,7 @@ class CLDRPluralRuleEvaluator { public static function evaluateCompiled( $number, array $rules ) { // The compiled form is RPN, with tokens strictly delimited by // spaces, so this is a simple RPN evaluator. - foreach ( $rules as $i => $rule ) { + foreach ( $rules as $i => $rule ) { $stack = array(); $zero = ord( '0' ); $nine = ord( '9' ); @@ -104,7 +104,7 @@ class CLDRPluralRuleEvaluator { */ private static function doOperation( $token, $left, $right ) { if ( in_array( $token, array( 'in', 'not-in', 'within', 'not-within' ) ) ) { - if ( !($right instanceof CLDRPluralRuleEvaluator_Range ) ) { + if ( !( $right instanceof CLDRPluralRuleEvaluator_Range ) ) { $right = new CLDRPluralRuleEvaluator_Range( $right ); } } diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index d68b83173b..2162869062 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -766,7 +766,7 @@ abstract class Maintenance { $this->output( "\n" ); $scriptDependantParams = $this->mDependantParameters; - if ( count($scriptDependantParams) > 0 ) { + if ( count( $scriptDependantParams ) > 0 ) { $this->output( "Script dependant parameters:\n" ); // Parameters description foreach ( $scriptDependantParams as $par => $info ) { @@ -791,7 +791,7 @@ abstract class Maintenance { $this->mGenericParameters, $this->mDependantParameters ); - if ( count($scriptSpecificParams) > 0 ) { + if ( count( $scriptSpecificParams ) > 0 ) { $this->output( "Script specific parameters:\n" ); // Parameters description foreach ( $scriptSpecificParams as $par => $info ) { @@ -1077,7 +1077,7 @@ abstract class Maintenance { * @param &$db DatabaseBase object */ private function unlockSearchindex( &$db ) { - $db->unlockTables( __CLASS__ . '::' . __METHOD__ ); + $db->unlockTables( __CLASS__ . '::' . __METHOD__ ); } /** diff --git a/maintenance/cleanupUploadStash.php b/maintenance/cleanupUploadStash.php index 97dee97b63..4379b221f7 100644 --- a/maintenance/cleanupUploadStash.php +++ b/maintenance/cleanupUploadStash.php @@ -82,9 +82,9 @@ class UploadStashCleanup extends Maintenance { $stash->getFile( $key, true ); $stash->removeFileNoAuth( $key ); } catch ( UploadStashBadPathException $ex ) { - $this->output( "Failed removing stashed upload with key: $key\n" ); + $this->output( "Failed removing stashed upload with key: $key\n" ); } catch ( UploadStashZeroLengthFileException $ex ) { - $this->output( "Failed removing stashed upload with key: $key\n" ); + $this->output( "Failed removing stashed upload with key: $key\n" ); } if ( $i % 100 == 0 ) { $this->output( "$i\n" ); diff --git a/maintenance/convertLinks.php b/maintenance/convertLinks.php index 7404b5abcb..4e0d0b028c 100644 --- a/maintenance/convertLinks.php +++ b/maintenance/convertLinks.php @@ -80,7 +80,7 @@ This gives a huge speed improvement for very large links tables which are MyISAM # -------------------------------------------------------------------- - list ( $cur, $links, $links_temp, $links_backup ) = $dbw->tableNamesN( 'cur', 'links', 'links_temp', 'links_backup' ); + list( $cur, $links, $links_temp, $links_backup ) = $dbw->tableNamesN( 'cur', 'links', 'links_temp', 'links_backup' ); if ( $dbw->tableExists( 'pagelinks' ) ) { $this->output( "...have pagelinks; skipping old links table updates\n" ); @@ -177,7 +177,7 @@ This gives a huge speed improvement for very large links tables which are MyISAM } $dbw->freeResult( $res ); # $this->output( "rowOffset: $rowOffset\ttuplesAdded: $tuplesAdded\tnumBadLinks: $numBadLinks\n" ); - if ( $tuplesAdded != 0 ) { + if ( $tuplesAdded != 0 ) { if ( $reportLinksConvProgress ) { $this->output( "Inserting $tuplesAdded tuples into $links_temp..." ); } diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php index 94a18767e6..5681d41a05 100644 --- a/maintenance/createAndPromote.php +++ b/maintenance/createAndPromote.php @@ -42,7 +42,7 @@ class CreateAndPromote extends Maintenance { $this->addOption( $role, "Add the account to the {$role} group" ); } $this->addArg( "username", "Username of new user" ); - $this->addArg( "password", "Password to set (not required if --force is used)", false); + $this->addArg( "password", "Password to set (not required if --force is used)", false ); } public function execute() { diff --git a/maintenance/dumpBackup.php b/maintenance/dumpBackup.php index 8c35023a03..bd7e464944 100644 --- a/maintenance/dumpBackup.php +++ b/maintenance/dumpBackup.php @@ -45,7 +45,7 @@ if ( isset( $options['pagelist'] ) ) { chdir( $olddir ); if ( $pages === false ) { echo( "Unable to open file {$options['pagelist']}\n" ); - die(1); + die( 1 ); } $pages = array_map( 'trim', $pages ); $dumper->pages = array_filter( $pages, create_function( '$x', 'return $x !== "";' ) ); @@ -79,7 +79,7 @@ if ( isset( $options['full'] ) ) { $dumper->dump( WikiExporter::STABLE, $textMode ); } elseif ( isset( $options['logs'] ) ) { $dumper->dump( WikiExporter::LOGS ); -} elseif ( isset($options['revrange'] ) ) { +} elseif ( isset( $options['revrange'] ) ) { $dumper->dump( WikiExporter::RANGE, $textMode ); } else { $dumper->progress( <<conclusions(); $delta = microtime( true ) - $this->startTime; - $this->error( "Done {$this->count} revisions in " . round($delta, 2) . " seconds " ); + $this->error( "Done {$this->count} revisions in " . round( $delta, 2 ) . " seconds " ); if ( $delta > 0 ) { - $this->error( round($this->count / $delta, 2) . " pages/sec" ); + $this->error( round( $this->count / $delta, 2 ) . " pages/sec" ); } # Perform the memory_get_peak_usage() when all the other data has been output so there's no damage if it dies. @@ -126,7 +126,7 @@ abstract class DumpIterator extends Maintenance { if ( $this->from != $title ) { return; } - $this->output( "Skipped " . ($this->count - 1) . " pages\n" ); + $this->output( "Skipped " . ( $this->count - 1 ) . " pages\n" ); $this->count = 1; $this->from = null; diff --git a/maintenance/fetchText.php b/maintenance/fetchText.php index f166c432f5..8c46d69682 100644 --- a/maintenance/fetchText.php +++ b/maintenance/fetchText.php @@ -56,12 +56,12 @@ class FetchText extends Maintenance { } $textId = intval( $line ); $text = $this->doGetText( $db, $textId ); - if ($text === false) { + if ( $text === false ) { # actual error, not zero-length text $textLen = "-1"; } else { - $textLen = strlen($text); + $textLen = strlen( $text ); } $this->output( $textId . "\n" . $textLen . "\n" . $text ); } diff --git a/maintenance/fileOpPerfTest.php b/maintenance/fileOpPerfTest.php index 008d7686fb..4be9f212d0 100644 --- a/maintenance/fileOpPerfTest.php +++ b/maintenance/fileOpPerfTest.php @@ -79,7 +79,7 @@ class TestFileOpPerformance extends Maintenance { $this->output( "Using '$dirname/$file' in operations.\n" ); $dst = $baseDir . '/' . wfBaseName( $file ); $ops1[] = array( 'op' => 'store', - 'src' => "$dirname/$file", 'dst' => $dst, 'overwrite' => 1); + 'src' => "$dirname/$file", 'dst' => $dst, 'overwrite' => 1 ); $ops2[] = array( 'op' => 'copy', 'src' => "$dst", 'dst' => "$dst-1", 'overwrite' => 1 ); $ops3[] = array( 'op' => 'move', @@ -106,7 +106,7 @@ class TestFileOpPerformance extends Maintenance { $e = ( microtime( true ) - $start ) * 1000; if ( $status->getErrorsArray() ) { print_r( $status->getErrorsArray() ); - exit(0); + exit( 0 ); } $this->output( $backend->getName() . ": Stored " . count( $ops1 ) . " files in $e ms.\n" ); @@ -115,7 +115,7 @@ class TestFileOpPerformance extends Maintenance { $e = ( microtime( true ) - $start ) * 1000; if ( $status->getErrorsArray() ) { print_r( $status->getErrorsArray() ); - exit(0); + exit( 0 ); } $this->output( $backend->getName() . ": Copied " . count( $ops2 ) . " files in $e ms.\n" ); @@ -124,7 +124,7 @@ class TestFileOpPerformance extends Maintenance { $e = ( microtime( true ) - $start ) * 1000; if ( $status->getErrorsArray() ) { print_r( $status->getErrorsArray() ); - exit(0); + exit( 0 ); } $this->output( $backend->getName() . ": Moved " . count( $ops3 ) . " files in $e ms.\n" ); @@ -133,7 +133,7 @@ class TestFileOpPerformance extends Maintenance { $e = ( microtime( true ) - $start ) * 1000; if ( $status->getErrorsArray() ) { print_r( $status->getErrorsArray() ); - exit(0); + exit( 0 ); } $this->output( $backend->getName() . ": Deleted " . count( $ops4 ) . " files in $e ms.\n" ); @@ -142,7 +142,7 @@ class TestFileOpPerformance extends Maintenance { $e = ( microtime( true ) - $start ) * 1000; if ( $status->getErrorsArray() ) { print_r( $status->getErrorsArray() ); - exit(0); + exit( 0 ); } $this->output( $backend->getName() . ": Deleted " . count( $ops5 ) . " files in $e ms.\n" ); } diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index 44867d0bcb..b356d18692 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -320,7 +320,7 @@ class GenerateSitemap extends Maintenance { $this->output( "$namespace ($fns)\n" ); $skippedRedirects = 0; // Number of redirects skipped for that namespace foreach ( $res as $row ) { - if ($this->skipRedirects && $row->page_is_redirect ) { + if ( $this->skipRedirects && $row->page_is_redirect ) { $skippedRedirects++; continue; } @@ -357,7 +357,7 @@ class GenerateSitemap extends Maintenance { } } - if ($this->skipRedirects && $skippedRedirects > 0) { + if ( $this->skipRedirects && $skippedRedirects > 0 ) { $this->output( " skipped $skippedRedirects redirect(s)\n" ); } diff --git a/maintenance/install.php b/maintenance/install.php index 56f9259050..0b1ab5a9e8 100644 --- a/maintenance/install.php +++ b/maintenance/install.php @@ -41,7 +41,7 @@ class CommandLineInstaller extends Maintenance { parent::__construct(); global $IP; - $this->addArg( 'name', 'The name of the wiki', true); + $this->addArg( 'name', 'The name of the wiki', true ); $this->addArg( 'admin', 'The username of the wiki administrator (WikiSysop)', true ); $this->addOption( 'pass', 'The password for the wiki administrator.', false, true ); diff --git a/maintenance/jsparse.php b/maintenance/jsparse.php index 1a2e121c0d..caffce9708 100644 --- a/maintenance/jsparse.php +++ b/maintenance/jsparse.php @@ -50,7 +50,7 @@ class JSParseHelper extends Maintenance { wfSuppressWarnings(); $js = file_get_contents( $filename ); wfRestoreWarnings(); - if ($js === false) { + if ( $js === false ) { $this->output( "$filename ERROR: could not read file\n" ); $this->errs++; continue; @@ -58,7 +58,7 @@ class JSParseHelper extends Maintenance { try { $parser->parse( $js, $filename, 1 ); - } catch (Exception $e) { + } catch ( Exception $e ) { $this->errs++; $this->output( "$filename ERROR: " . $e->getMessage() . "\n" ); continue; @@ -67,8 +67,8 @@ class JSParseHelper extends Maintenance { $this->output( "$filename OK\n" ); } - if ($this->errs > 0) { - exit(1); + if ( $this->errs > 0 ) { + exit( 1 ); } } } diff --git a/maintenance/language/transstat.php b/maintenance/language/transstat.php index ba503224d0..4eab6660a5 100644 --- a/maintenance/language/transstat.php +++ b/maintenance/language/transstat.php @@ -96,7 +96,7 @@ $wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] ); foreach ( $wgLanguages->getLanguages() as $code ) { # Don't check English, RTL English or dummy language codes - if ( $code == 'en' || $code == 'enRTL' || (is_array( $wgDummyLanguageCodes ) && + if ( $code == 'en' || $code == 'enRTL' || ( is_array( $wgDummyLanguageCodes ) && isset( $wgDummyLanguageCodes[$code] ) ) ) { continue; } diff --git a/maintenance/mwdoc-filter.php b/maintenance/mwdoc-filter.php index 6eeb48d38c..c80981b56d 100644 --- a/maintenance/mwdoc-filter.php +++ b/maintenance/mwdoc-filter.php @@ -18,6 +18,6 @@ if ( PHP_SAPI != 'cli' ) { $source = file_get_contents( $argv[1] ); $regexp = '#\@var\s+([^\s]+)([^/]+)/\s+(var|public|protected|private)\s+(\$[^\s;=]+)#'; $replac = '${2} */ ${3} ${1} ${4}'; -$source = preg_replace($regexp, $replac, $source); +$source = preg_replace( $regexp, $replac, $source ); echo $source; diff --git a/maintenance/oracle/alterSharedConstraints.php b/maintenance/oracle/alterSharedConstraints.php index 47f5ff7af0..8f16597a68 100644 --- a/maintenance/oracle/alterSharedConstraints.php +++ b/maintenance/oracle/alterSharedConstraints.php @@ -49,7 +49,7 @@ class AlterSharedConstraints extends Maintenance { $dbw = wfGetDB( DB_MASTER ); foreach ( $wgSharedTables as $table ) { - $stable = $dbw->tableNameInternal($table); + $stable = $dbw->tableNameInternal( $table ); if ( $wgSharedPrefix != null ) { $ltable = preg_replace( "/^$wgSharedPrefix(.*)/i", "$wgDBprefix\\1", $stable ); } else { @@ -62,14 +62,14 @@ class AlterSharedConstraints extends Maintenance { AND ucc.constraint_name = uc.constraint_name AND uccpk.constraint_name = uc.r_constraint_name AND uccpk.table_name = '$ltable'" ); - while (($row = $result->fetchRow()) !== false) { + while ( ( $row = $result->fetchRow() ) !== false ) { - $this->output( "Altering {$row['constraint_name']} ..."); + $this->output( "Altering {$row['constraint_name']} ..." ); try { $dbw->query( "ALTER TABLE {$row['table_name']} DROP CONSTRAINT {$wgDBprefix}{$row['constraint_name']}" ); - } catch (DBQueryError $exdb) { - if ($exdb->errno != 2443) { + } catch ( DBQueryError $exdb ) { + if ( $exdb->errno != 2443 ) { throw $exdb; } } diff --git a/maintenance/parse.php b/maintenance/parse.php index 14976c99a6..d017c0e098 100644 --- a/maintenance/parse.php +++ b/maintenance/parse.php @@ -90,7 +90,7 @@ class CLIParser extends Maintenance { if ( $input_file === $php_stdin ) { $ctrl = wfIsWindows() ? 'CTRL+Z' : 'CTRL+D'; - $this->error( basename(__FILE__) . ": warning: reading wikitext from STDIN. Press $ctrl to parse.\n" ); + $this->error( basename( __FILE__ ) . ": warning: reading wikitext from STDIN. Press $ctrl to parse.\n" ); } return file_get_contents( $input_file ); diff --git a/maintenance/proxyCheck.php b/maintenance/proxyCheck.php index c408dcb3ed..b52f20fb50 100644 --- a/maintenance/proxyCheck.php +++ b/maintenance/proxyCheck.php @@ -46,8 +46,8 @@ if ( ( isset( $_REQUEST ) && array_key_exists( 'argv', $_REQUEST ) ) || count( $ $output = "Connecting to $ip:$port, target $url, this hostname $host\n"; # Open socket - $sock = @fsockopen($ip, $port, $errno, $errstr, 5); - if ($errno == 0 ) { + $sock = @fsockopen( $ip, $port, $errno, $errstr, 5 ); + if ( $errno == 0 ) { $output .= "Connected\n"; # Send payload $request = "GET $url HTTP/1.0\r\n"; @@ -56,10 +56,10 @@ if ( ( isset( $_REQUEST ) && array_key_exists( 'argv', $_REQUEST ) ) || count( $ # $request .= "Host: ".$url."\r\n"; # $request .= "User-Agent: MediaWiki open proxy check\r\n"; $request .= "\r\n"; - @fputs($sock, $request); - $response = fgets($sock, 65536); + @fputs( $sock, $request ); + $response = fgets( $sock, 65536 ); $output .= $response; - @fclose($sock); + @fclose( $sock ); } else { $output .= "No connection\n"; } diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php index 6609531060..9ca6ab6281 100644 --- a/maintenance/rebuildrecentchanges.php +++ b/maintenance/rebuildrecentchanges.php @@ -99,7 +99,7 @@ class RebuildRecentchanges extends Maintenance { */ private function rebuildRecentChangesTablePass2() { $dbw = wfGetDB( DB_MASTER ); - list ( $recentchanges, $revision ) = $dbw->tableNamesN( 'recentchanges', 'revision' ); + list( $recentchanges, $revision ) = $dbw->tableNamesN( 'recentchanges', 'revision' ); $this->output( "Updating links and size differences...\n" ); diff --git a/maintenance/refreshImageMetadata.php b/maintenance/refreshImageMetadata.php index a53548dde3..a1e7b18079 100644 --- a/maintenance/refreshImageMetadata.php +++ b/maintenance/refreshImageMetadata.php @@ -99,7 +99,7 @@ class RefreshImageMetadata extends Maintenance { if ( $res->numRows() > 0 ) { $row1 = $res->current(); - $this->output( "Processing next {$this->mBatchSize} rows starting with {$row1->img_name}.\n"); + $this->output( "Processing next {$this->mBatchSize} rows starting with {$row1->img_name}.\n" ); $res->rewind(); } else { $this->error( "No images to process.", 4 ); @@ -123,7 +123,7 @@ class RefreshImageMetadata extends Maintenance { $this->output( "Warning: File:{$row->img_name} used to have " . "$oldLength bytes of metadata but now has $newLength bytes.\n" ); } elseif ( $verbose ) { - $this->output("Refreshed File:{$row->img_name}.\n" ); + $this->output( "Refreshed File:{$row->img_name}.\n" ); } } else { $leftAlone++; @@ -138,7 +138,7 @@ class RefreshImageMetadata extends Maintenance { } if ( $verbose ) { - $this->output("Forcibly refreshed File:{$row->img_name}.\n" ); + $this->output( "Forcibly refreshed File:{$row->img_name}.\n" ); } } else { diff --git a/maintenance/renderDump.php b/maintenance/renderDump.php index 3938915c7b..2039a21603 100644 --- a/maintenance/renderDump.php +++ b/maintenance/renderDump.php @@ -69,9 +69,9 @@ class DumpRenderer extends Maintenance { $importer->doImport(); $delta = microtime( true ) - $this->startTime; - $this->error( "Rendered {$this->count} pages in " . round($delta, 2) . " seconds " ); + $this->error( "Rendered {$this->count} pages in " . round( $delta, 2 ) . " seconds " ); if ( $delta > 0 ) { - $this->error( round($this->count / $delta, 2) . " pages/sec" ); + $this->error( round( $this->count / $delta, 2 ) . " pages/sec" ); } $this->error( "\n" ); } diff --git a/maintenance/sql.php b/maintenance/sql.php index b10a37933b..66de5b19ec 100644 --- a/maintenance/sql.php +++ b/maintenance/sql.php @@ -91,7 +91,7 @@ class MwSql extends Maintenance { readline_add_history( $wholeLine . $dbw->getDelimiter() ); readline_write_history( $historyFile ); } - try{ + try { $res = $dbw->query( $wholeLine ); $this->sqlPrintResult( $res, $dbw ); $prompt = $newPrompt; diff --git a/maintenance/storage/checkStorage.php b/maintenance/storage/checkStorage.php index 505313d570..632e04a6d5 100644 --- a/maintenance/storage/checkStorage.php +++ b/maintenance/storage/checkStorage.php @@ -462,7 +462,7 @@ class CheckStorage { return; } - if ( !$id ) { + if ( !$id ) { // No ID, can't import echo "No id tag in revision, can't import\n"; return; diff --git a/maintenance/storage/compressOld.php b/maintenance/storage/compressOld.php index b766fe9cde..a3a2a4c9e0 100644 --- a/maintenance/storage/compressOld.php +++ b/maintenance/storage/compressOld.php @@ -223,7 +223,7 @@ class CompressOld extends Maintenance { } $conds[] = "rev_timestamp>'" . $beginDate . "'"; } - if ( $endDate ) { + if ( $endDate ) { if ( !preg_match( '/^\d{14}$/', $endDate ) ) { $this->error( "Invalid end date \"$endDate\"\n" ); return false; @@ -282,7 +282,7 @@ class CompressOld extends Maintenance { $revs[] = $revRow; } - if ( count( $revs ) < 2) { + if ( count( $revs ) < 2 ) { # No revisions matching, no further processing $this->output( "\n" ); continue; @@ -351,12 +351,12 @@ class CompressOld extends Maintenance { if ( $extdb != "" ) { # Move blob objects to External Storage $stored = $storeObj->store( $extdb, serialize( $chunk )); - if ($stored === false) { + if ( $stored === false ) { $this->error( "Unable to store object" ); return false; } # Store External Storage URLs instead of Stub placeholders - foreach ($stubs as $stub) { + foreach ( $stubs as $stub ) { if ( $stub === false ) { continue; } @@ -388,7 +388,7 @@ class CompressOld extends Maintenance { if ( $stubs[$j] !== false && $revs[$i + $j]->rev_text_id != $primaryOldid ) { $dbw->update( 'text', array( /* SET */ - 'old_text' => serialize($stubs[$j]), + 'old_text' => serialize( $stubs[$j] ), 'old_flags' => 'object,utf-8', ), array( /* WHERE */ 'old_id' => $revs[$i + $j]->rev_text_id diff --git a/maintenance/updateSpecialPages.php b/maintenance/updateSpecialPages.php index 9c21bb53c5..90a0cd0588 100644 --- a/maintenance/updateSpecialPages.php +++ b/maintenance/updateSpecialPages.php @@ -124,7 +124,7 @@ class UpdateSpecialPages extends Maintenance { $this->output( sprintf( "%.2fs\n", $seconds ) ); } # Reopen any connections that have closed - if ( !wfGetLB()->pingAll() ) { + if ( !wfGetLB()->pingAll() ) { $this->output( "\n" ); do { $this->error( "Connection failed, reconnecting in 10 seconds..." ); diff --git a/tests/RunSeleniumTests.php b/tests/RunSeleniumTests.php index 964b7d67ed..976831e526 100644 --- a/tests/RunSeleniumTests.php +++ b/tests/RunSeleniumTests.php @@ -85,7 +85,7 @@ class SeleniumTester extends Maintenance { protected function startServer() { if ( $this->seleniumServerExecPath == '' ) { - die ( "The selenium server exec path is not set in " . + die( "The selenium server exec path is not set in " . "selenium_settings.ini. Cannot start server \n" . "as requested - terminating RunSeleniumTests\n" ); } @@ -96,7 +96,7 @@ class SeleniumTester extends Maintenance { case 'started': break; case 'failed': - die ( "Unable to start the Selenium Server - " . + die( "Unable to start the Selenium Server - " . "terminating RunSeleniumTests\n" ); case 'running': echo ( "Warning: The Selenium Server is " . diff --git a/tests/parser/ParserTestResult.php b/tests/parser/ParserTestResult.php index e846da5431..d9ad773d94 100644 --- a/tests/parser/ParserTestResult.php +++ b/tests/parser/ParserTestResult.php @@ -37,6 +37,6 @@ class ParserTestResult { /** Whether the test passed */ public function isSuccess() { - return ($this->expected === $this->actual); + return $this->expected === $this->actual; } } diff --git a/tests/parserTests.php b/tests/parserTests.php index 804a30cb3d..2e5cd53d00 100644 --- a/tests/parserTests.php +++ b/tests/parserTests.php @@ -90,5 +90,5 @@ if ( isset( $options['fuzz'] ) ) { $tester->fuzzTest( $files ); } else { $ok = $tester->runTestsFromFiles( $files ); - exit ( $ok ? 0 : 1 ); + exit( $ok ? 0 : 1 ); } -- 2.20.1