Skip to content

Commit

Permalink
refactor: use constructor property promotion
Browse files Browse the repository at this point in the history
Fix "Creation of dynamic property OCA\\FilesLock\\DAV\\LockBackend::$server is deprecated" by removing it.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
kesselb committed May 2, 2024
1 parent 87bd6b3 commit c285083
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
18 changes: 3 additions & 15 deletions lib/DAV/LockBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,13 @@
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

0 comments on commit c285083

Please sign in to comment.