mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
fix(Storage): Fix getDirectoryContent() return type
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
6e8c532932
commit
e1998b6b6c
5 changed files with 6 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -72,5 +72,5 @@ interface Storage extends IStorage, ILockingStorage {
|
|||
* - storage_mtime
|
||||
* - permissions
|
||||
*/
|
||||
public function getDirectoryContent($directory): \Traversable|false;
|
||||
public function getDirectoryContent($directory): \Traversable;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue