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: Ifb189a3fcacc971ff43ff44d5ffc564f068a7da0
This commit is contained in:
Andre Klapper 2024-10-26 14:58:16 +02:00 committed by Umherirrender
parent 0c69d565db
commit a5a82dd683
2 changed files with 2 additions and 4 deletions

View file

@ -1,8 +1,6 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Usage.NullableType.ExplicitNullableTypes" />
</rule>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
<file>.</file>
<arg name="extensions" value="php"/>
<arg name="encoding" value="UTF-8"/>

View file

@ -51,7 +51,7 @@ class HTMLFancyCaptchaFieldTest extends MediaWikiIntegrationTestCase {
$form->trySubmit();
}
protected function getForm( $params = [], WebRequest $request = null ) {
protected function getForm( $params = [], ?WebRequest $request = null ) {
if ( $request ) {
$context = new DerivativeContext( RequestContext::getMain() );
$context->setRequest( $request );