[PHP 8.4] Fix implicitly nullable type declarations

Created on 15 March 2024, 10 months ago

Problem/Motivation

In PHP 8.4, declaring functions/methods with parameters containing null as a default value, but without null as one of the types (either as a nullable syntax or as a Union type with null) is deprecated.

Steps to reproduce

Run Drupal in PHP 8.4.

Proposed resolution

Update all instances of such declarations to use Union types or nullable types.

This is a rather big set of changes. To replicate the results:

php-cs-fixer fix . --rules nullable_type_declaration_for_default_null_value

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Several fixes in Drupal core to fix the deprecation notices due on implicitly nullable function/method parameter declarations.

See:

📌 Task
Status

Active

Version

11.0 🔥

Component
Base  →

Last updated about 2 hours ago

Created by

🇱🇰Sri Lanka Ayesh Everywhere

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024