diff --git a/lib/private/Files/Node/LazyFolder.php b/lib/private/Files/Node/LazyFolder.php index 26b7eff4031c5..2d01e7bf5c8ce 100644 --- a/lib/private/Files/Node/LazyFolder.php +++ b/lib/private/Files/Node/LazyFolder.php @@ -74,27 +74,6 @@ public function getUser() { return $this->__call(__FUNCTION__, func_get_args()); } - /** - * @inheritDoc - */ - public function listen($scope, $method, callable $callback) { - $this->__call(__FUNCTION__, func_get_args()); - } - - /** - * @inheritDoc - */ - public function removeListener($scope = null, $method = null, ?callable $callback = null) { - $this->__call(__FUNCTION__, func_get_args()); - } - - /** - * @inheritDoc - */ - public function emit($scope, $method, $arguments = []) { - $this->__call(__FUNCTION__, func_get_args()); - } - /** * @inheritDoc */ diff --git a/lib/private/Files/Node/LazyRoot.php b/lib/private/Files/Node/LazyRoot.php index f69d1ab5e4ee4..203a31ccba69e 100644 --- a/lib/private/Files/Node/LazyRoot.php +++ b/lib/private/Files/Node/LazyRoot.php @@ -8,6 +8,7 @@ namespace OC\Files\Node; +use OC\Hooks\Emitter; use OCP\Files\Cache\ICacheEntry; use OCP\Files\IRootFolder; use OCP\Files\Mount\IMountPoint; @@ -21,7 +22,7 @@ * * @package OC\Files\Node */ -class LazyRoot extends LazyFolder implements IRootFolder { +class LazyRoot extends LazyFolder implements IRootFolder, Emitter { public function __construct(\Closure $folderClosure, array $data = []) { parent::__construct($this, $folderClosure, $data); } @@ -59,4 +60,18 @@ public function getNodeFromCacheEntryAndMount(ICacheEntry $cacheEntry, IMountPoi public function getAppDataDirectoryName(): string { return $this->__call(__FUNCTION__, func_get_args()); } + + public function emit($scope, $method, $arguments = []) { + $this->__call(__FUNCTION__, func_get_args()); + } + + #[\Override] + public function listen($scope, $method, callable $callback) { + $this->__call(__FUNCTION__, func_get_args()); + } + + #[\Override] + public function removeListener($scope = null, $method = null, ?callable $callback = null) { + $this->__call(__FUNCTION__, func_get_args()); + } } diff --git a/lib/private/Files/Node/Root.php b/lib/private/Files/Node/Root.php index 74e24664a5c99..8340e8df788b6 100644 --- a/lib/private/Files/Node/Root.php +++ b/lib/private/Files/Node/Root.php @@ -14,6 +14,7 @@ use OC\Files\Storage\Storage; use OC\Files\Utils\PathHelper; use OC\Files\View; +use OC\Hooks\Emitter; use OC\Hooks\PublicEmitter; use OC\User\NoUserException; use OCA\Files\AppInfo\Application; @@ -58,7 +59,7 @@ * * @package OC\Files\Node */ -class Root extends Folder implements IRootFolder { +class Root extends Folder implements IRootFolder, Emitter { private PublicEmitter $emitter; private CappedMemoryCache $userFolderCache; private ICache $pathByIdCache; diff --git a/lib/private/Preview/WatcherConnector.php b/lib/private/Preview/WatcherConnector.php index 848409436173d..4b9188ec5b484 100644 --- a/lib/private/Preview/WatcherConnector.php +++ b/lib/private/Preview/WatcherConnector.php @@ -37,6 +37,7 @@ private function getWatcher(): Watcher { public function connectWatcher(): void { // Do not connect if we are not setup yet! if ($this->config->getValue('instanceid', null) !== null) { + /** @psalm-suppress UndefinedInterfaceMethod both Root and LazyRoot have listen */ $this->root->listen('\OC\Files', 'postWrite', function (Node $node): void { $this->getWatcher()->postWrite($node); }); diff --git a/lib/public/Files/IRootFolder.php b/lib/public/Files/IRootFolder.php index e30d04c36ab51..265ee2a461f09 100644 --- a/lib/public/Files/IRootFolder.php +++ b/lib/public/Files/IRootFolder.php @@ -8,7 +8,6 @@ namespace OCP\Files; -use OC\Hooks\Emitter; use OC\User\NoUserException; use OCP\Files\Cache\ICacheEntry; use OCP\Files\Mount\IMountPoint; @@ -19,7 +18,7 @@ * * @since 8.0.0 */ -interface IRootFolder extends Folder, Emitter { +interface IRootFolder extends Folder { /** * Returns a view to user's files folder *