update mediawiki-codesniffer to 0.11.0 and fix issues

- mostly auto fixes
- some too long lines fixed
- ignore amp space in one case  passing by reference

Change-Id: I6472f83bc3cbf4bd629d83050cc3319b19ec465c
This commit is contained in:
WMDE-Fisch 2017-08-11 15:53:17 +02:00
parent 749d64bbe7
commit 6df9ed1ad6
47 changed files with 86 additions and 81 deletions

View file

@ -53,7 +53,7 @@
"jakub-onderka/php-parallel-lint": "0.9.2",
"jetbrains/phpstorm-stubs": "dev-master#1b9906084d6635456fcf3f3a01f0d7d5b99a578a",
"justinrainbow/json-schema": "~5.2",
"mediawiki/mediawiki-codesniffer": "0.10.1",
"mediawiki/mediawiki-codesniffer": "0.11.0",
"monolog/monolog": "~1.22.1",
"nikic/php-parser": "2.1.0",
"nmred/kafka-php": "0.1.5",

View file

@ -1501,7 +1501,7 @@ class Block {
return $id;
}
$hmac = MWCryptHash::hmac( $id, $secretKey, false );
$cookieValue = $id . '!' . $hmac;
$cookieValue = $id . '!' . $hmac;
return $cookieValue;
}

View file

