aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Sabre/TrashFolder.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin/lib/Sabre/TrashFolder.php')
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashFolder.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/files_trashbin/lib/Sabre/TrashFolder.php b/apps/files_trashbin/lib/Sabre/TrashFolder.php
index 390f1956ffb..33236eea262 100644
--- a/apps/files_trashbin/lib/Sabre/TrashFolder.php
+++ b/apps/files_trashbin/lib/Sabre/TrashFolder.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright 2018, Roeland Jago Douma <roeland@famdouma.nl>
*
@@ -24,6 +25,7 @@ namespace OCA\Files_Trashbin\Sabre;
use OCP\Files\FileInfo;
use Sabre\DAV\Exception\Forbidden;
+use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\ICollection;
class TrashFolder implements ICollection, ITrash {
@@ -46,7 +48,7 @@ class TrashFolder implements ICollection, ITrash {
throw new Forbidden();
}
- public function getChild($name) {
+ public function getChild($name): ITrash {
$entries = \OCA\Files_Trashbin\Helper::getTrashFiles($this->getName(), $this->userId);
foreach ($entries as $entry) {
@@ -57,9 +59,11 @@ class TrashFolder implements ICollection, ITrash {
return new TrashFolderFile($this->getName(), $this->userId, $entry, $this->getOriginalLocation());
}
}
+
+ throw new NotFound();
}
- public function getChildren() {
+ public function getChildren(): array {
$entries = \OCA\Files_Trashbin\Helper::getTrashFiles($this->getName(), $this->userId);
$children = array_map(function (FileInfo $entry) {
@@ -72,7 +76,7 @@ class TrashFolder implements ICollection, ITrash {
return $children;
}
- public function childExists($name) {
+ public function childExists($name): bool {
$entries = \OCA\Files_Trashbin\Helper::getTrashFiles($this->getName(), $this->userId);
foreach ($entries as $entry) {
@@ -88,7 +92,7 @@ class TrashFolder implements ICollection, ITrash {
\OCA\Files_Trashbin\Trashbin::delete($this->data->getName(), $this->userId, $this->getLastModified());
}
- public function getName() {
+ public function getName(): string {
return $this->data->getName() . '.d' . $this->getLastModified();
}
@@ -96,7 +100,7 @@ class TrashFolder implements ICollection, ITrash {
throw new Forbidden();
}
- public function getLastModified() {
+ public function getLastModified(): int {
return $this->data->getMtime();
}