Skip to content

Commit f3f36d7

Browse files
lucaswerkmeisterWMDE bot
authored andcommitted
Update mediawiki/codesniffer to 42.0.0
Two main changes: - list() to []. Several IDEs already started autofixing this on save, introducing unrelated noise into random commits, so I’m glad to get this over with. - Nicer PHPUnit usage (less ->will()). I had previously done something similar in change Iac24de03f2 (commit 8c44612b9f), but doing it in phpcs is of course more thorough and ensures it doesn’t regress. The MediaWiki.WhiteSpace.DisallowEmptyLineFunctions rule was replaced with Squiz.WhiteSpace.FunctionOpeningBraceSpace upstream, so just update our exclusion for that. Two new phpcs rules are suppressed, the $wgHooks one hopefully only temporarily. Also, I manually fixed the indentation in BaseUriExtractorTest.php and EntityLinkFormatterFactoryTest.php. Change-Id: I4cb9b54d227119d5febe6331689df1be515f2ec7
1 parent faeca74 commit f3f36d7

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/Entity/EntityIdValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function unserialize( $serialized ) {
8181
return;
8282
}
8383

84-
list( $entityType, $numericId ) = $array;
84+
[ $entityType, $numericId ] = $array;
8585

8686
try {
8787
$entityId = LegacyIdInterpreter::newIdFromTypeAndNumber( $entityType, $numericId );

src/Snak/PropertyValueSnak.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function __serialize(): array {
109109
}
110110

111111
public function __unserialize( array $serialized ): void {
112-
list( $propertyId, $this->dataValue ) = $serialized;
112+
[ $propertyId, $this->dataValue ] = $serialized;
113113

114114
if ( is_string( $propertyId ) ) {
115115
$this->propertyId = new NumericPropertyId( $propertyId );

tests/unit/Statement/StatementListTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ private function getStatement(
4545

4646
$statement->expects( $this->any() )
4747
->method( 'getGuid' )
48-
->will( $this->returnValue( $guid ) );
48+
->willReturn( $guid );
4949

5050
$statement->expects( $this->any() )
5151
->method( 'getPropertyId' )
52-
->will( $this->returnValue( new NumericPropertyId( $propertyId ) ) );
52+
->willReturn( new NumericPropertyId( $propertyId ) );
5353

5454
$statement->expects( $this->any() )
5555
->method( 'getRank' )
56-
->will( $this->returnValue( $rank ) );
56+
->willReturn( $rank );
5757

5858
return $statement;
5959
}

0 commit comments

Comments
 (0)