@ -5797,7 +5797,7 @@ $wgPasswordAttemptThrottle = [
// Long term limit. We need to balance the risk
// of somebody using this as a DoS attack to lock someone
// out of their account, and someone doing a brute force attack.
[ 'count' => 150, 'seconds' => 60*60*48 ],
[ 'count' => 150, 'seconds' => 60 * 60 * 48 ],
];
/**

View file

@ -4333,7 +4333,7 @@ class EditPage {
$newPage = !$this->mTitle->exists();
if ( $labelAsPublish ) {
$buttonLabelKey = $newPage ? 'publishpage' : 'publishchanges';
$buttonLabelKey = $newPage ? 'publishpage' : 'publishchanges';
} else {
$buttonLabelKey = $newPage ? 'savearticle' : 'savechanges';
}

View file

@ -511,7 +511,7 @@ class MovePage {
$logEntry->setComment( $reason );
$logEntry->setParameters( [
'4::target' => $nt->getPrefixedText(),
'5::noredir' => $redirectContent ? '0': '1',
'5::noredir' => $redirectContent ? '0' : '1',
] );
$formatter = LogFormatter::newFromEntry( $logEntry );

View file

@ -116,7 +116,7 @@ abstract class RevisionListBase extends ContextSource implements Iterator {
}
public function key() {
return $this->res ? $this->res->key(): 0;
return $this->res ? $this->res->key() : 0;
}
public function valid() {

View file

@ -1677,7 +1677,10 @@ class Sanitizer {
$text = preg_replace_callback(
self::CHAR_REFS_REGEX,
[ 'Sanitizer', 'decodeCharReferencesCallback' ],
$text, /* limit */ -1, $count );
$text,
-1, //limit
$count
);
if ( $count ) {
return $wgContLang->normalize( $text );

View file

@ -115,7 +115,7 @@ class ApiCSPReport extends ApiBase {
$req = $this->getRequest();
$contentType = $req->getHeader( 'content-type' );
if ( $contentType !== 'application/json'
&& $contentType !=='application/csp-report'
&& $contentType !== 'application/csp-report'
) {
$this->error( 'wrongformat', __METHOD__ );
}

View file

@ -767,30 +767,30 @@ class ApiQueryImageInfo extends ApiQueryBase {
*/
private static function getProperties( $modulePrefix = '' ) {
return [
'timestamp' => ' timestamp - Adds timestamp for the uploaded version',
'user' => ' user - Adds the user who uploaded the image version',
'userid' => ' userid - Add the user ID that uploaded the image version',
'comment' => ' comment - Comment on the version',
'parsedcomment' => ' parsedcomment - Parse the comment on the version',
'timestamp' => ' timestamp - Adds timestamp for the uploaded version',
'user' => ' user - Adds the user who uploaded the image version',
'userid' => ' userid - Add the user ID that uploaded the image version',
'comment' => ' comment - Comment on the version',
'parsedcomment' => ' parsedcomment - Parse the comment on the version',
'canonicaltitle' => ' canonicaltitle - Adds the canonical title of the image file',
'url' => ' url - Gives URL to the image and the description page',
'size' => ' size - Adds the size of the image in bytes, ' .
'url' => ' url - Gives URL to the image and the description page',
'size' => ' size - Adds the size of the image in bytes, ' .
'its height and its width. Page count and duration are added if applicable',
'dimensions' => ' dimensions - Alias for size', // B/C with Allimages
'sha1' => ' sha1 - Adds SHA-1 hash for the image',
'mime' => ' mime - Adds MIME type of the image',
'thumbmime' => ' thumbmime - Adds MIME type of the image thumbnail' .
'dimensions' => ' dimensions - Alias for size', // B/C with Allimages
'sha1' => ' sha1 - Adds SHA-1 hash for the image',
'mime' => ' mime - Adds MIME type of the image',
'thumbmime' => ' thumbmime - Adds MIME type of the image thumbnail' .
' (requires url and param ' . $modulePrefix . 'urlwidth)',
'mediatype' => ' mediatype - Adds the media type of the image',
'metadata' => ' metadata - Lists Exif metadata for the version of the image',
'mediatype' => ' mediatype - Adds the media type of the image',
'metadata' => ' metadata - Lists Exif metadata for the version of the image',
'commonmetadata' => ' commonmetadata - Lists file format generic metadata ' .
'for the version of the image',
'extmetadata' => ' extmetadata - Lists formatted metadata combined ' .
'extmetadata' => ' extmetadata - Lists formatted metadata combined ' .
'from multiple sources. Results are HTML formatted.',
'archivename' => ' archivename - Adds the file name of the archive ' .
'archivename' => ' archivename - Adds the file name of the archive ' .
'version for non-latest versions',
'bitdepth' => ' bitdepth - Adds the bit depth of the version',
'uploadwarning' => ' uploadwarning - Used by the Special:Upload page to ' .
'bitdepth' => ' bitdepth - Adds the bit depth of the version',
'uploadwarning' => ' uploadwarning - Used by the Special:Upload page to ' .
'get information about an existing file. Not intended for use outside MediaWiki core',
];
}

View file

@ -179,7 +179,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
$watchedItemQuery = MediaWikiServices::getInstance()->getWatchedItemQueryService();
$items = $watchedItemQuery->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
foreach ( $items as list ( $watchedItem, $recentChangeInfo ) ) {
foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
/** @var WatchedItem $watchedItem */
if ( is_null( $resultPageSet ) ) {
$vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );

View file

@ -115,7 +115,7 @@ trait SearchApi {
$defaultProfile = null;
foreach ( $profiles as $profile ) {
$types[] = $profile['name'];
if ( isset ( $profile['desc-message'] ) ) {
if ( isset( $profile['desc-message'] ) ) {
$helpMessages[$profile['name']] = $profile['desc-message'];
}
if ( !empty( $profile['default'] ) ) {

View file

@ -165,7 +165,7 @@ abstract class ChangesListFilterGroup {
$this->title = $groupDefinition['title'];
}
if ( isset ( $groupDefinition['whatsThisHeader'] ) ) {
if ( isset( $groupDefinition['whatsThisHeader'] ) ) {
$this->whatsThisHeader = $groupDefinition['whatsThisHeader'];
$this->whatsThisBody = $groupDefinition['whatsThisBody'];
$this->whatsThisUrl = $groupDefinition['whatsThisUrl'];
@ -352,7 +352,7 @@ abstract class ChangesListFilterGroup {
'messageKeys' => [ $this->title ]
];
if ( isset ( $this->whatsThisHeader ) ) {
if ( isset( $this->whatsThisHeader ) ) {
$output['whatsThisHeader'] = $this->whatsThisHeader;
$output['whatsThisBody'] = $this->whatsThisBody;
$output['whatsThisUrl'] = $this->whatsThisUrl;

View file

@ -82,7 +82,7 @@ class OldChangesList extends ChangesList {
if ( $rc->mAttribs['rc_log_type'] ) {
$logtitle = SpecialPage::getTitleFor( 'Log', $rc->mAttribs['rc_log_type'] );
$this->insertLog( $html, $logtitle, $rc->mAttribs['rc_log_type'] );
$flags = $this->recentChangesFlags( [ 'unpatrolled' =>$unpatrolled,
$flags = $this->recentChangesFlags( [ 'unpatrolled' => $unpatrolled,
'bot' => $rc->mAttribs['rc_bot'] ], '' );
if ( $flags !== '' ) {
$html .= ' ' . $flags;

View file

@ -183,7 +183,7 @@ class DBFileJournal extends FileJournal {
protected function getMasterDB() {
if ( !$this->dbw ) {
// Get a separate connection in autocommit mode
$lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->newMainLB();
$lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->newMainLB();
$this->dbw = $lb->getConnection( DB_MASTER, [], $this->wiki );
$this->dbw->clearFlag( DBO_TRX );
}

View file

@ -1353,7 +1353,7 @@ abstract class Installer {
}
// extensions -> extension.json, skins -> skin.json
$jsonFile = substr( $directory, 0, strlen( $directory ) -1 ) . '.json';
$jsonFile = substr( $directory, 0, strlen( $directory ) - 1 ) . '.json';
$dh = opendir( $extDir );
$exts = [];

View file

@ -28,7 +28,7 @@ class ComposerInstalled {
'type' => $installed['type'],
'licenses' => isset( $installed['license'] ) ? $installed['license'] : [],
'authors' => isset( $installed['authors'] ) ? $installed['authors'] : [],
'description' => isset( $installed['description'] ) ? $installed['description']: '',
'description' => isset( $installed['description'] ) ? $installed['description'] : '',
];
}

View file

@ -28,7 +28,7 @@ class ComposerLock {
'type' => $installed['type'],
'licenses' => isset( $installed['license'] ) ? $installed['license'] : [],
'authors' => isset( $installed['authors'] ) ? $installed['authors'] : [],
'description' => isset( $installed['description'] ) ? $installed['description']: '',
'description' => isset( $installed['description'] ) ? $installed['description'] : '',
];
}

View file

@ -3411,7 +3411,7 @@ class Parser {
# string or an array containing the string and any flags. This mungs
# things around to match what this method should return.
if ( !is_array( $result ) ) {
$result =[
$result = [
'found' => true,
'text' => $result,
];

View file

@ -1062,11 +1062,13 @@ class ParserOptions {
'speculativeRevIdCallback' => null,
];
// @codingStandardsIgnoreStart Squiz.WhiteSpace.OperatorSpacing.NoSpaceAfterAmp
Hooks::run( 'ParserOptionsRegister', [
&self::$defaults,
&self::$inCacheKey,
&self::$lazyOptions,
] );
// @codingStandardsIgnoreEnd
ksort( self::$inCacheKey );
}

View file

@ -625,7 +625,7 @@ class Preprocessor_DOM extends Preprocessor {
$curLen = strlen( $curChar );
$count = ( $curLen > 1 ) ?
# allow the final character to repeat
strspn( $text, $curChar[$curLen-1], $i+1 ) + 1 :
strspn( $text, $curChar[$curLen - 1], $i + 1 ) + 1 :
strspn( $text, $curChar, $i );
# we need to add to stack only if opening brace count is enough for one of the rules

View file

@ -569,7 +569,7 @@ class Preprocessor_Hash extends Preprocessor {
$curLen = strlen( $curChar );
$count = ( $curLen > 1 ) ?
# allow the final character to repeat
strspn( $text, $curChar[$curLen-1], $i+1 ) + 1 :
strspn( $text, $curChar[$curLen - 1], $i + 1 ) + 1 :
strspn( $text, $curChar, $i );
# we need to add to stack only if opening brace count is enough for one of the rules

View file

@ -298,7 +298,7 @@ class SectionProfiler {
/* Find all items under this entry */
$level = $stack[$max][1];
$working = [];
for ( $i = $max -1; $i >= 0; $i-- ) {
for ( $i = $max - 1; $i >= 0; $i-- ) {
if ( $stack[$i][1] > $level ) {
$working[] = $stack[$i];
} else {
@ -439,7 +439,7 @@ class SectionProfiler {
protected function calltreeCount( $stack, $start ) {
$level = $stack[$start][1];
$count = 0;
for ( $i = $start -1; $i >= 0 && $stack[$i][1] > $level; $i-- ) {
for ( $i = $start - 1; $i >= 0 && $stack[$i][1] > $level; $i-- ) {
$count ++;
}
return $count;

View file

@ -138,7 +138,7 @@ abstract class SearchEngine {
* @return mixed the feature value or null if unset
*/
public function getFeatureData( $feature ) {
if ( isset ( $this->features[$feature] ) ) {
if ( isset( $this->features[$feature] ) ) {
return $this->features[$feature];
}
return null;

View file

@ -145,7 +145,7 @@ class SearchSqlite extends SearchDatabase {
$searchChars = parent::legalSearchChars( $type );
if ( $type === self::CHARS_ALL ) {
// " for phrase, * for wildcard
$searchChars = "\"*" . $searchChars;
$searchChars = "\"*" . $searchChars;
}
return $searchChars;
}

View file

@ -333,7 +333,7 @@ class Site implements Serializable {
*/
public function getLinkPath() {
$type = $this->getLinkPathType();
return $type === null ? null: $this->getPath( $type );
return $type === null ? null : $this->getPath( $type );
}
/**

View file

@ -1156,7 +1156,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
// Don't show a "create account" link if the user can't.
if ( $this->showCreateAccountLink() ) {
// link to the other action
$linkTitle = $this->getTitleFor( $this->isSignup() ? 'Userlogin' :'CreateAccount' );
$linkTitle = $this->getTitleFor( $this->isSignup() ? 'Userlogin' : 'CreateAccount' );
$linkq = $this->getReturnToQueryStringFragment();
// Pass any language selection on to the mode switch link
if ( $this->mLanguage ) {

View file

@ -288,7 +288,7 @@ class SpecialExport extends SpecialPage {
$formDescriptor += [
'wpDownload' => [
'type' => 'check',
'name' =>'wpDownload',
'name' => 'wpDownload',
'id' => 'wpDownload',
'default' => $request->wasPosted() ? $request->getCheck( 'wpDownload' ) : true,
'label-message' => 'export-download',

View file

@ -197,7 +197,7 @@ class MediaStatisticsPage extends QueryPage {
$row .= Html::rawElement(
'td',
// Make sure js sorts it in numeric order
[ 'data-sort-value' => $bytes ],
[ 'data-sort-value' => $bytes ],
$this->msg( 'mediastatistics-nbytes' )
->numParams( $bytes )
->sizeParams( $bytes )

View file

@ -73,28 +73,28 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
'success' => 'revdelete-success',
'failure' => 'revdelete-failure',
'text' => 'revdelete-text-text',
'selected'=> 'revdelete-selected-text',
'selected' => 'revdelete-selected-text',
],
'archive' => [
'check-label' => 'revdelete-hide-text',
'success' => 'revdelete-success',
'failure' => 'revdelete-failure',
'text' => 'revdelete-text-text',
'selected'=> 'revdelete-selected-text',
'selected' => 'revdelete-selected-text',
],
'oldimage' => [
'check-label' => 'revdelete-hide-image',
'success' => 'revdelete-success',
'failure' => 'revdelete-failure',
'text' => 'revdelete-text-file',
'selected'=> 'revdelete-selected-file',
'selected' => 'revdelete-selected-file',
],
'filearchive' => [
'check-label' => 'revdelete-hide-image',
'success' => 'revdelete-success',
'failure' => 'revdelete-failure',
'text' => 'revdelete-text-file',
'selected'=> 'revdelete-selected-file',
'selected' => 'revdelete-selected-file',
],
'logging' => [
'check-label' => 'revdelete-hide-name',

View file

@ -596,7 +596,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
// default string representation, for example, and would confuse comparisons.
// Misleadingly, the 'days' option supports hours too.
$days = array_map( 'strval', [ 1/24, 2/24, 6/24, 12/24, 1, 3, 7 ] );
$days = array_map( 'strval', [ 1 / 24, 2 / 24, 6 / 24, 12 / 24, 1, 3, 7 ] );
$userWatchlistOption = (string)$this->getUser()->getOption( 'watchlistdays' );
// add the user preference, if it isn't available already

View file

@ -75,7 +75,7 @@ class LoginHelper extends ContextSource {
// Allow modification of redirect behavior
Hooks::run( 'PostLoginRedirect', [ &$returnTo, &$returnToQuery, &$type ] );
$returnToTitle = Title::newFromText( $returnTo ) ?: Title::newMainPage();
$returnToTitle = Title::newFromText( $returnTo ) ?: Title::newMainPage();
if ( $wgSecureLogin && !$stickHTTPS ) {
$options = [ 'http' ];

View file

@ -270,7 +270,7 @@ class UsersPager extends AlphabeticPager {
function getPageHeader() {
list( $self ) = explode( '/', $this->getTitle()->getPrefixedDBkey() );
$groupOptions = [ $this->msg( 'group-all' )->text() => '' ];
$groupOptions = [ $this->msg( 'group-all' )->text() => '' ];
foreach ( $this->getAllGroups() as $group => $groupText ) {
$groupOptions[ $groupText ] = $group;
}

View file

@ -1203,7 +1203,7 @@ class BalanceStack implements IteratorAggregate {
$furthestBlock = null;
$furthestBlockIndex = -1;
$stackLength = $this->length();
for ( $i = $index+1; $i < $stackLength; $i++ ) {
for ( $i = $index + 1; $i < $stackLength; $i++ ) {
if ( $this->node( $i )->isA( BalanceSets::$specialSet ) ) {
$furthestBlock = $this->node( $i );
$furthestBlockIndex = $i;
@ -1225,7 +1225,7 @@ class BalanceStack implements IteratorAggregate {
// Let the common ancestor be the element immediately above
// the formatting element in the stack of open elements.
$ancestor = $this->node( $index-1 );
$ancestor = $this->node( $index - 1 );
// Let a bookmark note the position of the formatting
// element in the list of active formatting elements
@ -2116,7 +2116,7 @@ class Balancer {
return $this->insertToken( $token, $value, $attribs, $selfClose );
}
// "Any other start tag"
$adjusted = ( $this->fragmentContext && $this->stack->length()===1 ) ?
$adjusted = ( $this->fragmentContext && $this->stack->length() === 1 ) ?
$this->fragmentContext : $this->stack->currentNode;
$this->stack->insertForeignElement(
$adjusted->namespaceURI, $value, $attribs
@ -2242,7 +2242,7 @@ class Balancer {
private function switchMode( $mode ) {
Assert::parameter(
substr( $mode, -4 )==='Mode', '$mode', 'should end in Mode'
substr( $mode, -4 ) === 'Mode', '$mode', 'should end in Mode'
);
$oldMode = $this->parseMode;
$this->parseMode = $mode;
@ -2267,8 +2267,8 @@ class Balancer {
switch ( $node->localName ) {
case 'select':
$stackLength = $this->stack->length();
for ( $j = $i + 1; $j < $stackLength-1; $j++ ) {
$ancestor = $this->stack->node( $stackLength-$j-1 );
for ( $j = $i + 1; $j < $stackLength - 1; $j++ ) {
$ancestor = $this->stack->node( $stackLength - $j - 1 );
if ( $ancestor->isHtmlNamed( 'template' ) ) {
break;
}

View file

@ -176,7 +176,7 @@ class InterwikiSearchResultSetWidget implements SearchResultSetWidget {
$iwIconUrl = $parsed['scheme'] .
$parsed['delimiter'] .
$parsed['host'] .
( isset ( $parsed['port'] ) ? ':' . $parsed['port'] : '' ) .
( isset( $parsed['port'] ) ? ':' . $parsed['port'] : '' ) .
'/favicon.ico';
$iwIcon = new OOUI\IconWidget( [

View file

@ -61,6 +61,6 @@ class InterwikiSearchResultWidget implements SearchResultWidget {
}
return Html::rawElement( 'div', [ 'class' => 'iw-result__title' ], $link . ' ' . $redirect ) .
Html::rawElement( 'div', [ 'class'=> 'iw-result__content' ], $snippet );
Html::rawElement( 'div', [ 'class' => 'iw-result__content' ], $snippet );
}
}

View file

@ -1584,9 +1584,9 @@ class Language {
* @return int[]
*/
private static function tsToIranian( $ts ) {
$gy = substr( $ts, 0, 4 ) -1600;
$gm = substr( $ts, 4, 2 ) -1;
$gd = substr( $ts, 6, 2 ) -1;
$gy = substr( $ts, 0, 4 ) - 1600;
$gm = substr( $ts, 4, 2 ) - 1;
$gd = substr( $ts, 6, 2 ) - 1;
# Days passed from the beginning (including leap years)
$gDayNo = 365 * $gy
@ -1666,7 +1666,7 @@ class Language {
(int)( ( 275 * $zm ) / 9 ) + $zd + 1729777;
}
$zl = $zjd -1948440 + 10632;
$zl = $zjd - 1948440 + 10632;
$zn = (int)( ( $zl - 1 ) / 10631 );
$zl = $zl - 10631 * $zn + 354;
$zj = ( (int)( ( 10985 - $zl ) / 5316 ) ) * ( (int)( ( 50 * $zl ) / 17719 ) ) +
@ -3346,7 +3346,7 @@ class Language {
if ( $start < 0 ) {
$start = 0;
}
$groupedNumber = substr( $number, $start, $end -$start ) . $groupedNumber;
$groupedNumber = substr( $number, $start, $end - $start ) . $groupedNumber;
$end = $start;
if ( $numMatches > 1 ) {
// use the last pattern for the rest of the number

View file

@ -282,7 +282,7 @@ class KkConverter extends LanguageConverter {
$ret = '';
foreach ( $matches as $m ) {
$ret .= substr( $text, $mstart, $m[1] -$mstart );
$ret .= substr( $text, $mstart, $m[1] - $mstart );
$ret .= $this->regsConverter( $m[0], $toVariant );
$mstart = $m[1] + strlen( $m[0] );
}

View file

@ -131,7 +131,7 @@ class SrConverter extends LanguageConverter {
$ret = $this->mTables[$toVariant]->replace( $m[0] );
$mstart = $m[1] + strlen( $m[0] );
foreach ( $matches as $m ) {
$ret .= substr( $text, $mstart, $m[1] -$mstart );
$ret .= substr( $text, $mstart, $m[1] - $mstart );
$ret .= parent::translate( $m[0], $toVariant );
$mstart = $m[1] + strlen( $m[0] );
}

View file

@ -88,7 +88,7 @@ $defaultDateFormat = 'km';
$dateFormats = [
'km time' => 'ម៉ោងH:i',
'km date' => 'l ទីd F ឆ្នាំY',
'km both' => 'ម៉ោងH:i l ទីd F ឆ្នាំY',
'km both' => 'ម៉ោងH:i l ទីd F ឆ្នាំY',
];
$specialPageAliases = [

View file

@ -95,7 +95,7 @@ class HHVMMakeRepo extends Maintenance {
print "Found " . count( $files ) . " files in " .
count( $dirs ) . " directories\n";
$tmpDir = wfTempDir() . '/mw-make-repo' . mt_rand( 0, 1<<31 );
$tmpDir = wfTempDir() . '/mw-make-repo' . mt_rand( 0, 1 << 31 );
if ( !mkdir( $tmpDir ) ) {
$this->error( 'Unable to create temporary directory', 1 );
}

View file

@ -448,7 +448,7 @@ class RefreshLinks extends Maintenance {
do {
$finalConds = $conds;
$timestamp = $dbr->addQuotes( $timestamp );
$finalConds []=
$finalConds [] =
"(cl_timestamp > $timestamp OR (cl_timestamp = $timestamp AND cl_from > $lastId))";
$res = $dbr->select( [ 'page', 'categorylinks' ],
[ 'page_id', 'cl_timestamp' ],

View file

@ -300,7 +300,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
'ConfigFactory',
self::makeTestConfigFactoryInstantiator(
$oldConfigFactory,
[ 'main' => $bootstrapConfig ]
[ 'main' => $bootstrapConfig ]
)
);
$newServices->resetServiceForTesting( 'DBLoadBalancerFactory' );

View file

@ -84,7 +84,7 @@ class ChangesListFilterTest extends MediaWikiTestCase {
]
);
$groupB = $this->getGroup(
$groupB = $this->getGroup(
[
'name' => 'groupB',
'filters' => [

View file

@ -90,7 +90,7 @@ class EtcConfigTest extends PHPUnit_Framework_TestCase {
*/
public function testConstructCacheSpec() {
$config = $this->createConfigMock( [ 'cache' => [
'class' => HashBagOStuff::class
'class' => HashBagOStuff::class
] ] );
$config->expects( $this->once() )->method( 'fetchAllFromEtcd' )
->willReturn( [

View file

@ -39,7 +39,7 @@ class ClassicInterwikiLookupTest extends MediaWikiTestCase {
$lookup = new \MediaWiki\Interwiki\ClassicInterwikiLookup(
Language::factory( 'en' ),
WANObjectCache::newEmpty(),
60*60,
60 * 60,
false,
3,
'en'
@ -153,7 +153,7 @@ class ClassicInterwikiLookupTest extends MediaWikiTestCase {
$lookup = new \MediaWiki\Interwiki\ClassicInterwikiLookup(
Language::factory( 'en' ),
WANObjectCache::newEmpty(),
60*60,
60 * 60,
$cdbFile,
3,
'en'
@ -204,7 +204,7 @@ class ClassicInterwikiLookupTest extends MediaWikiTestCase {
$lookup = new \MediaWiki\Interwiki\ClassicInterwikiLookup(
Language::factory( 'en' ),
WANObjectCache::newEmpty(),
60*60,
60 * 60,
$hash,
3,
'en'

View file

@ -51,7 +51,7 @@ class MockOggHandler extends OggHandlerTMH {
'length' => $this->getLength( $file ),
'offset' => $this->getOffset( $file ),
'width' => $targetWidth,
'height' => $targetHeight,
'height' => $targetHeight,
'isVideo' => !$this->isAudio( $file ),
'thumbtime' => isset(
$params['thumbtime']
@ -59,7 +59,7 @@ class MockOggHandler extends OggHandlerTMH {
'start' => isset( $params['start'] ) ? $params['start'] : false,
'end' => isset( $params['end'] ) ? $params['end'] : false,
'fillwindow' => isset( $params['fillwindow'] ) ? $params['fillwindow'] : false,
'disablecontrols' => isset ( $params['disablecontrols'] ) ? $params['disablecontrols'] : false
'disablecontrols' => isset( $params['disablecontrols'] ) ? $params['disablecontrols'] : false
];
// No thumbs for audio

View file

@ -42,17 +42,17 @@ mw.loader.implement( 'testUsesNestedMissing', function () {
}, {}, {});
",
'testSkipped' =>"
'testSkipped' => "
mw.loader.implement( 'testSkipped', function () {
QUnit.ok( false, 'Module testSkipped was supposed to be skipped.' );
}, {}, {});
",
'testNotSkipped' =>"
'testNotSkipped' => "
mw.loader.implement( 'testNotSkipped', function () {}, {}, {});
",
'testUsesSkippable' =>"
'testUsesSkippable' => "
mw.loader.implement( 'testUsesSkippable', function () {}, {}, {});
",
];