diff options
author | provokateurin <kate@provokateurin.de> | 2024-09-30 12:45:44 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-09-30 16:49:27 +0200 |
commit | e1998b6b6cd1e66e743fcebfe954345430c67cd7 (patch) | |
tree | 93db38b3774e3dc3ee56356ac738c77ad5cc799a /lib | |
parent | 6e8c532932a3d8775decce929df77aa5c552e74d (diff) | |
download | nextcloud-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.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Storage/Storage.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Availability.php | 4 | ||||
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Jail.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Wrapper.php | 2 |
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); } |