Merge branch '3.0'

This commit is contained in:
terrafrost 2022-01-23 11:00:48 -06:00
commit a88b7e546e
7 changed files with 29 additions and 30 deletions

View File

@ -341,7 +341,6 @@ class SFTP extends SSH2
* @param string $host * @param string $host
* @param int $port * @param int $port
* @param int $timeout * @param int $timeout
* @return \phpseclib3\Net\SFTP
* @access public * @access public
*/ */
public function __construct($host, $port = 22, $timeout = 10) public function __construct($host, $port = 22, $timeout = 10)
@ -782,7 +781,7 @@ class SFTP extends SSH2
/** /**
* Returns the current directory name * Returns the current directory name
* *
* @return mixed * @return string|false
* @access public * @access public
*/ */
public function pwd() public function pwd()
@ -952,7 +951,7 @@ class SFTP extends SSH2
* *
* @param string $dir * @param string $dir
* @param bool $recursive * @param bool $recursive
* @return mixed * @return array|false
* @access public * @access public
*/ */
public function nlist($dir = '.', $recursive = false) public function nlist($dir = '.', $recursive = false)
@ -966,7 +965,7 @@ class SFTP extends SSH2
* @param string $dir * @param string $dir
* @param bool $recursive * @param bool $recursive
* @param string $relativeDir * @param string $relativeDir
* @return mixed * @return array|false
* @access private * @access private
*/ */
private function nlist_helper($dir, $recursive, $relativeDir) private function nlist_helper($dir, $recursive, $relativeDir)
@ -1000,7 +999,7 @@ class SFTP extends SSH2
* *
* @param string $dir * @param string $dir
* @param bool $recursive * @param bool $recursive
* @return mixed * @return array|false
* @access public * @access public
*/ */
public function rawlist($dir = '.', $recursive = false) public function rawlist($dir = '.', $recursive = false)
@ -1044,7 +1043,7 @@ class SFTP extends SSH2
* *
* @param string $dir * @param string $dir
* @param bool $raw * @param bool $raw
* @return mixed * @return array|false
* @throws \UnexpectedValueException on receipt of unexpected packets * @throws \UnexpectedValueException on receipt of unexpected packets
* @access private * @access private
*/ */
@ -1349,7 +1348,7 @@ class SFTP extends SSH2
* Returns an array on success and false otherwise. * Returns an array on success and false otherwise.
* *
* @param string $filename * @param string $filename
* @return mixed * @return array|false
* @access public * @access public
*/ */
public function stat($filename) public function stat($filename)
@ -1406,7 +1405,7 @@ class SFTP extends SSH2
* Returns an array on success and false otherwise. * Returns an array on success and false otherwise.
* *
* @param string $filename * @param string $filename
* @return mixed * @return array|false
* @access public * @access public
*/ */
public function lstat($filename) public function lstat($filename)
@ -1474,7 +1473,7 @@ class SFTP extends SSH2
* @param string $filename * @param string $filename
* @param int $type * @param int $type
* @throws \UnexpectedValueException on receipt of unexpected packets * @throws \UnexpectedValueException on receipt of unexpected packets
* @return mixed * @return array|false
* @access private * @access private
*/ */
private function stat_helper($filename, $type) private function stat_helper($filename, $type)
@ -2344,7 +2343,7 @@ class SFTP extends SSH2
* @param int $length * @param int $length
* @param callable|null $progressCallback * @param callable|null $progressCallback
* @throws \UnexpectedValueException on receipt of unexpected packets * @throws \UnexpectedValueException on receipt of unexpected packets
* @return mixed * @return string|false
* @access public * @access public
*/ */
public function get($remote_file, $local_file = false, $offset = 0, $length = -1, $progressCallback = null) public function get($remote_file, $local_file = false, $offset = 0, $length = -1, $progressCallback = null)
@ -2846,7 +2845,7 @@ class SFTP extends SSH2
* Gets file type * Gets file type
* *
* @param string $path * @param string $path
* @return mixed * @return string|false
* @access public * @access public
*/ */
public function filetype($path) public function filetype($path)
@ -3500,7 +3499,7 @@ class SFTP extends SSH2
/** /**
* Get supported SFTP versions * Get supported SFTP versions
* *
* @return array * @return int|false
* @access public * @access public
*/ */
public function getNegotiatedVersion() public function getNegotiatedVersion()
@ -3531,13 +3530,13 @@ class SFTP extends SSH2
* Disconnect * Disconnect
* *
* @param int $reason * @param int $reason
* @return bool * @return false
* @access protected * @access protected
*/ */
protected function disconnect_helper($reason) protected function disconnect_helper($reason)
{ {
$this->pwd = false; $this->pwd = false;
parent::disconnect_helper($reason); return parent::disconnect_helper($reason);
} }
/** /**

View File

@ -338,7 +338,7 @@ class Stream
* Write to stream * Write to stream
* *
* @param string $data * @param string $data
* @return mixed * @return int|false
* @access public * @access public
*/ */
private function _stream_write($data) private function _stream_write($data)

