Problem/Motivation

When updating from php 8.3 > 8.4 on a Drupal 11.3 site, all Drush commands throw multiple deprecation warnings:

Deprecated: Drupal\trailing_slash\PathProcessor\TrailingSlashOutboundPathProcessor::processOutbound(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/trailing_slash/src/PathProcessor/TrailingSlashOutboundPathProcessor.php on line 76
Deprecated: Drupal\trailing_slash\PathProcessor\TrailingSlashOutboundPathProcessor::processOutbound(): Implicitly marking parameter $bubbleable_metadata as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/trailing_slash/src/PathProcessor/TrailingSlashOutboundPathProcessor.php on line 76
Deprecated: Drupal\trailing_slash\PathProcessor\TrailingSlashOutboundPathProcessor::isPathWithTrailingSlash(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/trailing_slash/src/PathProcessor/TrailingSlashOutboundPathProcessor.php on line 86
Deprecated: Drupal\trailing_slash\PathProcessor\TrailingSlashOutboundPathProcessor::isPathWithTrailingSlash(): Implicitly marking parameter $bubbleable_metadata as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/trailing_slash/src/PathProcessor/TrailingSlashOutboundPathProcessor.php on line 86

Steps to reproduce

  1. Install Drupal 11.3 on a server with php 8.3
  2. Install the trailing slash module
  3. Update php from 8.3 > 8.4
  4. in the command line, run a Drush command, like $ drush cr

Proposed resolution

Update module code to reflect php 8.4 best practice, to quash deprecation warnings.

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

timfletcher created an issue. See original summary.

timfletcher’s picture

Title: Deprecation warnings when running with PHP 8.4 » Deprecation warnings when running with PHP 8.4: Implicitly marking parameter $request as nullable is deprecated

yusuf_khan made their first commit to this issue’s fork.

yusuf_khan’s picture

Status: Active » Needs review

https://git.drupalcode.org/project/trailing_slash/-/merge_requests/17 - please review the MR that fix the deprecation warnings

yusuf_khan’s picture

@maintainer any update