Fix usage of streams

always return a bool and type the handle as a string

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan 2022-10-17 00:58:11 +02:00
parent 74e6976779
commit c2c63a551f
2 changed files with 4 additions and 4 deletions

View file

@ -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;
}
}

View file

@ -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;
}
}