File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,12 @@ can also be applied to methods directly::
210210            // ... 
211211        } 
212212
213+         #[AsEventListener] 
214+         public function onMultipleCustomEvent(CustomEvent|AnotherCustomEvent $event): void 
215+         { 
216+             // ... 
217+         } 
218+ 
213219        #[AsEventListener(event: 'foo', priority: 42)] 
214220        public function onFoo(): void 
215221        { 
@@ -228,6 +234,11 @@ can also be applied to methods directly::
228234    Note that the attribute doesn't require its ``event `` parameter to be set
229235    if the method already type-hints the expected event.
230236
237+ .. versionadded :: 7.4 
238+ 
239+     Support for union types in the ``$event `` argument of methods using the
240+     ``#[AsEventListener] `` attribute was introduced in Symfony 7.4.
241+ 
231242.. _events-subscriber :
232243
233244Creating an Event Subscriber
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments