Skip to content

Commit

Permalink
fixup! fixup! Code style fixes and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr committed Nov 26, 2019
1 parent d8ba16c commit 3db38c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 9 additions & 1 deletion apps/files/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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;
}

/**
Expand All @@ -71,6 +77,8 @@ public function getCapabilities() {
}

private function getDirectEditingCapabilitites(): array {
$this->eventDispatcher->dispatchTyped(new RegisterDirectEditorEvent($this->directEditingManager));

$capabilities = [
'editors' => [],
'creators' => []
Expand Down
2 changes: 0 additions & 2 deletions lib/private/DirectEditing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3db38c1

Please sign in to comment.