Version 1.11.0 breaks on PHP 7.4

Created on 11 February 2025, 29 days ago

Problem/Motivation

Running "composer update -W" on my Drupal 9 installation upgraded drupal/redirect from 1.7.0 to 1.11.0.
Now I get an error:

ParseError: syntax error,
 unexpected 'protected' (T_PROTECTED), expecting variable (T_VARIABLE)
 in Composer\Autoload\{closure}()
(line 71 of /var/www/drupal/docroot/modules/contrib/redirect/src/EventSubscriber/RouteNormalizerRequestSubscriber.php). 

The culprit are the "protected" inline constructor variable declarations that are not supported in PHP 7.4:

public function __construct(..., protected ?AliasManagerInterface $aliasManager = NULL, protected ?CurrentPathStack $currentPath = NULL)

composer.json does not contain any PHP version limitations, so 1.11.0 gets installed here, although composer knows that PHP 7.4 is used.

The ticket that broke 7.4 support is #3340999, with commit 192d972d50129ecabc471e2517765a7f0c9aa4d2 (released with 1.11.0).

Steps to reproduce

Install drupal/redirect 1.11.0 on a drupal 9.5 system with php 7.4

Proposed resolution

Re-release 1.11.0 with a minimum PHP version requirement in composer.json

🐛 Bug report
Status

Active

Version

1.11

Component

Code

Created by

🇩🇪Germany cweiske

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