add deprecation warning
authordemeritcowboy <demeritcowboy@hotmail.com>
Wed, 24 May 2023 22:36:21 +0000 (18:36 -0400)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Wed, 24 May 2023 22:57:32 +0000 (18:57 -0400)
Civi/Core/CiviEventDispatcher.php

index 2ddb8634c0f03df4a08ebc3642c2dc9606f62aa9..a1ef3329a04cfe8cdd0cbf86c8a36e3cf94935f9 100644 (file)
@@ -253,6 +253,9 @@ class CiviEventDispatcher implements CiviEventDispatcherInterface {
 
       }
     }
+    if (is_a($event, '\\Symfony\\Component\\EventDispatcher\\Event')) {
+      \CRM_Core_Error::deprecatedWarning('\\Symfony\\Component\\EventDispatcher\\Event is deprecated. Consider using \\Civi\\Core\\Event\\GenericHookEvent. For more information see ' . \CRM_Utils_System::docURL2('dev/hooks/usage/symfony/#events', TRUE));
+    }
     $this->bindPatterns($eventName);
     if ($event === NULL) {
       $event = GenericHookEvent::create([]);