aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-07-27 22:37:15 +0200
committerJoas Schilling <coding@schilljs.com>2023-07-28 14:11:20 +0200
commitcebf93d4d2bd9bb51173f5caeb7ec495da19f8de (patch)
tree8468a7e38208d95d74860ccc7757f4be8b50e491
parent22e033b628d7edf10a184976c6884647fa338dd7 (diff)
downloadnextcloud-server-cebf93d4d2bd9bb51173f5caeb7ec495da19f8de.tar.gz
nextcloud-server-cebf93d4d2bd9bb51173f5caeb7ec495da19f8de.zip
fix: Remove legacy dispatcher from share manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--apps/files_sharing/tests/CapabilitiesTest.php2
-rw-r--r--lib/private/Server.php1
-rw-r--r--lib/private/Share20/Manager.php6
-rw-r--r--tests/lib/Share20/LegacyHooksTest.php2
-rw-r--r--tests/lib/Share20/ManagerTest.php15
5 files changed, 0 insertions, 26 deletions
diff --git a/apps/files_sharing/tests/CapabilitiesTest.php b/apps/files_sharing/tests/CapabilitiesTest.php
index fcefc556203..0d21718f98a 100644
--- a/apps/files_sharing/tests/CapabilitiesTest.php
+++ b/apps/files_sharing/tests/CapabilitiesTest.php
@@ -46,7 +46,6 @@ use OCP\Security\IHasher;
use OCP\Security\ISecureRandom;
use OCP\Share\IProviderFactory;
use Psr\Log\LoggerInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Class CapabilitiesTest
@@ -90,7 +89,6 @@ class CapabilitiesTest extends \Test\TestCase {
$this->createMock(IProviderFactory::class),
$this->createMock(IUserManager::class),
$this->createMock(IRootFolder::class),
- $this->createMock(EventDispatcherInterface::class),
$this->createMock(IMailer::class),
$this->createMock(IURLGenerator::class),
$this->createMock(\OC_Defaults::class),
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 8640fa3e38c..6c16278b044 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -1237,7 +1237,6 @@ class Server extends ServerContainer implements IServerContainer {
$factory,
$c->get(IUserManager::class),
$c->get(IRootFolder::class),
- $c->get(SymfonyAdapter::class),
$c->get(IMailer::class),
$c->get(IURLGenerator::class),
$c->get('ThemingDefaults'),
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index be5b70749da..9360046bc24 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -80,8 +80,6 @@ use OCP\Share\IProviderFactory;
use OCP\Share\IShare;
use OCP\Share\IShareProvider;
use Psr\Log\LoggerInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\GenericEvent;
/**
* This class is the communication hub for all sharing related operations.
@@ -110,8 +108,6 @@ class Manager implements IManager {
private $rootFolder;
/** @var CappedMemoryCache */
private $sharingDisabledForUsersCache;
- /** @var EventDispatcherInterface */
- private $legacyDispatcher;
/** @var LegacyHooks */
private $legacyHooks;
/** @var IMailer */
@@ -139,7 +135,6 @@ class Manager implements IManager {
IProviderFactory $factory,
IUserManager $userManager,
IRootFolder $rootFolder,
- EventDispatcherInterface $legacyDispatcher,
IMailer $mailer,
IURLGenerator $urlGenerator,
\OC_Defaults $defaults,
@@ -158,7 +153,6 @@ class Manager implements IManager {
$this->factory = $factory;
$this->userManager = $userManager;
$this->rootFolder = $rootFolder;
- $this->legacyDispatcher = $legacyDispatcher;
$this->sharingDisabledForUsersCache = new CappedMemoryCache();
// The constructor of LegacyHooks registers the listeners of share events
// do not remove if those are not properly migrated
diff --git a/tests/lib/Share20/LegacyHooksTest.php b/tests/lib/Share20/LegacyHooksTest.php
index c16480f6aba..728f320ea9e 100644
--- a/tests/lib/Share20/LegacyHooksTest.php
+++ b/tests/lib/Share20/LegacyHooksTest.php
@@ -23,7 +23,6 @@
namespace Test\Share20;
-use OC\EventDispatcher\SymfonyAdapter;
use OC\Share20\LegacyHooks;
use OC\Share20\Manager;
use OCP\Constants;
@@ -38,7 +37,6 @@ use OCP\Share\Events\ShareDeletedEvent;
use OCP\Share\Events\ShareDeletedFromSelfEvent;
use OCP\Share\IShare;
use Psr\Log\LoggerInterface;
-use Symfony\Component\EventDispatcher\GenericEvent;
use Test\TestCase;
class LegacyHooksTest extends TestCase {
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index c15d0456d48..e8704600e2a 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -65,8 +65,6 @@ use OCP\Share\IShareProvider;
use PHPUnit\Framework\MockObject\MockBuilder;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\GenericEvent;
/**
* Class ManagerTest
@@ -101,8 +99,6 @@ class ManagerTest extends \Test\TestCase {
protected $userManager;
/** @var IRootFolder | MockObject */
protected $rootFolder;
- /** @var EventDispatcherInterface | MockObject */
- protected $eventDispatcher;
/** @var IEventDispatcher|MockObject */
protected $dispatcher;
/** @var IMailer|MockObject */
@@ -125,7 +121,6 @@ class ManagerTest extends \Test\TestCase {
$this->groupManager = $this->createMock(IGroupManager::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->rootFolder = $this->createMock(IRootFolder::class);
- $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
$this->mailer = $this->createMock(IMailer::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->defaults = $this->createMock(\OC_Defaults::class);
@@ -158,7 +153,6 @@ class ManagerTest extends \Test\TestCase {
$this->factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,
@@ -189,7 +183,6 @@ class ManagerTest extends \Test\TestCase {
$this->factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,
@@ -2755,7 +2748,6 @@ class ManagerTest extends \Test\TestCase {
$factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,
@@ -2801,7 +2793,6 @@ class ManagerTest extends \Test\TestCase {
$factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,
@@ -2854,7 +2845,6 @@ class ManagerTest extends \Test\TestCase {
$factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,
@@ -4196,7 +4186,6 @@ class ManagerTest extends \Test\TestCase {
$factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,
@@ -4231,7 +4220,6 @@ class ManagerTest extends \Test\TestCase {
$factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,
@@ -4297,7 +4285,6 @@ class ManagerTest extends \Test\TestCase {
$factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,
@@ -4415,7 +4402,6 @@ class ManagerTest extends \Test\TestCase {
$factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,
@@ -4542,7 +4528,6 @@ class ManagerTest extends \Test\TestCase {
$factory,
$this->userManager,
$this->rootFolder,
- $this->eventDispatcher,
$this->mailer,
$this->urlGenerator,
$this->defaults,