Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some deprecation warnings #302

Merged
merged 2 commits into from
May 4, 2024
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
19 changes: 3 additions & 16 deletions lib/DAV/LockBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,15 @@
use OCP\Files\NotFoundException;
use Sabre\DAV\Locks\Backend\BackendInterface;
use Sabre\DAV\Locks\LockInfo;
use Sabre\DAV\Server;

class LockBackend implements BackendInterface {
/** @var FileService */
private $fileService;

/** @var LockService */
private $lockService;

/** @var bool */
private $absolute = false;

public function __construct(
Server $server, FileService $fileService, LockService $lockService, bool $absolute
private FileService $fileService,
private LockService $lockService,
private bool $absolute
) {
$this->server = $server;
$this->fileService = $fileService;
$this->lockService = $lockService;
$this->absolute = $absolute;
}


/**
* @param string $uri
* @param bool $returnChildLocks
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/LockPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function initialize(Server $server) {
$absolute = true;
break;
}
$this->locksBackend = new LockBackend($server, $this->fileService, $this->lockService, $absolute);
$this->locksBackend = new LockBackend($this->fileService, $this->lockService, $absolute);
$server->on('propFind', [$this, 'customProperties']);
parent::initialize($server);
}
Expand Down
3 changes: 3 additions & 0 deletions tests/Feature/LockFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use OCP\Files\Lock\ILockManager;
use OCP\Files\Lock\LockContext;
use OCP\Lock\ManuallyLockedException;
use OCP\Share\IManager as IShareManager;
use OCP\Share\IShare;
use Test\TestCase;
use Test\Util\User\Dummy;
Expand All @@ -43,6 +44,8 @@ class LockFeatureTest extends TestCase {

private LockManager $lockManager;
private IRootFolder $rootFolder;
private ITimeFactory $timeFactory;
private IShareManager $shareManager;
private ?int $time = null;

public static function setUpBeforeClass(): void {
Expand Down
Loading