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 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)

Does change function signatures so may be best to have a new major version

📌 Task
Status

Active

Version

4.0

Component

Miscellaneous

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 !873492417 fix nullable types → (Open) created by nickdickinsonwilde
  • 🇨🇦Canada nickdickinsonwilde Victoria, BC (T'So-uke lands)
  • Pipeline finished with Success
    5 months ago
    Total: 403s
    #362045
  • Looks good to me.

    This of course also affects 3.x.

  • 🇬🇧United Kingdom MrDaleSmith

    I still get a lot of depecations after applying the changes in the code:

    PHP Deprecated:  field_group_form_process(): Implicitly marking parameter $form_state as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 426
    
    Deprecated: field_group_form_process(): Implicitly marking parameter $form_state as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 426
    PHP Deprecated:  field_group_field_group_form_process_build_alter(): Implicitly marking parameter $form_state as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 493
    
    Deprecated: field_group_field_group_form_process_build_alter(): Implicitly marking parameter $form_state as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 493
    PHP Deprecated:  field_group_fields_nest(): Implicitly marking parameter $vars as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 637
    
    Deprecated: field_group_fields_nest(): Implicitly marking parameter $vars as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 637
    PHP Deprecated:  field_group_field_layout_fields_nest(): Implicitly marking parameter $vars as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 730
    
    Deprecated: field_group_field_layout_fields_nest(): Implicitly marking parameter $vars as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 730
    PHP Deprecated:  field_group_group_save(): Implicitly marking parameter $display as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 877
    
    Deprecated: field_group_group_save(): Implicitly marking parameter $display as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/www/modules/contrib/field_group/field_group.module on line 877
    
    
  • 🇬🇧United Kingdom MrDaleSmith

    Updated MR with additional instances. Ready for review again.

  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
Production build 0.71.5 2024