PHP 8.4 Implicitly marking parameter as nullable is deprecated

Created on 27 January 2025, 3 months ago

Problem/Motivation

PHP 8.4 has deprecated implicit nullable types, causing deprecation warnings in the change_pwd_page module. These warnings need to be addressed to ensure compatibility with future PHP versions and to maintain clean error logs.

Steps to reproduce

  • Install and enable the change_pwd_page module (version 2.0.0)
  • Use PHP 8.4
  • Clear Drupal cache (e.g., using `drush cr`)
  • Observe the following deprecation warnings:
     PHP Deprecated: Drupal\change_pwd_page\Form\ChangePasswordForm::buildForm(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/change_pwd_page/src/Form/ChangePasswordForm.php on line 68 
    
    PHP Deprecated:  Drupal\config_ignore\Form\IgnoreSettingsForm::buildForm(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /app/web/modules/contrib/config_ignore/src/Form/IgnoreSettingsForm.php on line 36
    

Proposed resolution

Update the method signature in ChangePasswordForm.php and IgnoreSettingsForm to explicitly declare parameters as nullable.

Remaining tasks

  • Update the code to explicitly declare nullable parameters
  • Test the changes to ensure they resolve the deprecation warning
  • Verify that the module's functionality remains intact after the changes
  • Update any relevant documentation or comments in the code

User interface changes

None

API changes

Minor change to method signature, but should not affect external API usage.

Data model changes

None. This change does not affect the data model.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ryankolsen South Carolina

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