Address Symfony Event Class deprecations

Created on 8 June 2020, almost 5 years ago
Updated 28 May 2024, 11 months ago

Problem/Motivation

drupal-check reported the following errors when running against a codebase using Drupal core 9.0.0 and the latest 8.x-1.x version of the CAS module:

------ ------------------------------------------------------------------- 
 Line   modules/contrib/cas/src/Event/CasPostLoginEvent.php                
------ ------------------------------------------------------------------- 
 17     Class Drupal\cas\Event\CasPostLoginEvent extends deprecated class  
        Symfony\Component\EventDispatcher\Event:                           
        since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event"   
        instead                                                            
------ ------------------------------------------------------------------- 

------ ---------------------------------------------------------------------- 
 Line   modules/contrib/cas/src/Event/CasPostValidateEvent.php                
------ ---------------------------------------------------------------------- 
 18     Class Drupal\cas\Event\CasPostValidateEvent extends deprecated class  
        Symfony\Component\EventDispatcher\Event:                              
        since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event"      
        instead                                                               
------ ---------------------------------------------------------------------- 

------ ------------------------------------------------------------------ 
 Line   modules/contrib/cas/src/Event/CasPreLoginEvent.php                
------ ------------------------------------------------------------------ 
 26     Class Drupal\cas\Event\CasPreLoginEvent extends deprecated class  
        Symfony\Component\EventDispatcher\Event:                          
        since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event"  
        instead                                                           
------ ------------------------------------------------------------------ 

------ --------------------------------------------------------------------- 
 Line   modules/contrib/cas/src/Event/CasPreRedirectEvent.php                
------ --------------------------------------------------------------------- 
 28     Class Drupal\cas\Event\CasPreRedirectEvent extends deprecated class  
        Symfony\Component\EventDispatcher\Event:                             
        since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event"     
        instead                                                              
------ --------------------------------------------------------------------- 

------ --------------------------------------------------------------------- 
 Line   modules/contrib/cas/src/Event/CasPreRegisterEvent.php                
------ --------------------------------------------------------------------- 
 28     Class Drupal\cas\Event\CasPreRegisterEvent extends deprecated class  
        Symfony\Component\EventDispatcher\Event:                             
        since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event"     
        instead                                                              
------ --------------------------------------------------------------------- 

------ --------------------------------------------------------------------- 
 Line   modules/contrib/cas/src/Event/CasPreUserLoadEvent.php                
------ --------------------------------------------------------------------- 
 19     Class Drupal\cas\Event\CasPreUserLoadEvent extends deprecated class  
        Symfony\Component\EventDispatcher\Event:                             
        since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event"     
        instead                                                              
------ --------------------------------------------------------------------- 

------ ----------------------------------------------------------------------- 
 Line   modules/contrib/cas/src/Event/CasPreUserLoadRedirectEvent.php          
------ ----------------------------------------------------------------------- 
 32     Class Drupal\cas\Event\CasPreUserLoadRedirectEvent extends deprecated  
        class Symfony\Component\EventDispatcher\Event:                         
        since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event"       
        instead                                                                
------ ----------------------------------------------------------------------- 

------ --------------------------------------------------------------------- 
 Line   modules/contrib/cas/src/Event/CasPreValidateEvent.php                
------ --------------------------------------------------------------------- 
 21     Class Drupal\cas\Event\CasPreValidateEvent extends deprecated class  
        Symfony\Component\EventDispatcher\Event:                             
        since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event"     
        instead                                                              
------ --------------------------------------------------------------------- 

Proposed resolution

Replace deprecated usage of Symfony\Component\EventDispatcher\Event class with Symfony\Contracts\EventDispatcher\Event.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

CAS

Created by

πŸ‡ΊπŸ‡ΈUnited States trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

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