Skip to content

Commit 2d1cc94

Browse files
Update mediawiki/codesniffer to 41.0
And fix the reported violations (all of which I agree with). This should unblock reenabling the FunctionComment sniff, because it should now complain in fewer situations. Change-Id: If95f1adcdca12fb72971b9e57e4426905f69670a
1 parent 8e910f9 commit 2d1cc94

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"swaggest/json-diff": "^3.10.4"
4343
},
4444
"require-dev": {
45-
"mediawiki/mediawiki-codesniffer": "^40.0",
45+
"mediawiki/mediawiki-codesniffer": "^41.0",
4646
"mediawiki/mediawiki-phan-config": "^0.12.0",
4747
"mediawiki/minus-x": "1.1.1",
4848
"php-parallel-lint/php-console-highlighter": "0.5.0",

lib/tests/phpunit/TermFallbackCache/TermFallbackCacheFacadeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testGettingNoValue() {
5252
->willReturn( TermFallbackCacheFacade::NO_VALUE );
5353

5454
$value = $facade->get( $entityId, self::REVISION_ID, 'en', TermTypes::TYPE_LABEL );
55-
$this->assertEquals( $value, TermFallbackCacheFacade::NO_VALUE );
55+
$this->assertEquals( TermFallbackCacheFacade::NO_VALUE, $value );
5656
}
5757

5858
public function setProvider() {

repo/rest-api/tests/phpunit/UseCases/PatchItemStatement/PatchItemStatementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public function testRejectsPropertyIdChange(): void {
306306
);
307307

308308
$this->assertInstanceOf( PatchItemStatementErrorResponse::class, $response );
309-
$this->assertSame( $response->getCode(), ErrorResponse::INVALID_OPERATION_CHANGED_PROPERTY );
309+
$this->assertSame( ErrorResponse::INVALID_OPERATION_CHANGED_PROPERTY, $response->getCode() );
310310
}
311311

312312
public function testRejectsStatementIdChange(): void {
@@ -336,7 +336,7 @@ public function testRejectsStatementIdChange(): void {
336336
);
337337

338338
$this->assertInstanceOf( PatchItemStatementErrorResponse::class, $response );
339-
$this->assertSame( $response->getCode(), ErrorResponse::INVALID_OPERATION_CHANGED_STATEMENT_ID );
339+
$this->assertSame( ErrorResponse::INVALID_OPERATION_CHANGED_STATEMENT_ID, $response->getCode() );
340340
}
341341

342342
public function testGivenProtectedItem_returnsErrorResponse(): void {

repo/tests/phpunit/includes/Store/Sql/DispatchStatsTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testGetDispatchStats_empty(): void {
5252

5353
$actualStats = $dispatchStats->getDispatchStats();
5454

55-
$this->assertSame( $actualStats, [ 'numberOfChanges' => 0 ] );
55+
$this->assertSame( [ 'numberOfChanges' => 0 ], $actualStats );
5656
}
5757

5858
public function testGetDispatchStats_exact(): void {
@@ -67,12 +67,12 @@ public function testGetDispatchStats_exact(): void {
6767

6868
$actualStats = $dispatchStats->getDispatchStats();
6969

70-
$this->assertSame( $actualStats, [
70+
$this->assertSame( [
7171
'numberOfChanges' => 3,
7272
'numberOfEntities' => 2,
7373
'freshestTime' => '20211018155646',
7474
'stalestTime' => '20211018155100',
75-
] );
75+
], $actualStats );
7676
}
7777

7878
public function testGetDispatchStats_estimated(): void {
@@ -87,11 +87,11 @@ public function testGetDispatchStats_estimated(): void {
8787

8888
$actualStats = $dispatchStats->getDispatchStats();
8989

90-
$this->assertSame( $actualStats, [
90+
$this->assertSame( [
9191
'estimatedNumberOfChanges' => 30000,
9292
'freshestTime' => '20211018155646',
9393
'stalestTime' => '20211018155100',
94-
] );
94+
], $actualStats );
9595
}
9696

9797
public function testGetDispatchStats_estimateOutdated(): void {
@@ -106,11 +106,11 @@ public function testGetDispatchStats_estimateOutdated(): void {
106106

107107
$actualStats = $dispatchStats->getDispatchStats();
108108

109-
$this->assertSame( $actualStats, [
109+
$this->assertSame( [
110110
'minimumNumberOfChanges' => 5001,
111111
'freshestTime' => '20211018155646',
112112
'stalestTime' => '20211018155100',
113-
] );
113+
], $actualStats );
114114
}
115115

116116
}

repo/tests/phpunit/includes/WikibasePingbackTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,18 @@ public function testWikibasePingbackSchedules() {
112112
$buffer = $logger->getBuffer();
113113
$this->assertCount( 2, $buffer );
114114
$this->assertSame(
115-
$buffer[0],
116115
[
117116
LogLevel::DEBUG,
118117
'Wikibase\Repo\WikibasePingback::sendPingback: pingback sent OK (' . self::TEST_KEY . ')',
119-
]
118+
],
119+
$buffer[0]
120120
);
121121
$this->assertSame(
122-
$buffer[1],
123122
[
124123
LogLevel::DEBUG,
125124
'Wikibase\Repo\WikibasePingback::sendPingback: pingback sent OK (' . self::TEST_KEY . ')',
126-
]
125+
],
126+
$buffer[1]
127127
);
128128
MWTimestamp::setFakeTime( false );
129129
$logger->clearBuffer();

0 commit comments

Comments
 (0)