Skip to content

Commit

Permalink
minor type improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Mar 10, 2021
1 parent 144439d commit b5c6921
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
16 changes: 4 additions & 12 deletions src/AbstractServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,16 @@
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 */
Expand Down
2 changes: 2 additions & 0 deletions src/Change.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
namespace Icewind\SMB;

class Change {
/** @var int */
private $code;
/** @var string */
private $path;

public function __construct(int $code, string $path) {
Expand Down
8 changes: 4 additions & 4 deletions src/Native/NativeState.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ public function rmdir(string $uri): bool {

/**
* @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);
Expand All @@ -219,10 +219,10 @@ public function stat(string $uri): array {
/**
* @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);
Expand Down
3 changes: 3 additions & 0 deletions src/Native/NativeStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public function stream_seek($offset, $whence = SEEK_SET) {
}
}

/**
* @return array{"mtime": int, "size": int, "mode": int}|false
*/
public function stream_stat() {
try {
return $this->state->stat($this->url);
Expand Down

0 comments on commit b5c6921

Please sign in to comment.