Skip to content

Commit

Permalink
Merge pull request #54 from reedy/php8
Browse files Browse the repository at this point in the history
Swap to mediawiki/mediawiki-codesniffer and related updates
  • Loading branch information
JeroenDeDauw authored Dec 12, 2024
2 parents 11fd598 + f9cf71c commit cff89d8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
fail-fast: false
matrix:
php:
- '7.2'
- '7.3'
- '7.4'

steps:
Expand Down
14 changes: 11 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"irc": "irc://irc.freenode.net/wikidata"
},
"require": {
"php": ">=7.2",
"php": ">=7.4",
"data-values/data-values": "~3.0|~2.0|~1.0|~0.1",
"serialization/serialization": "~4.0|~3.0"
},
"require-dev": {
"phpunit/phpunit": "~8.5",
"wikibase/wikibase-codesniffer": "^1.2.0"
"mediawiki/mediawiki-codesniffer": "45.0.0",
"phpunit/phpunit": "~8.5"
},
"autoload": {
"psr-4": {
Expand All @@ -47,6 +47,14 @@
"composer validate --no-interaction",
"phpcs -p -s",
"phpunit"
],
"fix": [
"phpcbf"
]
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
6 changes: 4 additions & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/wikibase/wikibase-codesniffer/Wikibase" />

<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
</rule>
<file>.</file>
</ruleset>
2 changes: 1 addition & 1 deletion tests/Deserializers/DataValueDeserializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testGivenEmptyArray_isDeserializerForReturnsFalse() {

private function newDeserializer() {
return new DataValueDeserializer( [
'boolean' => function( $bool ) {
'boolean' => static function ( $bool ) {
return new BooleanValue( $bool );
},
'number' => NumberValue::class,
Expand Down
2 changes: 1 addition & 1 deletion tests/Serializers/DataValueSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testWhenGivenDataValue_SerializeCallsToArray() {
$dataValue = $this->createMock( DataValue::class );
$dataValue->expects( $this->once() )
->method( 'toArray' )
->will( $this->returnValue( $returnValue ) );
->willReturn( $returnValue );

$this->assertEquals( $returnValue, $serializer->serialize( $dataValue ) );
}
Expand Down

0 comments on commit cff89d8

Please sign in to comment.