From c2c63a551f2f8d0452865ce3924b3b983f520068 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 17 Oct 2022 00:58:11 +0200 Subject: Fix usage of streams always return a bool and type the handle as a string Signed-off-by: Carl Schwan --- apps/files_external/lib/Lib/Storage/SFTPReadStream.php | 4 ++-- apps/files_external/lib/Lib/Storage/SFTPWriteStream.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/files_external') diff --git a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php index 06ede120f5a..680a51cfa10 100644 --- a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php +++ b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php @@ -36,7 +36,7 @@ class SFTPReadStream implements File { /** @var \phpseclib\Net\SFTP */ private $sftp; - /** @var resource */ + /** @var string */ private $handle; /** @var int */ @@ -61,7 +61,6 @@ class SFTPReadStream implements File { * Load the source from the stream context and return the context options * * @param string $name - * @return array * @throws \BadMethodCallException */ protected function loadContext($name) { @@ -202,5 +201,6 @@ class SFTPReadStream implements File { if (!$this->sftp->_close_handle($this->handle)) { return false; } + return true; } } diff --git a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php index b1518809f09..6682a49d8f6 100644 --- a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php +++ b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php @@ -36,7 +36,7 @@ class SFTPWriteStream implements File { /** @var \phpseclib\Net\SFTP */ private $sftp; - /** @var resource */ + /** @var string */ private $handle; /** @var int */ @@ -61,7 +61,6 @@ class SFTPWriteStream implements File { * Load the source from the stream context and return the context options * * @param string $name - * @return array * @throws \BadMethodCallException */ protected function loadContext($name) { @@ -180,5 +179,6 @@ class SFTPWriteStream implements File { if (!$this->sftp->_close_handle($this->handle)) { return false; } + return true; } } -- cgit v1.2.3