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: I6b296c77f8a2f6f1a146972271b1fcb3360d0cc2
This commit is contained in:
Andre Klapper 2024-10-26 15:18:21 +02:00
parent d088ccdab0
commit 90aa7fd9cf
3 changed files with 7 additions and 7 deletions

View file

@ -110,7 +110,7 @@ trait ApiParsoidTrait {
* @throws ApiUsageException
*/
protected function transformHTML(
Title $title, string $html, int $oldid = null, string $etag = null
Title $title, string $html, ?int $oldid = null, ?string $etag = null
): array {
$lang = self::getPageLanguage( $title );
@ -138,7 +138,7 @@ trait ApiParsoidTrait {
* @throws ApiUsageException
*/
protected function transformWikitext(
Title $title, string $wikitext, bool $bodyOnly, int $oldid = null, bool $stash = false
Title $title, string $wikitext, bool $bodyOnly, ?int $oldid = null, bool $stash = false
): array {
$lang = self::getPageLanguage( $title );

View file

@ -48,7 +48,7 @@ class DirectParsoidClient implements ParsoidClient {
private function getHtmlOutputRendererHelper(
PageIdentity $page,
?RevisionRecord $revision = null,
Bcp47Code $pageLanguage = null,
?Bcp47Code $pageLanguage = null,
bool $stash = false,
string $flavor = self::FLAVOR_DEFAULT
): HtmlOutputRendererHelper {
@ -83,9 +83,9 @@ class DirectParsoidClient implements ParsoidClient {
private function getHtmlInputTransformHelper(
PageIdentity $page,
string $html,
int $oldid = null,
string $etag = null,
Bcp47Code $pageLanguage = null
?int $oldid = null,
?string $etag = null,
?Bcp47Code $pageLanguage = null
): HtmlInputTransformHelper {
// Fake REST body
$body = [

View file

@ -117,7 +117,7 @@ class VisualEditorDataModule extends ResourceLoaderModule {
/**
* @inheritDoc
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
public function getDependencies( ?ResourceLoaderContext $context = null ) {
return [
'ext.visualEditor.base',
'ext.visualEditor.mediawiki',