mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
minor type improvements
This commit is contained in:
parent
144439d61f
commit
b5c6921f2e
6 changed files with 17 additions and 17 deletions
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
|
|
@ -33,7 +33,7 @@ jobs:
|
|||
run: composer install
|
||||
- env:
|
||||
BACKEND: smbclient
|
||||
run: php ./vendor/bin/phpstan analyse --level 5 src
|
||||
run: php ./vendor/bin/phpstan analyse --level 6 src
|
||||
|
||||
phpunit:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
|||
|
|
@ -33,8 +33,11 @@ class ACL {
|
|||
const FLAG_OBJECT_INHERIT = 0x1;
|
||||
const FLAG_CONTAINER_INHERIT = 0x2;
|
||||
|
||||
/** @var int */
|
||||
private $type;
|
||||
/** @var int */
|
||||
private $flags;
|
||||
/** @var int */
|
||||
private $mask;
|
||||
|
||||
public function __construct(int $type, int $flags, int $mask) {
|
||||
|
|
|
|||
|
|
@ -24,24 +24,16 @@ namespace Icewind\SMB;
|
|||
abstract class AbstractServer implements IServer {
|
||||
const LOCALE = 'en_US.UTF-8';
|
||||
|
||||
/**
|
||||
* @var string $host
|
||||
*/
|
||||
/** @var string */
|
||||
protected $host;
|
||||
|
||||
/**
|
||||
* @var IAuth $user
|
||||
*/
|
||||
/** @var IAuth */
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* @var ISystem
|
||||
*/
|
||||
/** @var ISystem */
|
||||
protected $system;
|
||||
|
||||
/**
|
||||
* @var ITimeZoneProvider
|
||||
*/
|
||||
/** @var ITimeZoneProvider */
|
||||
protected $timezoneProvider;
|
||||
|
||||
/** @var IOptions */
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@
|
|||
namespace Icewind\SMB;
|
||||
|
||||
class Change {
|
||||
/** @var int */
|
||||
private $code;
|
||||
/** @var string */
|
||||
private $path;
|
||||
|
||||
public function __construct(int $code, string $path) {
|
||||
|
|
|
|||
|
|
@ -206,10 +206,10 @@ class NativeState {
|
|||
|
||||
/**
|
||||
* @param string $uri
|
||||
* @return array
|
||||
* @return array{"mtime": int, "size": int, "mode": int}
|
||||
*/
|
||||
public function stat(string $uri): array {
|
||||
/** @var array $result */
|
||||
/** @var array{"mtime": int, "size": int, "mode": int} $result */
|
||||
$result = @smbclient_stat($this->state, $uri);
|
||||
|
||||
$this->testResult($result, $uri);
|
||||
|
|
@ -219,10 +219,10 @@ class NativeState {
|
|||
/**
|
||||
* @param resource $file
|
||||
* @param string $path
|
||||
* @return array
|
||||
* @return array{"mtime": int, "size": int, "mode": int}
|
||||
*/
|
||||
public function fstat($file, string $path): array {
|
||||
/** @var array $result */
|
||||
/** @var array{"mtime": int, "size": int, "mode": int} $result */
|
||||
$result = @smbclient_fstat($this->state, $file);
|
||||
|
||||
$this->testResult($result, $path);
|
||||
|
|
|
|||
|
|
@ -122,6 +122,9 @@ abstract class NativeStream implements File {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{"mtime": int, "size": int, "mode": int}|false
|
||||
*/
|
||||
public function stream_stat() {
|
||||
try {
|
||||
return $this->state->stat($this->url);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue