Skip to content

Commit

Permalink
fix some phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mikey179 committed Feb 25, 2020
1 parent 06139c8 commit 64e1b8d
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Expand Up @@ -10,4 +10,4 @@ parameters:
ignoreErrors:
-
message: '/Default value of the parameter #1 \$out \(mixed\) of method [a-zA-Z0-9\\_]+::__construct\(\) is incompatible with type resource/'
path: %currentWorkingDirectory%/src/visitor/vfsStreamPrintVisitor.php
path: %currentWorkingDirectory%/src/visitor/Printer.php
1 change: 1 addition & 0 deletions src/StreamWrapper.php
Expand Up @@ -12,6 +12,7 @@
namespace bovigo\vfs;

use bovigo\vfs\internal\Mode;
use bovigo\vfs\internal\OpenedFile;
use bovigo\vfs\internal\Path;
use bovigo\vfs\internal\Root;
use bovigo\vfs\internal\Type;
Expand Down
2 changes: 0 additions & 2 deletions src/content/LargeFileContent.php
Expand Up @@ -114,8 +114,6 @@ public function read(int $offset, int $count): string

/**
* writes an amount of data starting at given offset
*
* @return int amount of written bytes
*/
public function write(string $data, int $offset, int $length): void
{
Expand Down
2 changes: 0 additions & 2 deletions src/content/StringBasedFileContent.php
Expand Up @@ -66,8 +66,6 @@ public function read(int $offset, int $count): string

/**
* writes an amount of data starting at given offset
*
* @return int amount of written bytes
*/
public function write(string $data, int $offset, int $length): void
{
Expand Down
1 change: 1 addition & 0 deletions src/internal/ErroneousOpenedFile.php
Expand Up @@ -16,6 +16,7 @@
use bovigo\vfs\FileContent;
use bovigo\vfs\vfsFile;
use bovigo\vfs\vfsStream;
use bovigo\vfs\StreamWrapper;
use const SEEK_CUR;
use const SEEK_END;
use const SEEK_SET;
Expand Down
1 change: 1 addition & 0 deletions src/internal/OpenedFile.php
Expand Up @@ -15,6 +15,7 @@

use bovigo\vfs\vfsFile;
use bovigo\vfs\vfsStream;
use bovigo\vfs\StreamWrapper;
use bovigo\vfs\content\FileContent;
use const SEEK_CUR;
use const SEEK_END;
Expand Down
4 changes: 2 additions & 2 deletions src/vfsDirectory.php
Expand Up @@ -30,7 +30,7 @@ class vfsDirectory extends BasicFile implements IteratorAggregate
/**
* list of directory children
*
* @var array<vfsFile|vfsDirectory>
* @var array<BasicFile>
*/
private $children = [];
/**
Expand Down Expand Up @@ -224,7 +224,7 @@ public function hasChildren(): bool
/**
* returns a list of children for this directory
*
* @return array<vfsFile|vfsDirectory>
* @return array<BasicFile>
*/
public function getChildren(): array
{
Expand Down
16 changes: 8 additions & 8 deletions src/vfsFile.php
Expand Up @@ -196,7 +196,7 @@ public function openWithTruncate(int $mode): OpenedFile
* @see https://github.com/mikey179/vfsStream/issues/6
* @see https://github.com/mikey179/vfsStream/issues/40
*
* @param resource|vfsStreamWrapper $resource
* @param resource|StreamWrapper $resource
*
* @since 0.10.0
*/
Expand Down Expand Up @@ -231,7 +231,7 @@ public function lock($resource, int $operation): bool
*
* @see https://github.com/mikey179/vfsStream/issues/40
*
* @param resource|vfsStreamWrapper $resource
* @param resource|StreamWrapper $resource
*/
public function unlock($resource): void
{
Expand All @@ -250,7 +250,7 @@ public function unlock($resource): void
*
* @see https://github.com/mikey179/vfsStream/issues/40
*
* @param resource|vfsStreamWrapper $resource
* @param resource|StreamWrapper $resource
*/
protected function setExclusiveLock($resource): void
{
Expand All @@ -262,7 +262,7 @@ protected function setExclusiveLock($resource): void
*
* @see https://github.com/mikey179/vfsStream/issues/40
*
* @param resource|vfsStreamWrapper $resource
* @param resource|StreamWrapper $resource
*/
protected function addSharedLock($resource): void
{
Expand All @@ -275,7 +275,7 @@ protected function addSharedLock($resource): void
* @see https://github.com/mikey179/vfsStream/issues/6
* @see https://github.com/mikey179/vfsStream/issues/40
*
* @param resource|vfsStreamWrapper $resource
* @param resource|StreamWrapper $resource
*
* @since 0.10.0
*/
Expand All @@ -290,7 +290,7 @@ public function isLocked($resource = null): bool
* @see https://github.com/mikey179/vfsStream/issues/6
* @see https://github.com/mikey179/vfsStream/issues/40
*
* @param resource|vfsStreamWrapper $resource
* @param resource|StreamWrapper $resource
*
* @since 0.10.0
*/
Expand All @@ -308,7 +308,7 @@ public function hasSharedLock($resource = null): bool
*
* @see https://github.com/mikey179/vfsStream/issues/40
*
* @param resource|vfsStreamWrapper $resource
* @param resource|StreamWrapper $resource
*/
private function resourceId($resource): string
{
Expand All @@ -326,7 +326,7 @@ private function resourceId($resource): string
* @see https://github.com/mikey179/vfsStream/issues/6
* @see https://github.com/mikey179/vfsStream/issues/40
*
* @param resource|vfsStreamWrapper $resource
* @param resource|StreamWrapper $resource
*
* @since 0.10.0
*/
Expand Down
6 changes: 3 additions & 3 deletions src/visitor/Printer.php
Expand Up @@ -67,7 +67,7 @@ public function __construct($out = STDOUT)
/**
* visit a file and process it
*
* @return vfsStreamPrintVisitor
* @return Printer
*/
public function visitFile(vfsFile $file): vfsStreamVisitor
{
Expand All @@ -79,7 +79,7 @@ public function visitFile(vfsFile $file): vfsStreamVisitor
/**
* visit a block device and process it
*
* @return vfsStreamPrintVisitor
* @return Printer
*/
public function visitBlockDevice(vfsBlock $block): vfsStreamVisitor
{
Expand All @@ -92,7 +92,7 @@ public function visitBlockDevice(vfsBlock $block): vfsStreamVisitor
/**
* visit a directory and process it
*
* @return vfsStreamPrintVisitor
* @return Printer
*/
public function visitDirectory(vfsDirectory $dir): vfsStreamVisitor
{
Expand Down
6 changes: 3 additions & 3 deletions src/visitor/StructureInspector.php
Expand Up @@ -51,7 +51,7 @@ public function __construct()
/**
* visit a file and process it
*
* @return vfsStreamStructureVisitor
* @return StructureInspector
*/
public function visitFile(vfsFile $file): vfsStreamVisitor
{
Expand All @@ -63,7 +63,7 @@ public function visitFile(vfsFile $file): vfsStreamVisitor
/**
* visit a block device and process it
*
* @return vfsStreamStructureVisitor
* @return StructureInspector
*/
public function visitBlockDevice(vfsBlock $block): vfsStreamVisitor
{
Expand All @@ -75,7 +75,7 @@ public function visitBlockDevice(vfsBlock $block): vfsStreamVisitor
/**
* visit a directory and process it
*
* @return vfsStreamStructureVisitor
* @return StructureInspector
*/
public function visitDirectory(vfsDirectory $dir): vfsStreamVisitor
{
Expand Down

0 comments on commit 64e1b8d

Please sign in to comment.