Skip to content

Commit

Permalink
fix phpstan updates
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikbosch committed May 31, 2024
1 parent 79f43af commit 7939dcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .phpstan.test.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
parameters:
checkMissingIterableValueType: false

includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
6 changes: 5 additions & 1 deletion src/Stream/ResourceStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ public function rewind(): bool
public function isWritable(): bool
{
$metaData = \stream_get_meta_data($this->resource);
if (!\array_key_exists('uri', $metaData)) {
throw new \UnexpectedValueException('Cannot determine whether resource is writable, meta data does not contain the `uri` key');
}

return \is_writable($metaData['uri']) || $metaData['uri'] === 'php://memory';
}

Expand All @@ -141,7 +145,7 @@ public function isReadable(): bool
}

/**
* @param int<0, max> $length
* @param int<1, max> $length
* @return string
*/
public function read(int $length): string
Expand Down

0 comments on commit 7939dcc

Please sign in to comment.