Use explicit nullable type on parameter arguments (for PHP 8.4)

Implicitly marking parameter $... as nullable is deprecated in PHP
8.4. The explicit nullable type must be used instead.

Bug: T376276
Change-Id: Ibd54adb359d2993663db6453e83245d1335ccf63
This commit is contained in:
Andre Klapper 2024-10-26 15:12:09 +02:00 committed by Umherirrender
parent b7d811c613
commit 38e1d50414
2 changed files with 1 additions and 2 deletions

View file

@ -1,7 +1,6 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Usage.NullableType.ExplicitNullableTypes" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
</rule>

View file

@ -730,7 +730,7 @@ class TemplateDataBlobTest extends MediaWikiIntegrationTestCase {
* @param stdClass $actual
* @param string|null $message
*/
private function assertStrictJsonEquals( string $expected, stdClass $actual, string $message = null ): void {
private function assertStrictJsonEquals( string $expected, stdClass $actual, ?string $message = null ): void {
// Lazy recursive strict comparison: Serialise to JSON and compare that
// Sort first to ensure key-order
$expected = json_decode( $expected, /* assoc = */ true );