aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-09-30 12:45:44 +0200
committerprovokateurin <kate@provokateurin.de>2024-09-30 16:49:27 +0200
commite1998b6b6cd1e66e743fcebfe954345430c67cd7 (patch)
tree93db38b3774e3dc3ee56356ac738c77ad5cc799a /lib
parent6e8c532932a3d8775decce929df77aa5c552e74d (diff)
downloadnextcloud-server-e1998b6b6cd1e66e743fcebfe954345430c67cd7.tar.gz
nextcloud-server-e1998b6b6cd1e66e743fcebfe954345430c67cd7.zip
fix(Storage): Fix getDirectoryContent() return typefix/storage/get-directory-content-return-type
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Storage/Common.php2
-rw-r--r--lib/private/Files/Storage/Storage.php2
-rw-r--r--lib/private/Files/Storage/Wrapper/Availability.php4
-rw-r--r--lib/private/Files/Storage/Wrapper/Jail.php2
-rw-r--r--lib/private/Files/Storage/Wrapper/Wrapper.php2
5 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index d78a6ca1ab3..746fe17d7c0 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -750,7 +750,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage,
return $count;
}
- public function getDirectoryContent($directory): \Traversable|false {
+ public function getDirectoryContent($directory): \Traversable {
$dh = $this->opendir($directory);
if ($dh === false) {
diff --git a/lib/private/Files/Storage/Storage.php b/lib/private/Files/Storage/Storage.php
index 741100ca117..3b14b1b84e3 100644
--- a/lib/private/Files/Storage/Storage.php
+++ b/lib/private/Files/Storage/Storage.php
@@ -72,5 +72,5 @@ interface Storage extends IStorage, ILockingStorage {
* - storage_mtime
* - permissions
*/
- public function getDirectoryContent($directory): \Traversable|false;
+ public function getDirectoryContent($directory): \Traversable;
}
diff --git a/lib/private/Files/Storage/Wrapper/Availability.php b/lib/private/Files/Storage/Wrapper/Availability.php
index a29239d034b..1a2824614c1 100644
--- a/lib/private/Files/Storage/Wrapper/Availability.php
+++ b/lib/private/Files/Storage/Wrapper/Availability.php
@@ -438,13 +438,13 @@ class Availability extends Wrapper {
- public function getDirectoryContent($directory): \Traversable|false {
+ public function getDirectoryContent($directory): \Traversable {
$this->checkAvailability();
try {
return parent::getDirectoryContent($directory);
} catch (StorageNotAvailableException $e) {
$this->setUnavailable($e);
- return false;
+ return new \EmptyIterator();
}
}
}
diff --git a/lib/private/Files/Storage/Wrapper/Jail.php b/lib/private/Files/Storage/Wrapper/Jail.php
index d0cf1c42236..256d669ede7 100644
--- a/lib/private/Files/Storage/Wrapper/Jail.php
+++ b/lib/private/Files/Storage/Wrapper/Jail.php
@@ -262,7 +262,7 @@ class Jail extends Wrapper {
}
}
- public function getDirectoryContent($directory): \Traversable|false {
+ public function getDirectoryContent($directory): \Traversable {
return $this->getWrapperStorage()->getDirectoryContent($this->getUnjailedPath($directory));
}
}
diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php
index 655bbc7ef75..903f6e5e470 100644
--- a/lib/private/Files/Storage/Wrapper/Wrapper.php
+++ b/lib/private/Files/Storage/Wrapper/Wrapper.php
@@ -331,7 +331,7 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea
}
}
- public function getDirectoryContent($directory): \Traversable|false {
+ public function getDirectoryContent($directory): \Traversable {
return $this->getWrapperStorage()->getDirectoryContent($directory);
}