From ce5b0d2dfd8a3768f4970d1f59a4f4e2cee7ff85 Mon Sep 17 00:00:00 2001 From: m-h-1 <60962650+m-h-1@users.noreply.github.com> Date: Tue, 18 Feb 2020 09:43:58 +0100 Subject: [PATCH] add symfony 5 support (#61) --- composer.json | 4 ++-- src/MySQLReplication/Event/DTO/EventDTO.php | 6 +++--- src/MySQLReplication/Event/Event.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 73cd352..5000aa5 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,8 @@ "ext-bcmath": "*", "doctrine/dbal": "^2.5", "doctrine/collections": "^1.3", - "symfony/event-dispatcher": "^2.8|^3.1|^4.0", - "symfony/dependency-injection": "^2.8|^3.1|^4.0", + "symfony/event-dispatcher": "^2.8|^3.1|^4.0|^5.0", + "symfony/dependency-injection": "^2.8|^3.1|^4.0|^5.0", "psr/simple-cache": "^1.0" }, "require-dev": { diff --git a/src/MySQLReplication/Event/DTO/EventDTO.php b/src/MySQLReplication/Event/DTO/EventDTO.php index 2396328..5f9cce4 100644 --- a/src/MySQLReplication/Event/DTO/EventDTO.php +++ b/src/MySQLReplication/Event/DTO/EventDTO.php @@ -5,12 +5,12 @@ use JsonSerializable; use MySQLReplication\Event\EventInfo; -use Symfony\Component\EventDispatcher\Event; +use Symfony\Component\EventDispatcher\GenericEvent; /** * @see https://dev.mysql.com/doc/internals/en/event-meanings.html */ -abstract class EventDTO extends Event implements JsonSerializable +abstract class EventDTO extends GenericEvent implements JsonSerializable { protected $eventInfo; @@ -28,4 +28,4 @@ public function getEventInfo(): EventInfo abstract public function getType(): string; abstract public function __toString(): string; -} \ No newline at end of file +} diff --git a/src/MySQLReplication/Event/Event.php b/src/MySQLReplication/Event/Event.php index 71e60c1..bab1e2b 100644 --- a/src/MySQLReplication/Event/Event.php +++ b/src/MySQLReplication/Event/Event.php @@ -129,7 +129,7 @@ private function filterDummyMariaDbEvents(QueryDTO $queryDTO): ?QueryDTO private function dispatch(EventDTO $eventDTO = null): void { if (null !== $eventDTO) { - $this->eventDispatcher->dispatch($eventDTO->getType(), $eventDTO); + $this->eventDispatcher->dispatch($eventDTO, $eventDTO->getType()); } } }