1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/16649] Upgrade to Symfony 5

PHPBB3-16649
This commit is contained in:
rxu
2020-12-01 13:10:45 +07:00
parent 7110b61df5
commit 19b12bf6ee
133 changed files with 524 additions and 190 deletions

View File

@@ -14,7 +14,6 @@
namespace phpbb\event;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\Event;
/**
* Extension of the Symfony EventDispatcher
@@ -43,26 +42,24 @@ class dispatcher extends EventDispatcher implements dispatcher_interface
public function trigger_event($eventName, $data = [])
{
$event = new \phpbb\event\data($data);
$this->dispatch($eventName, $event);
foreach ((array) $eventName as $name)
{
$this->dispatch($event, $name);
}
return $event->get_data_filtered(array_keys($data));
}
/**
* {@inheritdoc}
*/
public function dispatch($eventName, Event $event = null)
public function dispatch(object $event, string $eventName = null) : object
{
if ($this->disabled)
{
return $event;
}
foreach ((array) $eventName as $name)
{
$event = parent::dispatch($name, $event);
}
return $event;
return parent::dispatch($event, $eventName);
}
/**