Problem/Motivation

We're running the 2.1.0-beta1 version of the module on Drupal 11.3.3, and it looks like it needs an update for PHP compatibility. When running on PHP 8.4.4, drush commands will generate the following deprecation notice:

PHP Deprecated: Drupal\emaillog\Form\EmaillogConfigForm::buildForm(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/docroot/modules/contrib/logging_alerts/emaillog/src/Form/EmaillogConfigForm.php on line 34

Steps to reproduce

Install and enable version 2.1.0-beta1 on a Drupal 11 site in an environment running PHP 8.4.4, and run any drush command.

Proposed resolution

The buildForm function in /emaillog/src/Form/EmaillogConfigForm.php has the $request parameter as implicitly nullable:
public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL)

Changing this to explicitly nullable resolves the warning:
public function buildForm(array $form, FormStateInterface $form_state, ?Request $request = NULL)

Remaining tasks

Create a MR with the above change.

User interface changes

No UI changes.

API changes

No API changes.

Data model changes

No data model changes.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dbrownmt created an issue.

dbrownmt’s picture

I opened an MR with a resolution for the issue.