diff --git a/lib/SystemTag/SystemTagObjectMapperWithoutActivityFactory.php b/lib/SystemTag/SystemTagObjectMapperWithoutActivityFactory.php index 20720130..b708a7b9 100644 --- a/lib/SystemTag/SystemTagObjectMapperWithoutActivityFactory.php +++ b/lib/SystemTag/SystemTagObjectMapperWithoutActivityFactory.php @@ -4,9 +4,10 @@ use OC\SystemTag\SystemTagObjectMapper; use OCP\EventDispatcher\Event; -use OCP\EventDispatcher\IEventDispatcher; use OCP\IDBConnection; use OCP\SystemTag\ISystemTagManager; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; class SystemTagObjectMapperWithoutActivityFactory { @@ -18,39 +19,51 @@ public static function createSilentSystemTagObjectMapper(IDBConnection $connecti return new SystemTagObjectMapper($connection, $tagManager, self::createFakeEventDispatcher()); } - private static function createFakeEventDispatcher(): IEventDispatcher + private static function createFakeEventDispatcher(): EventDispatcherInterface { - return new class implements IEventDispatcher { - public function addListener(string $eventName, callable $listener, int $priority = 0): void - { - // DUMMY - } - - public function removeListener(string $eventName, callable $listener): void - { - // DUMMY - } - - public function addServiceListener(string $eventName, string $className, int $priority = 0): void - { - // DUMMY - } - - public function hasListeners(string $eventName): bool - { - // DUMMY - return false; - } - - public function dispatch(string $eventName, Event $event): void - { - // DUMMY - } - - public function dispatchTyped(Event $event): void - { - // DUMMY - } - }; + return new class implements EventDispatcherInterface { + + public function addListener(string $eventName, callable $listener, int $priority = 0) + { + // DUMMY + } + + public function addSubscriber(EventSubscriberInterface $subscriber) + { + // DUMMY + } + + public function removeListener(string $eventName, callable $listener) + { + // DUMMY + } + + public function removeSubscriber(EventSubscriberInterface $subscriber) + { + // DUMMY + } + + public function getListeners(?string $eventName = null) + { + // DUMMY + } + + public function dispatch(object $event, ?string $eventName = null): object + { + // DUMMY + return new Event(); + } + + public function getListenerPriority(string $eventName, callable $listener) + { + // DUMMY + } + + public function hasListeners(?string $eventName = null) + { + // DUMMY + return false; + } + }; } }