aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/Node.php11
-rw-r--r--apps/dav/lib/Connector/Sabre/QuotaPlugin.php2
-rw-r--r--apps/dav/lib/Upload/UploadFile.php4
4 files changed, 8 insertions, 15 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index f53c62afba2..a6c9b8b4ebe 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -53,10 +53,8 @@ use Sabre\DAV\Server;
use Sabre\DAV\Tree;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
-use Sabre\Uri;
class FilesPlugin extends ServerPlugin {
-
// namespace
public const NS_OWNCLOUD = 'http://owncloud.org/ns';
public const NS_NEXTCLOUD = 'http://nextcloud.org/ns';
@@ -352,7 +350,7 @@ class FilesPlugin extends ServerPlugin {
$propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {
return json_encode($this->previewManager->isAvailable($node->getFileInfo()), JSON_THROW_ON_ERROR);
});
- $propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node): ?int {
+ $propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node): int|float {
return $node->getSize();
});
$propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function () use ($node) {
@@ -382,7 +380,7 @@ class FilesPlugin extends ServerPlugin {
});
/**
* Return file/folder name as displayname. The primary reason to
- * implement it this way is to avoid costly fallback to
+ * implement it this way is to avoid costly fallback to
* CustomPropertiesBackend (esp. visible when querying all files
* in a folder).
*/
diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php
index 843d48e7450..cce48bf4839 100644
--- a/apps/dav/lib/Connector/Sabre/Node.php
+++ b/apps/dav/lib/Connector/Sabre/Node.php
@@ -67,10 +67,7 @@ abstract class Node implements \Sabre\DAV\INode {
*/
protected $property_cache = null;
- /**
- * @var \OCP\Files\FileInfo
- */
- protected $info;
+ protected FileInfo $info;
/**
* @var IManager
@@ -81,10 +78,6 @@ abstract class Node implements \Sabre\DAV\INode {
/**
* Sets up the node, expects a full path name
- *
- * @param \OC\Files\View $view
- * @param \OCP\Files\FileInfo $info
- * @param IManager $shareManager
*/
public function __construct(View $view, FileInfo $info, IManager $shareManager = null) {
$this->fileView = $view;
@@ -232,7 +225,7 @@ abstract class Node implements \Sabre\DAV\INode {
*
* @return int|float
*/
- public function getSize() {
+ public function getSize(): int|float {
return $this->info->getSize();
}
diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
index ff7396a0825..ddf4b2773e0 100644
--- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
@@ -178,7 +178,7 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
* This method is called before any HTTP method and validates there is enough free space to store the file
*
* @param string $path relative to the users home
- * @param int $length
+ * @param int|float|null $length
* @throws InsufficientStorage
* @return bool
*/
diff --git a/apps/dav/lib/Upload/UploadFile.php b/apps/dav/lib/Upload/UploadFile.php
index 49a2fadecf6..47d03e3e448 100644
--- a/apps/dav/lib/Upload/UploadFile.php
+++ b/apps/dav/lib/Upload/UploadFile.php
@@ -29,7 +29,6 @@ use OCA\DAV\Connector\Sabre\File;
use Sabre\DAV\IFile;
class UploadFile implements IFile {
-
/** @var File */
private $file;
@@ -53,6 +52,9 @@ class UploadFile implements IFile {
return $this->file->getETag();
}
+ /**
+ * @return int|float
+ */
public function getSize() {
return $this->file->getSize();
}