Skip to content

Commit

Permalink
Revert "Fix interface usage for backport"
Browse files Browse the repository at this point in the history
This reverts commit ae9649e.
  • Loading branch information
lennartdohmann committed Sep 9, 2024
1 parent ae9649e commit fb6cf1f
Showing 1 changed file with 34 additions and 47 deletions.
81 changes: 34 additions & 47 deletions lib/SystemTag/SystemTagObjectMapperWithoutActivityFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

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
{
Expand All @@ -19,51 +18,39 @@ public static function createSilentSystemTagObjectMapper(IDBConnection $connecti
return new SystemTagObjectMapper($connection, $tagManager, self::createFakeEventDispatcher());
}

private static function createFakeEventDispatcher(): EventDispatcherInterface
private static function createFakeEventDispatcher(): IEventDispatcher
{
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;
}
};
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
}
};
}
}

0 comments on commit fb6cf1f

Please sign in to comment.