Class Drupal\address\Event\AddressFormatEvent extends deprecated class Symfony\Component\EventDispatcher\Event

Created on 1 August 2021, over 3 years ago
Updated 21 May 2023, almost 2 years ago

Problem/Motivation

Address is a popular module, which, should support Drupal 9.

Note that currently Drupal 9.0 is not supported anymore, in Drupal 9.1+, address module has this deprecation notices in many places, when you run
php vendor/bin/phpstan analyze --level 0 web/modules/contrib/address/

you got

 ------ ----------------------------------------------------------------------------------------------------------------- 
  Line   src/Event/AddressFormatEvent.php                                                                                 
 ------ ----------------------------------------------------------------------------------------------------------------- 
  13     Class Drupal\address\Event\AddressFormatEvent extends deprecated class Symfony\Component\EventDispatcher\Event:  
         since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead                                         
 ------ ----------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------------------------------------------- 
  Line   src/Event/AvailableCountriesEvent.php                                                                                 
 ------ ---------------------------------------------------------------------------------------------------------------------- 
  14     Class Drupal\address\Event\AvailableCountriesEvent extends deprecated class Symfony\Component\EventDispatcher\Event:  
         since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead                                              
 ------ ---------------------------------------------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------------------------- 
  Line   src/Event/InitialValuesEvent.php                                                                                 
 ------ ----------------------------------------------------------------------------------------------------------------- 
  14     Class Drupal\address\Event\InitialValuesEvent extends deprecated class Symfony\Component\EventDispatcher\Event:  
         since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead                                         
 ------ ----------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------------------------------------- 
  Line   src/Event/SubdivisionsEvent.php                                                                                 
 ------ ---------------------------------------------------------------------------------------------------------------- 
  14     Class Drupal\address\Event\SubdivisionsEvent extends deprecated class Symfony\Component\EventDispatcher\Event:  
         since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead                                        
 ------ ---------------------------------------------------------------------------------------------------------------- 

Steps to reproduce

Proposed resolution

I think we can use a similar approach in this patch: https://git.drupalcode.org/project/hook_event_dispatcher/-/merge_request...

It basically replace the deprecated Symfony\Component\EventDispatcher\Event with Drupal\Component\EventDispatcher\Event, which is added in Drupal 9.1 as a stop gap solution for the future.

Remaining tasks

Create a patch.

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇨🇦Canada yang_yi_cn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024