This repository was archived by the owner on Mar 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 44
55use Symfony \Component \EventDispatcher \Event ;
66use Symfony \Component \EventDispatcher \EventDispatcher ;
7- use Symfony \Component \EventDispatcher \Debug \ TraceableEventDispatcherInterface ;
7+ use Symfony \Contracts \EventDispatcher \EventDispatcherInterface as ContractsEventDispatcherInterface ;
88
99trait DispatcherWrapper
1010{
@@ -16,12 +16,12 @@ trait DispatcherWrapper
1616 */
1717 protected function dispatch (EventDispatcher $ dispatcher , $ eventType , Event $ eventObject )
1818 {
19- //TraceableEventDispatcherInterface was introduced in symfony/event-dispatcher 2.5 and removed in 5.0
20- if (! interface_exists (TraceableEventDispatcherInterface::class) ) {
21- //Symfony 5
19+ // The `EventDispatcherInterface` of `Symfony\Contracts` is only implemented in Symfony 4.3 or higher
20+ if ($ dispatcher instanceof ContractsEventDispatcherInterface ) {
21+ //Symfony 4.3 or higher
2222 $ dispatcher ->dispatch ($ eventObject , $ eventType );
2323 } else {
24- //Symfony 2,3 or 4
24+ //Symfony 4.2 or lower
2525 $ dispatcher ->dispatch ($ eventType , $ eventObject );
2626 }
2727
You can’t perform that action at this time.
0 commit comments