mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 10:03:32 -04:00
Merge pull request #48454 from nextcloud/fix/storage/get-directory-content-return-type
This commit is contained in:
commit
26762172f5
5 changed files with 6 additions and 6 deletions
|
|
@ -762,7 +762,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