Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions lib/private/Files/Node/LazyFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
17 changes: 16 additions & 1 deletion lib/private/Files/Node/LazyRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down Expand Up @@ -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());
}
}
3 changes: 2 additions & 1 deletion lib/private/Files/Node/Root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/private/Preview/WatcherConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
3 changes: 1 addition & 2 deletions lib/public/Files/IRootFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
*
Expand Down
Loading