type hint fixes

This commit is contained in:
Robin Appelman 2021-03-02 19:17:37 +01:00
commit 0e69997579
11 changed files with 17 additions and 29 deletions

View file

@ -10,31 +10,18 @@ namespace Icewind\SMB;
class Change {
private $code;
private $path;
/**
* Change constructor.
*
* @param $code
* @param $path
*/
public function __construct($code, $path) {
public function __construct(string $code, int $path) {
$this->code = $code;
$this->path = $path;
}
/**
* @return integer
*/
public function getCode() {
public function getCode(): int {
return $this->code;
}
/**
* @return string
*/
public function getPath() {
public function getPath(): string {
return $this->path;
}
}

View file

@ -100,7 +100,7 @@ interface IShare {
/**
* List the content of a remote folder
*
* @param $path
* @param string $path
* @return \Icewind\SMB\IFileInfo[]
*
* @throws \Icewind\SMB\Exception\NotFoundException

View file

@ -30,7 +30,7 @@ class NativeReadStream extends NativeStream {
/**
* Wrap a stream from libsmbclient-php into a regular php stream
*
* @param \Icewind\SMB\NativeState $state
* @param NativeState $state
* @param resource $smbStream
* @param string $mode
* @param string $url

View file

@ -122,7 +122,7 @@ class NativeState {
}
/**
* @param $dir
* @param resource $dir
* @return bool
*/
public function closedir($dir) {

View file

@ -40,7 +40,7 @@ class NativeStream implements File {
/**
* Wrap a stream from libsmbclient-php into a regular php stream
*
* @param \Icewind\SMB\NativeState $state
* @param NativeState $state
* @param resource $smbStream
* @param string $mode
* @param string $url
@ -73,6 +73,7 @@ class NativeStream implements File {
}
public function stream_flush() {
return false;
}

View file

@ -30,7 +30,7 @@ class NativeWriteStream extends NativeStream {
/**
* Wrap a stream from libsmbclient-php into a regular php stream
*
* @param \Icewind\SMB\NativeState $state
* @param NativeState $state
* @param resource $smbStream
* @param string $mode
* @param string $url

View file

@ -68,12 +68,12 @@ class ServerFactory {
/**
* @param $host
* @param string $host
* @param IAuth $credentials
* @return IServer
* @throws DependencyException
*/
public function createServer($host, IAuth $credentials) {
public function createServer(string $host, IAuth $credentials) {
foreach (self::BACKENDS as $backend) {
if (call_user_func("$backend::available", $this->system)) {
return new $backend($host, $credentials, $this->system, $this->timeZoneProvider, $this->options);

View file

@ -95,10 +95,10 @@ class Connection extends RawConnection {
/**
* Check
*
* @param $line
* @param string $line
* @return bool
*/
private function isPrompt($line) {
private function isPrompt(string $line) {
return mb_substr($line, 0, self::DELIMITER_LENGTH) === self::DELIMITER || $line === false;
}

View file

@ -91,13 +91,13 @@ class Parser {
/**
* check if the first line holds a connection failure
*
* @param $line
* @param string $line
* @throws AuthenticationException
* @throws InvalidHostException
* @throws NoLoginServerException
* @throws AccessDeniedException
*/
public function checkConnectionError($line) {
public function checkConnectionError(string $line) {
$line = rtrim($line, ')');
if (substr($line, -23) === ErrorCodes::LogonFailure) {
throw new AuthenticationException('Invalid login');

View file

@ -139,7 +139,7 @@ class Share extends AbstractShare {
/**
* List the content of a remote folder
*
* @param $path
* @param string $path
* @return \Icewind\SMB\IFileInfo[]
*
* @throws \Icewind\SMB\Exception\NotFoundException