jenkins-bot has submitted this change and it was merged.
Change subject: Fixed spacing
......................................................................
Fixed spacing
- Place commas correct
- Moved comments
- Add space after if/foreach/catch
- Reformat some conditions
- Removed trailing spaces/tabs
Change-Id: I40ccda72c418c4a33fcd675773cb08d971510cdb
---
M includes/Cookie.php
M includes/Exception.php
M includes/Export.php
M includes/GitInfo.php
M includes/HTMLForm.php
M includes/Html.php
M includes/HttpFunctions.php
M includes/LinkFilter.php
M includes/Linker.php
M includes/Revision.php
M includes/User.php
M includes/Xml.php
M includes/cache/LocalisationCache.php
M includes/db/Database.php
M includes/media/FormatMetadata.php
M includes/media/XCF.php
M includes/parser/Parser.php
M includes/specials/SpecialExpandTemplates.php
M includes/templates/NoLocalSettings.php
M languages/LanguageConverter.php
M languages/classes/LanguageDsb.php
M languages/classes/LanguageHsb.php
M maintenance/backupTextPass.inc
M maintenance/cdb.php
M maintenance/parse.php
M maintenance/userDupes.inc
M tests/phpunit/data/xmp/gps.result.php
M tests/phpunit/includes/LinkFilterTest.php
M tests/phpunit/includes/PreferencesTest.php
M tests/phpunit/includes/StatusTest.php
M tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php
M tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
M tests/phpunit/includes/specials/SpecialSearchTest.php
33 files changed, 169 insertions(+), 162 deletions(-)
Approvals:
Parent5446: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Cookie.php b/includes/Cookie.php
index ecf4667..e0a11a2 100644
--- a/includes/Cookie.php
+++ b/includes/Cookie.php
@@ -131,8 +131,14 @@
}
if ( substr( $domain, 0, 1 ) == '.'
- && substr_compare( $originDomain, $domain,
-strlen( $domain ),
- strlen(
$domain ), true ) != 0 ) {
+ && substr_compare(
+ $originDomain,
+ $domain,
+ -strlen( $domain ),
+ strlen( $domain ),
+ true
+ ) != 0
+ ) {
return false;
}
}
@@ -167,8 +173,15 @@
if ( $domain == $this->domain
|| ( strlen( $domain ) > strlen( $this->domain )
&& substr( $this->domain, 0, 1 ) == '.'
- && substr_compare( $domain, $this->domain,
-strlen( $this->domain ),
- strlen(
$this->domain ), true ) == 0 ) ) {
+ && substr_compare(
+ $domain,
+ $this->domain,
+ -strlen( $this->domain ),
+ strlen( $this->domain ),
+ true
+ ) == 0
+ )
+ ) {
return true;
}
diff --git a/includes/Exception.php b/includes/Exception.php
index 008be15..4548345 100644
--- a/includes/Exception.php
+++ b/includes/Exception.php
@@ -619,9 +619,9 @@
if ( $wgShowExceptionDetails ) {
$message .= 'Original exception: ' .
self::getLogMessage( $e ) .
- "\nBacktrace:\n" .
self::getRedactedTraceAsString( $e ) .
- "\n\nException caught inside
exception handler: " . self::getLogMessage( $e2 ) .
- "\nBacktrace:\n" .
self::getRedactedTraceAsString( $e2 );
+ "\nBacktrace:\n" .
self::getRedactedTraceAsString( $e ) .
+ "\n\nException caught inside
exception handler: " . self::getLogMessage( $e2 ) .
+ "\nBacktrace:\n" .
self::getRedactedTraceAsString( $e2 );
} else {
$message .= "Exception caught inside
exception handler.\n\n" .
"Set \$wgShowExceptionDetails =
true; at the bottom of LocalSettings.php " .
diff --git a/includes/Export.php b/includes/Export.php
index 3d34763..b4a507d 100644
--- a/includes/Export.php
+++ b/includes/Export.php
@@ -503,7 +503,8 @@
'xmlns' =>
"http://www.mediawiki.org/xml/export-$ver/",
'xmlns:xsi' =>
"http://www.w3.org/2001/XMLSchema-instance",
'xsi:schemaLocation' =>
"http://www.mediawiki.org/xml/export-$ver/ " .
-
"http://www.mediawiki.org/xml/export-$ver.xsd", #TODO: how do we get a new
version up there?
+ #TODO: how do we get a new version up there?
+ "http://www.mediawiki.org/xml/export-$ver.xsd",
'version' => $ver,
'xml:lang' => $wgLanguageCode ),
null ) .
diff --git a/includes/GitInfo.php b/includes/GitInfo.php
index f49f9be..e0bd5cd 100644
--- a/includes/GitInfo.php
+++ b/includes/GitInfo.php
@@ -143,8 +143,7 @@
} else {
return (int)$commitDate;
}
-
- }
+ }
/**
* Return the name of the current branch, or HEAD if not found
diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php
index 1680fd6..385663a 100644
--- a/includes/HTMLForm.php
+++ b/includes/HTMLForm.php
@@ -655,8 +655,7 @@
. $this->getBody()
. $this->getHiddenFields()
. $this->getButtons()
- . $this->mFooter
- ;
+ . $this->mFooter;
$html = $this->wrapForm( $html );
diff --git a/includes/Html.php b/includes/Html.php
index 6977a69..0eb6474 100644
--- a/includes/Html.php
+++ b/includes/Html.php
@@ -449,8 +449,8 @@
// numbers to be entered in 'type="number"' fields,
allow
// the special case 'step="any"'.
- if ( in_array( $key, array( 'max', 'min', 'pattern',
'required' ) ) ||
- $key === 'step' && $value !== 'any' ) {
+ if ( in_array( $key, array( 'max', 'min', 'pattern',
'required' ) )
+ || $key === 'step' && $value !== 'any' ) {
continue;
}
diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php
index 78c2ac7..da08aa2 100644
--- a/includes/HttpFunctions.php
+++ b/includes/HttpFunctions.php
@@ -842,8 +842,8 @@
$this->postData = wfArrayToCgi( $this->postData );
}
- if ( $this->parsedUrl['scheme'] != 'http' &&
- $this->parsedUrl['scheme'] != 'https' ) {
+ if ( $this->parsedUrl['scheme'] != 'http'
+ && $this->parsedUrl['scheme'] != 'https' ) {
$this->status->fatal( 'http-invalid-scheme',
$this->parsedUrl['scheme'] );
}
diff --git a/includes/LinkFilter.php b/includes/LinkFilter.php
index 97834fe..48d5cd8 100644
--- a/includes/LinkFilter.php
+++ b/includes/LinkFilter.php
@@ -123,7 +123,7 @@
$bits['host'] = $domainpart . '@' . $mailparts[0];
} elseif ( $bits['scheme'] === 'mailto' ) {
// domainpart of email address only, do not add '.'
- $bits['host'] = strtolower( implode( '.',
array_reverse( explode( '.', $bits['host']) ) ) );
+ $bits['host'] = strtolower( implode( '.',
array_reverse( explode( '.', $bits['host'] ) ) ) );
} else {
$bits['host'] = strtolower( implode( '.',
array_reverse( explode( '.', $bits['host'] ) ) ) );
if ( substr( $bits['host'], -1, 1 ) !== '.' ) {
diff --git a/includes/Linker.php b/includes/Linker.php
index 450b4ba..1c1d82e 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -849,10 +849,10 @@
if ( $page ) {
$url = wfAppendQuery( $url, array( 'page' => $page ) );
}
- if ( $manualthumb &&
- !isset( $fp['link-title'] ) &&
- !isset( $fp['link-url'] ) &&
- !isset( $fp['no-link'] ) ) {
+ if ( $manualthumb
+ && !isset( $fp['link-title'] )
+ && !isset( $fp['link-url'] )
+ && !isset( $fp['no-link'] ) ) {
$fp['link-url'] = $url;
}
diff --git a/includes/Revision.php b/includes/Revision.php
index 4446173..a01f515 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -1453,14 +1453,14 @@
$t = $title->getPrefixedDBkey();
throw new MWException( "Can't save non-default
content model with \$wgContentHandlerUseDB disabled: "
-
. "model is $model , default for $t is $defaultModel" );
+ . "model is $model , default for $t is
$defaultModel" );
}
if ( $this->getContentFormat() != $defaultFormat ) {
$t = $title->getPrefixedDBkey();
throw new MWException( "Can't use non-default
content format with \$wgContentHandlerUseDB disabled: "
-
. "format is $format, default for $t is $defaultFormat" );
+ . "format is $format, default for $t is
$defaultFormat" );
}
}
diff --git a/includes/User.php b/includes/User.php
index a01444a..8fcc68c 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -1632,8 +1632,8 @@
$blocked = $this->isBlocked( $bFromSlave );
$allowUsertalk = ( $wgBlockAllowsUTEdit ? $this->mAllowUsertalk
: false );
// If a user's name is suppressed, they cannot make edits
anywhere
- if ( !$this->mHideName && $allowUsertalk && $title->getText()
=== $this->getName() &&
- $title->getNamespace() == NS_USER_TALK ) {
+ if ( !$this->mHideName && $allowUsertalk && $title->getText()
=== $this->getName()
+ && $title->getNamespace() == NS_USER_TALK ) {
$blocked = false;
wfDebug( __METHOD__ . ": self-talk page, ignoring any
blocks\n" );
}
diff --git a/includes/Xml.php b/includes/Xml.php
index ac0539d..45441fd 100644
--- a/includes/Xml.php
+++ b/includes/Xml.php
@@ -500,34 +500,34 @@
$options = self::option( $other, 'other', $selected === 'other'
);
foreach ( explode( "\n", $list ) as $option ) {
- $value = trim( $option );
- if ( $value == '' ) {
- continue;
- } 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 ) == '**' ) {
- // groupmember
- $value = trim( substr( $value, 2 ) );
- $options .= self::option( $value,
$value, $selected === $value );
- } else {
- // groupless reason list
- if ( $optgroup ) {
- $options .= self::closeElement(
'optgroup' );
- }
- $options .= self::option( $value,
$value, $selected === $value );
- $optgroup = false;
+ $value = trim( $option );
+ if ( $value == '' ) {
+ continue;
+ } 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 ) == '**' ) {
+ // groupmember
+ $value = trim( substr( $value, 2 ) );
+ $options .= self::option( $value, $value,
$selected === $value );
+ } else {
+ // groupless reason list
+ if ( $optgroup ) {
+ $options .= self::closeElement(
'optgroup' );
+ }
+ $options .= self::option( $value, $value,
$selected === $value );
+ $optgroup = false;
}
+ }
- if ( $optgroup ) {
- $options .= self::closeElement( 'optgroup' );
- }
+ if ( $optgroup ) {
+ $options .= self::closeElement( 'optgroup' );
+ }
$attribs = array();
diff --git a/includes/cache/LocalisationCache.php
b/includes/cache/LocalisationCache.php
index f02e0a1..ccb94a2 100644
--- a/includes/cache/LocalisationCache.php
+++ b/includes/cache/LocalisationCache.php
@@ -1197,7 +1197,7 @@
if ( file_exists( $fileName ) ) {
try {
$this->readers[$code] =
CdbReader::open( $fileName );
- } catch( CdbException $e ) {
+ } catch ( CdbException $e ) {
wfDebug( __METHOD__ . ": unable to open
cdb file for reading" );
}
}
diff --git a/includes/db/Database.php b/includes/db/Database.php
index f70934b..7275bd9 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -1105,7 +1105,7 @@
wfDebug( "SQL ERROR (ignored): $error\n" );
$this->ignoreErrors( $ignore );
} else {
- $sql1line = mb_substr( str_replace( "\n", "\\n", $sql
), 0, 5*1024 );
+ $sql1line = mb_substr( str_replace( "\n", "\\n", $sql
), 0, 5 * 1024 );
wfLogDBError(
"$fname\t{$this->mServer}\t$errno\t$error\t$sql1line\n" );
wfDebug( "SQL ERROR: " . $error . "\n" );
throw new DBQueryError( $this, $error, $errno, $sql,
$fname );
diff --git a/includes/media/FormatMetadata.php
b/includes/media/FormatMetadata.php
index 390b217..74e51cf 100644
--- a/includes/media/FormatMetadata.php
+++ b/includes/media/FormatMetadata.php
@@ -1617,8 +1617,7 @@
* @return mixed value in best language, null if there were no
languages at all
* @since 1.23
*/
- protected function resolveMultilangValue( $value )
- {
+ protected function resolveMultilangValue( $value ) {
if (
!is_array( $value )
|| !isset( $value['_type'] )
@@ -1732,8 +1731,7 @@
* @return array
* @since 1.23
*/
- protected function getPriorityLanguages()
- {
+ protected function getPriorityLanguages() {
$priorityLanguages =
Language::getFallbacksIncludingSiteLanguage( $this->getLanguage()->getCode() );
$priorityLanguages = array_merge( (array)
$this->getLanguage()->getCode(), $priorityLanguages[0], $priorityLanguages[1] );
return $priorityLanguages;
diff --git a/includes/media/XCF.php b/includes/media/XCF.php
index e77d384..a80a0c8 100644
--- a/includes/media/XCF.php
+++ b/includes/media/XCF.php
@@ -103,12 +103,12 @@
# (enum GimpImageBaseType in libgimpbase/gimpbaseenums.h)
try {
$header = wfUnpack(
- "A9magic" # A: space padded
- . "/a5version" # a: zero padded
- . "/Nwidth" # \
- . "/Nheight" # N: unsigned long 32bit big
endian
- . "/Nbase_type" # /
- , $binaryHeader
+ "A9magic" . # A: space padded
+ "/a5version" . # a: zero padded
+ "/Nwidth" . # \
+ "/Nheight" . # N: unsigned long 32bit
big endian
+ "/Nbase_type", # /
+ $binaryHeader
);
} catch ( MWException $mwe ) {
return false;
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 2df3160..3479b8f 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -1788,14 +1788,14 @@
$imagematch = false;
}
if ( $this->mOptions->getAllowExternalImages()
- || ( $imagesexception && $imagematch ) ) {
+ || ( $imagesexception && $imagematch ) ) {
if ( preg_match( self::EXT_IMAGE_REGEX, $url ) ) {
# Image found
$text = Linker::makeExternalImage( $url );
}
}
if ( !$text && $this->mOptions->getEnableImageWhitelist()
- && preg_match( self::EXT_IMAGE_REGEX, $url ) ) {
+ && preg_match( self::EXT_IMAGE_REGEX, $url ) ) {
$whitelist = explode( "\n", wfMessage(
'external_image_whitelist' )->inContentLanguage()->text() );
foreach ( $whitelist as $entry ) {
# Sanitize the regex fragment, make it
case-insensitive, ignore blank entries/comments
@@ -3947,11 +3947,10 @@
$object = false;
$text = $frame->getArgument( $argName );
if ( $text === false && $parts->getLength() > 0
- && (
- $this->ot['html']
- || $this->ot['pre']
- || ( $this->ot['wiki'] && $frame->isTemplate() )
- )
+ && ( $this->ot['html']
+ || $this->ot['pre']
+ || ( $this->ot['wiki'] && $frame->isTemplate() )
+ )
) {
# No match in frame, use the supplied default
$object = $parts->item( 0 )->getChildren();
@@ -5432,10 +5431,10 @@
$params['frame']['caption'] = $caption;
# Will the image be presented in a frame, with the caption
below?
- $imageIsFramed = isset( $params['frame']['frame'] ) ||
- isset(
$params['frame']['framed'] ) ||
- isset(
$params['frame']['thumbnail'] ) ||
- isset(
$params['frame']['manualthumb'] );
+ $imageIsFramed = isset( $params['frame']['frame'] )
+ || isset( $params['frame']['framed'] )
+ || isset( $params['frame']['thumbnail'] )
+ || isset( $params['frame']['manualthumb'] );
# In the old days, [[Image:Foo|text...]] would set alt text.
Later it
# came to also set the caption, ordinary text after the image
-- which
diff --git a/includes/specials/SpecialExpandTemplates.php
b/includes/specials/SpecialExpandTemplates.php
index b566b91..a78133c 100644
--- a/includes/specials/SpecialExpandTemplates.php
+++ b/includes/specials/SpecialExpandTemplates.php
@@ -93,7 +93,7 @@
$out->addWikiMsg( 'expand_templates_intro' );
$out->addHTML( $this->makeForm( $titleStr, $input ) );
- if( $output !== false ) {
+ if ( $output !== false ) {
if ( $this->generateXML && strlen( $output ) > 0 ) {
$out->addHTML( $this->makeOutput( $xml,
'expand_templates_xml_output' ) );
}
@@ -108,7 +108,7 @@
);
}
- if( ( $wgUseTidy && $options->getTidy() ) ||
$wgAlwaysUseTidy ) {
+ if ( ( $wgUseTidy && $options->getTidy() ) ||
$wgAlwaysUseTidy ) {
$tmp = MWTidy::tidy( $tmp );
}
@@ -127,7 +127,7 @@
*/
private function makeForm( $title, $input ) {
$self = $this->getTitle();
- $form = Xml::openElement(
+ $form = Xml::openElement(
'form',
array( 'method' => 'post', 'action' =>
$self->getLocalUrl() )
);
diff --git a/includes/templates/NoLocalSettings.php
b/includes/templates/NoLocalSettings.php
index 0006df4..3f49ed3 100644
--- a/includes/templates/NoLocalSettings.php
+++ b/includes/templates/NoLocalSettings.php
@@ -33,8 +33,8 @@
$matches = array();
$ext = 'php';
$path = '/';
-foreach( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
- if( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
+foreach ( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
+ if ( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
$path .= "$part/";
} else {
$ext = $matches[1] == 'php5' ? 'php5' : 'php';
diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php
index d4c38af..3059b2e 100644
--- a/languages/LanguageConverter.php
+++ b/languages/LanguageConverter.php
@@ -102,8 +102,7 @@
'R' => 'R', // raw content
'D' => 'D', // convert description (subclass
implement)
'-' => '-', // remove convert (not implement)
- 'H' => 'H', // add rule for convert code
- // (but no display in placed
code)
+ 'H' => 'H', // add rule for convert code (but no
display in placed code)
'N' => 'N' // current variant name
);
$this->mFlags = array_merge( $defaultflags, $flags );
@@ -778,12 +777,12 @@
$ns = NS_MAIN;
if ( $disableLinkConversion ||
- ( !$ignoreOtherCond &&
- ( $isredir == 'no'
- || $action == 'edit'
- || $action == 'submit'
- || $linkconvert == 'no'
- || $wgUser->getOption( 'noconvertlink' ) == 1
) ) ) {
+ ( !$ignoreOtherCond &&
+ ( $isredir == 'no'
+ || $action == 'edit'
+ || $action == 'submit'
+ || $linkconvert == 'no'
+ || $wgUser->getOption( 'noconvertlink'
) == 1 ) ) ) {
return;
}
@@ -876,8 +875,7 @@
$this->mTables = $wgLangConvMemc->get( $this->mCacheKey
);
wfProfileOut( __METHOD__ . '-cache' );
}
- if ( !$this->mTables
- || !array_key_exists( self::CACHE_VERSION_KEY,
$this->mTables ) ) {
+ if ( !$this->mTables || !array_key_exists(
self::CACHE_VERSION_KEY, $this->mTables ) ) {
wfProfileIn( __METHOD__ . '-recache' );
// not in cache, or we need a fresh reload.
// We will first load the default tables
@@ -1004,8 +1002,7 @@
continue;
}
$mappings = explode( '}-', $block, 2 );
- $stripped = str_replace( array( "'", '"', '*', '#' ),
'',
-
$mappings[0] );
+ $stripped = str_replace( array( "'", '"', '*', '#' ),
'', $mappings[0] );
$table = StringUtils::explode( ';', $stripped );
foreach ( $table as $t ) {
$m = explode( '=>', $t, 3 );
@@ -1285,9 +1282,9 @@
$from = trim( $u[0] );
$v = trim( $u[1] );
if ( array_key_exists( $v, $unidtable )
- && !is_array( $unidtable[$v] )
- && $to
- && in_array( $v, $variants ) ) {
+ && !is_array( $unidtable[$v] )
+ && $to
+ && in_array( $v, $variants ) ) {
$unidtable[$v] = array( $from => $to );
} elseif ( $to && in_array( $v, $variants ) ) {
$unidtable[$v][$from] = $to;
@@ -1353,8 +1350,7 @@
$disp = $disp[0];
}
// or display frist text under disable manual convert
- if ( !$disp
- && $this->mConverter->mManualLevel[$variant]
== 'disable' ) {
+ if ( !$disp &&
$this->mConverter->mManualLevel[$variant] == 'disable' ) {
if ( count( $bidtable ) > 0 ) {
$disp = array_values( $bidtable );
$disp = $disp[0];
@@ -1477,8 +1473,9 @@
// then convert <text to convert> to current
language
$this->mRules = $this->mConverter->autoConvert(
$this->mRules,
$variant );
- } else { // if current variant no in flags,
- // then we check its fallback variants.
+ } else {
+ // if current variant no in flags,
+ // then we check its fallback variants.
$variantFallbacks =
$this->mConverter->getVariantFallbacks(
$variant );
if ( is_array( $variantFallbacks ) ) {
diff --git a/languages/classes/LanguageDsb.php
b/languages/classes/LanguageDsb.php
index 975157f..0ae0524 100644
--- a/languages/classes/LanguageDsb.php
+++ b/languages/classes/LanguageDsb.php
@@ -49,7 +49,7 @@
case 'lokatiw': # lokatiw
$word = 'wo ' . $word;
break;
- }
+ }
return $word; # this will return the original value for
'nominatiw' (nominativ) and all undefined case values
}
diff --git a/languages/classes/LanguageHsb.php
b/languages/classes/LanguageHsb.php
index 5623f3c..1fc1404 100644
--- a/languages/classes/LanguageHsb.php
+++ b/languages/classes/LanguageHsb.php
@@ -49,7 +49,7 @@
case 'lokatiw': # lokatiw
$word = 'wo ' . $word;
break;
- }
+ }
return $word; # this will return the original value for
'nominatiw' (nominativ) and all undefined case values
}
diff --git a/maintenance/backupTextPass.inc b/maintenance/backupTextPass.inc
index a51e6ee..f16772c 100644
--- a/maintenance/backupTextPass.inc
+++ b/maintenance/backupTextPass.inc
@@ -417,8 +417,8 @@
$text = false; // The candidate for a good text. false if no
proper value.
$failures = 0; // The number of times, this invocation of
getText already failed.
- static $consecutiveFailedTextRetrievals = 0; // The number of
times getText failed without
- // yielding a good
text in between.
+ // The number of times getText failed without yielding a good
text in between.
+ static $consecutiveFailedTextRetrievals = 0;
$this->fetchCount++;
diff --git a/maintenance/cdb.php b/maintenance/cdb.php
index 1772b5f..4590611 100644
--- a/maintenance/cdb.php
+++ b/maintenance/cdb.php
@@ -77,7 +77,7 @@
print "Loading cdb file $file...";
try {
$fileHandle = CdbReader::open( $file );
- } catch( CdbException $e ) {}
+ } catch ( CdbException $e ) {}
if ( !$fileHandle ) {
print "not a cdb file or unable to read it\n";
diff --git a/maintenance/parse.php b/maintenance/parse.php
index 3ac7a28..7765784 100644
--- a/maintenance/parse.php
+++ b/maintenance/parse.php
@@ -123,9 +123,9 @@
*/
protected function parse( $wikitext ) {
return $this->parser->parse(
- $wikitext
- , $this->getTitle()
- , new ParserOptions()
+ $wikitext,
+ $this->getTitle(),
+ new ParserOptions()
);
}
}
diff --git a/maintenance/userDupes.inc b/maintenance/userDupes.inc
index 8bd80c9..44a1aab 100644
--- a/maintenance/userDupes.inc
+++ b/maintenance/userDupes.inc
@@ -184,7 +184,7 @@
function getDupes() {
$user = $this->db->tableName( 'user' );
$result = $this->db->query(
- "SELECT user_name,COUNT(*) AS n
+ "SELECT user_name,COUNT(*) AS n
FROM $user
GROUP BY user_name
HAVING n > 1", __METHOD__ );
diff --git a/tests/phpunit/data/xmp/gps.result.php
b/tests/phpunit/data/xmp/gps.result.php
index 8ea9c68..bf7fb21 100644
--- a/tests/phpunit/data/xmp/gps.result.php
+++ b/tests/phpunit/data/xmp/gps.result.php
@@ -7,5 +7,5 @@
'GPSLatitude' => 88.51805555,
'GPSLongitude' => -21.12356945,
'GPSVersionID' => '2.2.0.0'
- )
+ )
);
diff --git a/tests/phpunit/includes/LinkFilterTest.php
b/tests/phpunit/includes/LinkFilterTest.php
index 1ca8e9f..41207b7 100644
--- a/tests/phpunit/includes/LinkFilterTest.php
+++ b/tests/phpunit/includes/LinkFilterTest.php
@@ -70,38 +70,38 @@
return array(
// Protocol, Search pattern, URL which matches the
pattern
- array( 'http://' , '*.test.com' , 'http://www.test.com'
),
- array( 'http://' , 'test.com:8080/dir/file' ,
'http://name:[email protected]:8080/dir/file' ),
- array( 'https://' , '*.com' ,
'https://s.s.test..com:88/dir/file?a=1&b=2' ),
- array( 'https://' , '*.com' ,
'https://name:[email protected]/index.html' ),
- array( 'http://' , 'name:[email protected]' ,
'http://test.com' ),
- array( 'http://' , 'test.com' ,
'http://name:[email protected]' ),
- array( 'http://' , '*.test.com' ,
'http://a.b.c.test.com/dir/dir/file?a=6'),
- array( null , 'http://*.test.com' ,
'http://www.test.com' ),
- array( 'mailto:' , '[email protected]' ,
'mailto:[email protected]' ),
- array( '' ,
-
'http://name:[email protected]:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg'
,
+ array( 'http://', '*.test.com', 'http://www.test.com' ),
+ array( 'http://', 'test.com:8080/dir/file',
'http://name:[email protected]:8080/dir/file' ),
+ array( 'https://', '*.com',
'https://s.s.test..com:88/dir/file?a=1&b=2' ),
+ array( 'https://', '*.com',
'https://name:[email protected]/index.html' ),
+ array( 'http://', 'name:[email protected]',
'http://test.com' ),
+ array( 'http://', 'test.com',
'http://name:[email protected]' ),
+ array( 'http://', '*.test.com',
'http://a.b.c.test.com/dir/dir/file?a=6'),
+ array( null, 'http://*.test.com', 'http://www.test.com'
),
+ array( 'mailto:', '[email protected]',
'mailto:[email protected]' ),
+ array( '',
+
'http://name:[email protected]:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg',
'http://name:[email protected]:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg'
),
- array( '' ,
'http://name:pass@*.test.com:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg'
,
+ array( '',
'http://name:pass@*.test.com:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg',
'http://name:[email protected]:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg'
),
- array( '' ,
'http://name:wrongpass@*.com:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]' ,
+ array( '',
'http://name:wrongpass@*.com:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]',
'http://name:[email protected]:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg'
),
- array( 'http://' ,
'name:pass@*.test.com:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg' ,
+ array( 'http://',
'name:pass@*.test.com:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg',
'http://name:[email protected]:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg'
),
- array( '' , 'http://name:[email protected]:12345' ,
+ array( '', 'http://name:[email protected]:12345',
'http://name:[email protected]:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg'
),
array( 'ftp://',
'user:[email protected]:1233/home/user/file;type=efw',
'ftp://user:[email protected]:1233/home/user/file;type=efw' ),
- array( null ,
'ftp://otheruser:[email protected]:1233/home/user/file;type=',
+ array( null,
'ftp://otheruser:[email protected]:1233/home/user/file;type=',
'ftp://user:[email protected]:1233/home/user/file;type=efw' ),
- array( null ,
'ftp://@ftp.test.com:1233/home/user/file;type=',
+ array( null,
'ftp://@ftp.test.com:1233/home/user/file;type=',
'ftp://user:[email protected]:1233/home/user/file;type=efw' ),
- array( null , 'ftp://ftp.test.com/',
+ array( null, 'ftp://ftp.test.com/',
'ftp://user:[email protected]/home/user/file;type=efw' ),
- array( null , 'ftp://ftp.test.com/',
+ array( null, 'ftp://ftp.test.com/',
'ftp://user:[email protected]/home/user/file;type=efw' ),
- array( null , 'ftp://*.test.com:222/',
+ array( null, 'ftp://*.test.com:222/',
'ftp://user:[email protected]:222/home' ),
array( 'irc://', '*.myserver:6667/',
'irc://test.myserver:6667/' ),
array( 'irc://', 'name:pass@*.myserver/',
'irc://test.myserver:6667/' ),
@@ -115,15 +115,15 @@
array( 'mailto:', 'test.com', 'mailto:[email protected]' ),
array( 'news:', '[email protected]',
'news:[email protected]' ),
array( 'news:', '*.test.com',
'news:[email protected]' ),
- array( '' ,
'news:4df8kh$iagfewewf(at)newsbf02aaa.news.aol.com',
+ array( '',
'news:4df8kh$iagfewewf(at)newsbf02aaa.news.aol.com',
'news:4df8kh$iagfewewf(at)newsbf02aaa.news.aol.com' ),
- array( '' , 'news:*.aol.com',
+ array( '', 'news:*.aol.com',
'news:4df8kh$iagfewewf(at)newsbf02aaa.news.aol.com' ),
- array( '' , 'git://github.com/prwef/abc-def.git' ,
'git://github.com/prwef/abc-def.git' ),
- array( 'git://' , 'github.com/' ,
'git://github.com/prwef/abc-def.git' ),
- array( 'git://' , '*.github.com/' ,
'git://a.b.c.d.e.f.github.com/prwef/abc-def.git' ),
- array( '' , 'gopher://*.test.com/' ,
'gopher://gopher.test.com/0/v2/vstat'),
- array( 'telnet://' , '*.test.com' ,
'telnet://shell.test.com/~home/'),
+ array( '', 'git://github.com/prwef/abc-def.git',
'git://github.com/prwef/abc-def.git' ),
+ array( 'git://', 'github.com/',
'git://github.com/prwef/abc-def.git' ),
+ array( 'git://', '*.github.com/',
'git://a.b.c.d.e.f.github.com/prwef/abc-def.git' ),
+ array( '', 'gopher://*.test.com/',
'gopher://gopher.test.com/0/v2/vstat'),
+ array( 'telnet://', '*.test.com',
'telnet://shell.test.com/~home/'),
//
// The following only work in PHP >= 5.3.7, due to a
bug in parse_url which eats
@@ -140,12 +140,12 @@
//
// Tests for false positives
//
- array( 'http://' , 'test.com' , 'http://www.test.com',
false ),
- array( 'http://' , 'www1.test.com' ,
'http://www.test.com', false ),
- array( 'http://' , '*.test.com' ,
'http://www.test.t.com', false ),
- array( '' , 'http://test.com:8080' ,
'http://www.test.com:8080', false ),
- array( '' , 'https://test.com' , 'http://test.com',
false ),
- array( '' , 'http://test.com' , 'https://test.com',
false ),
+ array( 'http://', 'test.com', 'http://www.test.com',
false ),
+ array( 'http://', 'www1.test.com',
'http://www.test.com', false ),
+ array( 'http://', '*.test.com',
'http://www.test.t.com', false ),
+ array( '', 'http://test.com:8080',
'http://www.test.com:8080', false ),
+ array( '', 'https://test.com', 'http://test.com', false
),
+ array( '', 'http://test.com', 'https://test.com', false
),
array( 'http://', 'http://test.com', 'http://test.com',
false ),
array( null, 'http://www.test.com',
'http://www.test.com:80', false ),
array( null, 'http://www.test.com:80',
'http://www.test.com', false ),
@@ -205,7 +205,7 @@
$matches = 0;
- foreach( $indexes as $index ) {
+ foreach ( $indexes as $index ) {
$matches += preg_match( $regex, $index );
$debugmsg .= "\t'$index'\n";
}
diff --git a/tests/phpunit/includes/PreferencesTest.php
b/tests/phpunit/includes/PreferencesTest.php
index 3dec2da..5841bb6 100644
--- a/tests/phpunit/includes/PreferencesTest.php
+++ b/tests/phpunit/includes/PreferencesTest.php
@@ -81,9 +81,9 @@
protected function prefsFor( $user_key ) {
$preferences = array();
Preferences::profilePreferences(
- $this->prefUsers[$user_key]
- , $this->context
- , $preferences
+ $this->prefUsers[$user_key],
+ $this->context,
+ $preferences
);
return $preferences;
diff --git a/tests/phpunit/includes/StatusTest.php
b/tests/phpunit/includes/StatusTest.php
index 8ed2189..30a554e 100644
--- a/tests/phpunit/includes/StatusTest.php
+++ b/tests/phpunit/includes/StatusTest.php
@@ -413,7 +413,7 @@
*/
public function testGetErrorMessage() {
$method = new ReflectionMethod( 'Status', 'getErrorMessage' );
- $method->setAccessible(true);
+ $method->setAccessible( true );
$status = new Status();
$key = 'foo';
$params = array( 'bar' );
@@ -430,7 +430,7 @@
*/
public function testGetErrorMessageArray() {
$method = new ReflectionMethod( 'Status',
'getErrorMessageArray' );
- $method->setAccessible(true);
+ $method->setAccessible( true );
$status = new Status();
$key = 'foo';
$params = array( 'bar' );
@@ -446,7 +446,7 @@
$this->assertInternalType( 'array', $messageArray );
$this->assertCount( 2, $messageArray );
- foreach( $messageArray as $message ) {
+ foreach ( $messageArray as $message ) {
$this->assertInstanceOf( 'Message', $message );
$this->assertEquals( $key, $message->getKey() );
$this->assertEquals( $params, $message->getParams() );
diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php
b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php
index 54f3598..e7203c9 100644
--- a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php
+++ b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php
@@ -152,7 +152,8 @@
private static function GetItems( $q, $moduleName, $name, &$print ) {
if ( isset( $q[$moduleName] ) ) {
$print[] = "*$name/[" . implode( ',',
- array_map( function ( $v ) {
+ array_map(
+ function ( $v ) {
return $v['title'];
},
$q[$moduleName] ) ) . ']';
diff --git a/tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
b/tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
index 398c5a2..531a954 100644
--- a/tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
+++ b/tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
@@ -33,13 +33,13 @@
$title->getBacklinkCache()->clear();
$this->assertEquals( 20,
$title->getBacklinkCache()->getNumLinks( 'pagelinks' ), 'Correct number of
backlinks' );
- $job = new RefreshLinksJob( $title, array( 'recursive' => true,
'table' => 'pagelinks' )
+ $job = new RefreshLinksJob( $title, array( 'recursive' => true,
'table' => 'pagelinks' )
+ Job::newRootJobParams(
"refreshlinks:pagelinks:{$title->getPrefixedText()}" ) );
$extraParams = $job->getRootJobParams();
$jobs = BacklinkJobUtils::partitionBacklinkJob( $job, 9, 1,
array( 'params' => $extraParams ) );
$this->assertEquals( 10, count( $jobs ), 'Correct number of
sub-jobs' );
- $this->assertEquals( $pages[0], current(
$jobs[0]->params['pages'] ),
+ $this->assertEquals( $pages[0], current(
$jobs[0]->params['pages'] ),
'First job is leaf job with proper title' );
$this->assertEquals( $pages[8], current(
$jobs[8]->params['pages'] ),
'Last leaf job is leaf job with proper title' );
@@ -49,19 +49,19 @@
'Last job is recursive sub-job' );
$this->assertEquals( true, is_array( $jobs[9]->params['range']
),
'Last job is recursive sub-job' );
- $this->assertEquals( $title->getPrefixedText(),
$jobs[0]->getTitle()->getPrefixedText(),
+ $this->assertEquals( $title->getPrefixedText(),
$jobs[0]->getTitle()->getPrefixedText(),
'Base job title retainend in leaf job' );
- $this->assertEquals( $title->getPrefixedText(),
$jobs[9]->getTitle()->getPrefixedText(),
+ $this->assertEquals( $title->getPrefixedText(),
$jobs[9]->getTitle()->getPrefixedText(),
'Base job title retainend recursive sub-job' );
$this->assertEquals( $extraParams['rootJobSignature'],
$jobs[0]->params['rootJobSignature'],
'Leaf job has root params' );
- $this->assertEquals( $extraParams['rootJobSignature'],
$jobs[9]->params['rootJobSignature'],
+ $this->assertEquals( $extraParams['rootJobSignature'],
$jobs[9]->params['rootJobSignature'],
'Recursive sub-job has root params' );
$jobs2 = BacklinkJobUtils::partitionBacklinkJob( $jobs[9], 9,
1, array( 'params' => $extraParams ) );
$this->assertEquals( 10, count( $jobs2 ), 'Correct number of
sub-jobs' );
- $this->assertEquals( $pages[9], current(
$jobs2[0]->params['pages'] ),
+ $this->assertEquals( $pages[9], current(
$jobs2[0]->params['pages'] ),
'First job is leaf job with proper title' );
$this->assertEquals( $pages[17], current(
$jobs2[8]->params['pages'] ),
'Last leaf job is leaf job with proper title' );
@@ -73,17 +73,17 @@
'Last job is recursive sub-job' );
$this->assertEquals( $extraParams['rootJobSignature'],
$jobs2[0]->params['rootJobSignature'],
'Leaf job has root params' );
- $this->assertEquals( $extraParams['rootJobSignature'],
$jobs2[9]->params['rootJobSignature'],
+ $this->assertEquals( $extraParams['rootJobSignature'],
$jobs2[9]->params['rootJobSignature'],
'Recursive sub-job has root params' );
$jobs3 = BacklinkJobUtils::partitionBacklinkJob( $jobs2[9], 9,
1, array( 'params' => $extraParams ) );
$this->assertEquals( 2, count( $jobs3 ), 'Correct number of
sub-jobs' );
- $this->assertEquals( $pages[18], current(
$jobs3[0]->params['pages'] ),
+ $this->assertEquals( $pages[18], current(
$jobs3[0]->params['pages'] ),
'First job is leaf job with proper title' );
$this->assertEquals( $extraParams['rootJobSignature'],
$jobs3[0]->params['rootJobSignature'],
'Leaf job has root params' );
- $this->assertEquals( $pages[19], current(
$jobs3[1]->params['pages'] ),
+ $this->assertEquals( $pages[19], current(
$jobs3[1]->params['pages'] ),
'Last job is leaf job with proper title' );
$this->assertEquals( $extraParams['rootJobSignature'],
$jobs3[1]->params['rootJobSignature'],
'Last leaf job has root params' );
@@ -91,7 +91,7 @@
public static function provider_backlinks() {
$pages = array();
- for ( $i=0; $i<20; ++$i ) {
+ for ( $i = 0; $i < 20; ++$i ) {
$pages[] = array( 0, "Page-$i" );
}
return array(
diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php
b/tests/phpunit/includes/specials/SpecialSearchTest.php
index 17e883f..4ccf5d7 100644
--- a/tests/phpunit/includes/specials/SpecialSearchTest.php
+++ b/tests/phpunit/includes/specials/SpecialSearchTest.php
@@ -46,12 +46,12 @@
array( /** Expected: */
'ProfileName' => $expectedProfile,
'Namespaces' => $expectedNS,
- )
- , array( /** Actual: */
+ ),
+ array( /** Actual: */
'ProfileName' => $search->getProfile(),
'Namespaces' => $search->getNamespaces(),
- )
- , $message
+ ),
+ $message
);
}
--
To view, visit https://gerrit.wikimedia.org/r/98120
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I40ccda72c418c4a33fcd675773cb08d971510cdb
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Liangent <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits