Skip to content

Commit

Permalink
Merge pull request #302 from nextcloud/debt/noid/lock-backend-propert…
Browse files Browse the repository at this point in the history
…y-promotion

Fix some deprecation warnings
  • Loading branch information
kesselb authored May 4, 2024
2 parents 55b4208 + 83cd06d commit 282cb32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
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

0 comments on commit 282cb32

Please sign in to comment.