From 3db38c1f4515e1ba13d9742b41a1b287e0800571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 26 Nov 2019 10:03:07 +0100 Subject: [PATCH] fixup! fixup! Code style fixes and cleanup --- apps/files/lib/Capabilities.php | 10 +++++++++- lib/private/DirectEditing/Manager.php | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/files/lib/Capabilities.php b/apps/files/lib/Capabilities.php index 3393e29b4d23c..19b59971c4cf6 100644 --- a/apps/files/lib/Capabilities.php +++ b/apps/files/lib/Capabilities.php @@ -30,6 +30,8 @@ use OCP\DirectEditing\ACreateEmpty; use OCP\DirectEditing\ACreateFromTemplate; use OCP\DirectEditing\IEditor; +use OCP\DirectEditing\RegisterDirectEditorEvent; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; /** @@ -45,14 +47,18 @@ class Capabilities implements ICapability { /** @var Manager */ protected $directEditingManager; + /** @var IEventDispatcher */ + protected $eventDispatcher; + /** * Capabilities constructor. * * @param IConfig $config */ - public function __construct(IConfig $config, Manager $manager) { + public function __construct(IConfig $config, Manager $manager, IEventDispatcher $eventDispatcher) { $this->config = $config; $this->directEditingManager = $manager; + $this->eventDispatcher = $eventDispatcher; } /** @@ -71,6 +77,8 @@ public function getCapabilities() { } private function getDirectEditingCapabilitites(): array { + $this->eventDispatcher->dispatchTyped(new RegisterDirectEditorEvent($this->directEditingManager)); + $capabilities = [ 'editors' => [], 'creators' => [] diff --git a/lib/private/DirectEditing/Manager.php b/lib/private/DirectEditing/Manager.php index c1599e24d6b7c..fc9766f331220 100644 --- a/lib/private/DirectEditing/Manager.php +++ b/lib/private/DirectEditing/Manager.php @@ -71,8 +71,6 @@ public function __construct( $this->connection = $connection; $this->userId = $userSession->getUser() ? $userSession->getUser()->getUID() : null; $this->rootFolder = $rootFolder; - $eventDispatcher->dispatchTyped(new RegisterDirectEditorEvent($this)); - } public function registerDirectEditor(IEditor $directEditor): void {