Skip to content
Draft
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
9 changes: 3 additions & 6 deletions lib/Versions/CollectiveVersionsExpireManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@

use OC\Files\View;
use OC\Hooks\BasicEmitter;
use OC\User\User;
use OCA\Collectives\Db\CollectiveMapper;
use OCA\Collectives\Mount\CollectiveFolderManager;
use OCA\Collectives\Service\MissingDependencyException;
use OCA\Collectives\Service\NotFoundException;
use OCA\Collectives\Service\NotPermittedException;
use OCP\AppFramework\QueryException;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\FileInfo;
use OCP\Files\InvalidPathException;
use OCP\Files\NotFoundException as FilesNotFoundException;
use OCP\Files\NotPermittedException as FilesNotPermittedException;
use OCP\IDBConnection;
use OCP\IUser;
use OCP\IUserManager;
use Psr\Container\ContainerInterface;

class CollectiveVersionsExpireManager extends BasicEmitter {
Expand All @@ -39,7 +37,7 @@
private IDBConnection $connection,
private CollectiveMapper $collectiveMapper,
private ITimeFactory $timeFactory,
private IEventDispatcher $dispatcher,
private IUserManager $userManager,
) {
try {
$this->versionsBackend = $appContainer->get(VersionsBackend::class);
Expand Down Expand Up @@ -100,8 +98,7 @@
} catch (FilesNotPermittedException $e) {
throw new NotPermittedException($e->getMessage(), 0, $e);
}
/** @var IUser $dummyUser */
$dummyUser = new User('', null, $this->dispatcher);
$dummyUser = $this->userManager->getUserObject('', null, false);

Check failure on line 101 in lib/Versions/CollectiveVersionsExpireManager.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedInterfaceMethod

lib/Versions/CollectiveVersionsExpireManager.php:101:36: UndefinedInterfaceMethod: Method OCP\IUserManager::getUserObject does not exist (see https://psalm.dev/181)
foreach ($files as $fileId => $file) {
if ($file instanceof FileInfo) {
// Some versions could have been lost during move operations across storage.
Expand Down
Loading