View File

@ -48,6 +48,7 @@
namespace phpseclib3\Net; namespace phpseclib3\Net;
use phpseclib3\Crypt\Blowfish; use phpseclib3\Crypt\Blowfish;
use phpseclib3\Crypt\Common\SymmetricKey;
use phpseclib3\Crypt\Hash; use phpseclib3\Crypt\Hash;
use phpseclib3\Crypt\Random; use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\RC4; use phpseclib3\Crypt\RC4;
@ -233,7 +234,7 @@ class SSH2
* Server Identifier * Server Identifier
* *
* @see self::getServerIdentification() * @see self::getServerIdentification()
* @var array|false * @var string|false
* @access private * @access private
*/ */
protected $server_identifier = false; protected $server_identifier = false;
@ -1116,7 +1117,6 @@ class SSH2
* @param int $port * @param int $port
* @param int $timeout * @param int $timeout
* @see self::login() * @see self::login()
* @return SSH2|void
* @access public * @access public
*/ */
public function __construct($host, $port = 22, $timeout = 10) public function __construct($host, $port = 22, $timeout = 10)
@ -2027,7 +2027,7 @@ class SSH2
* \phpseclib3\Crypt\Common\SymmetricKey. * \phpseclib3\Crypt\Common\SymmetricKey.
* *
* @param string $algorithm Name of the encryption algorithm * @param string $algorithm Name of the encryption algorithm
* @return mixed Instance of \phpseclib3\Crypt\Common\SymmetricKey or null for unknown * @return SymmetricKey|null
* @access private * @access private
*/ */
private static function encryption_algorithm_to_crypt_instance($algorithm) private static function encryption_algorithm_to_crypt_instance($algorithm)
@ -2076,7 +2076,7 @@ class SSH2
* \phpseclib3\Crypt\Hash. * \phpseclib3\Crypt\Hash.
* *
* @param string $algorithm Name of the encryption algorithm * @param string $algorithm Name of the encryption algorithm
* @return mixed Instance of \phpseclib3\Crypt\Hash or null for unknown * @return array{Hash, int}|null
* @access private * @access private
*/ */
private static function mac_algorithm_to_hash_instance($algorithm) private static function mac_algorithm_to_hash_instance($algorithm)
@ -4051,7 +4051,7 @@ class SSH2
* @param string $data * @param string $data
* @param string $logged * @param string $logged
* @see self::_get_binary_packet() * @see self::_get_binary_packet()
* @return bool * @return void
* @access private * @access private
*/ */
protected function send_binary_packet($data, $logged = null) protected function send_binary_packet($data, $logged = null)
@ -4313,7 +4313,7 @@ class SSH2
* *
* @param int $client_channel * @param int $client_channel
* @param bool $want_reply * @param bool $want_reply
* @return bool * @return void
* @access private * @access private
*/ */
private function close_channel($client_channel, $want_reply = false) private function close_channel($client_channel, $want_reply = false)
@ -4350,7 +4350,7 @@ class SSH2
* Disconnect * Disconnect
* *
* @param int $reason * @param int $reason
* @return bool * @return false
* @access protected * @access protected
*/ */
protected function disconnect_helper($reason) protected function disconnect_helper($reason)
@ -4519,7 +4519,7 @@ class SSH2
/** /**
* Return the server identification. * Return the server identification.
* *
* @return string * @return string|false
* @access public * @access public
*/ */
public function getServerIdentification() public function getServerIdentification()
@ -4916,7 +4916,7 @@ class SSH2
* Caching this the first time you connect to a server and checking the result on subsequent connections * Caching this the first time you connect to a server and checking the result on subsequent connections
* is recommended. Returns false if the server signature is not signed correctly with the public host key. * is recommended. Returns false if the server signature is not signed correctly with the public host key.
* *
* @return mixed * @return string|false
* @throws \RuntimeException on badly formatted keys * @throws \RuntimeException on badly formatted keys
* @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when the key isn't in a supported format * @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when the key isn't in a supported format
* @access public * @access public