Nullable types must be explicit

Created on 7 December 2024, 5 months ago

Problem/Motivation

PHP 8.4 has deprecated implicit nullable types.

Steps to reproduce

Use config split in a PHP 8.4 environment

Proposed resolution

Use explicit nullable types (compatible with PHP 7.1+ so no compatibility concerns given Drupal core PHP minimums)

📌 Task
Status

Active

Version

2.0

Component

Documentation

Created by

🇨🇦Canada nickdickinsonwilde Victoria, BC (T'So-uke lands)

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

Merge Requests

Comments & Activities

  • Issue created by @nickdickinsonwilde
  • Merge request !513492375 fix nullable types → (Open) created by nickdickinsonwilde
  • 🇨🇦Canada nickdickinsonwilde Victoria, BC (T'So-uke lands)
  • Pipeline finished with Failed
    5 months ago
    Total: 363s
    #361750
  • 🇬🇧United Kingdom MrDaleSmith

    Not sure what the test failures are caused by, but this applies cleanly and resolves the issue for me.

  • 🇵🇰Pakistan a_z_official

    I am getting the same.
    Running drush cr on my Drupal site with PHP 8.4.3 produces deprecation warnings related to implicitly nullable parameters in the config_split module.
    Steps to Reproduce:
    1. Install the latest version of config_split.
    2. Use PHP 8.4.3.
    3. Run drush cr.
    Actual Result:
    Deprecation warnings appear in the logs:

    PHP Deprecated:  Drupal\config_split\EventSubscriber\SplitImportExportSubscriber::getDefaultPrioritySplitConfigs(): Implicitly marking parameter $storage as nullable is deprecated, the explicit nullable type must be used instead in /web/modules/contrib/config_split/src/EventSubscriber/SplitImportExportSubscriber.php on line 123
    
    PHP Deprecated:  Drupal\config_split\Form\ConfigImportFormTrait::launchImport(): Implicitly marking parameter $override as nullable is deprecated, the explicit nullable type must be used instead in /web/modules/contrib/config_split/src/Form/ConfigImportFormTrait.php on line 203
    

    Expected Result:
    No deprecation warnings should appear when running drush cr.

  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • 🇳🇴Norway jonsimonsen

    I believe all the changes in the MR are now applied in the latest version. I removed the patch, and don't see any errors when running drush commands at least (how I noticed the issue before I added the patch). I assume the issue can be marked accordingly

Production build 0.71.5 2024