diff --git a/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php b/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php index 31b5d04ad8..ff9ae3bea6 100644 --- a/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php +++ b/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php @@ -106,7 +106,7 @@ public function dispatch($event/*, string $event_name = NULL*/) { // in the Symfony namespace or a different one, we have to assume those // will be updated by the dependency itself. Exclude the Drupal Event // bridge class as a special case, otherwise it's pointless. - if ($class_name !== 'Drupal\Component\EventDispatcher\Event' && strpos($class_name, 'Drupal') !== FALSE) { + elseif ($class_name !== 'Drupal\Component\EventDispatcher\Event' && strpos($class_name, 'Drupal') !== FALSE) { if (get_parent_class($event) === 'Symfony\Component\EventDispatcher\Event') { @trigger_error($deprecation_message, E_USER_DEPRECATED); }