Skip to content
Snippets Groups Projects
Commit fcfc04e0 authored by Qiangjun Ran's avatar Qiangjun Ran Committed by Qiangjun Ran
Browse files

Issue #3342639 by jungle: Calling the...

Issue #3342639 by jungle: Calling the Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch() method with a string event name as the first argument is deprecated
parent 6ebb1e7d
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
namespace Drupal\events_example\Event;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Wraps a incident report event for event subscribers.
......
......@@ -15,7 +15,7 @@
* The submitForm() method of this class demonstrates using the event dispatcher
* service to dispatch an event.
*
* @see \Drupal\events_exampl\Event\IncidentEvents
* @see \Drupal\events_example\Event\IncidentEvents
* @see \Drupal\events_example\Event\IncidentReportEvent
* @see \Symfony\Component\EventDispatcher\EventDispatcherInterface
* @see \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher
......@@ -124,7 +124,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
// to represent the event being dispatched. The constant serves as a
// location for documentation of the event, and ensures your code is future
// proofed against event name changes.
$this->eventDispatcher->dispatch(IncidentEvents::NEW_REPORT, $event);
$this->eventDispatcher->dispatch($event, IncidentEvents::NEW_REPORT);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment