1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-13 05:06:37 +02:00

Merge pull request #5866 from mrgoldy/ticket/16379

[ticket/16379] Update deprecated event dispatcher class
This commit is contained in:
Marc Alexander
2020-03-01 18:59:43 +01:00

View File

@ -13,11 +13,11 @@
namespace phpbb\event; namespace phpbb\event;
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\Event;
/** /**
* Extension of the Symfony2 EventDispatcher * Extension of the Symfony EventDispatcher
* *
* It provides an additional `trigger_event` method, which * It provides an additional `trigger_event` method, which
* gives some syntactic sugar for dispatching events. Instead * gives some syntactic sugar for dispatching events. Instead
@ -30,7 +30,7 @@ use Symfony\Component\EventDispatcher\Event;
* extract($phpbb_dispatcher->trigger_event('core.index', compact($vars))); * extract($phpbb_dispatcher->trigger_event('core.index', compact($vars)));
* *
*/ */
class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_interface class dispatcher extends EventDispatcher implements dispatcher_interface
{ {
/** /**
* @var bool * @var bool
@ -40,7 +40,7 @@ class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_int
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function trigger_event($eventName, $data = array()) public function trigger_event($eventName, $data = [])
{ {
$event = new \phpbb\event\data($data); $event = new \phpbb\event\data($data);
$this->dispatch($eventName, $event); $this->dispatch($eventName, $event);