diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7e8ec2f..bb85a67 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.0, 8.1, 8.2] + php: [8.0, 8.1, 8.2, 8.3] experimental: [false] include: - php: 8.2 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index ccac1b2..8216eb2 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,6 @@ parameters: level: max - checkMissingIterableValueType: false + ignoreErrors: + - identifier: missingType.iterableValue paths: - src diff --git a/src/Factory/StreamFactory.php b/src/Factory/StreamFactory.php index 31d99b5..04d22a1 100644 --- a/src/Factory/StreamFactory.php +++ b/src/Factory/StreamFactory.php @@ -51,7 +51,7 @@ public function createStream(string $content = ''): StreamInterface public function createStreamFromFile( string $filename, string $mode = 'r', - StreamInterface $cache = null + ?StreamInterface $cache = null ): StreamInterface { set_error_handler( static function (int $errno, string $errstr) use ($filename, $mode): void { @@ -82,7 +82,7 @@ static function (int $errno, string $errstr) use ($filename, $mode): void { /** * {@inheritdoc} */ - public function createStreamFromResource($resource, StreamInterface $cache = null): StreamInterface + public function createStreamFromResource($resource, ?StreamInterface $cache = null): StreamInterface { if (!is_resource($resource)) { throw new InvalidArgumentException( diff --git a/src/Request.php b/src/Request.php index 252f5a1..4f9e1d9 100644 --- a/src/Request.php +++ b/src/Request.php @@ -270,7 +270,6 @@ public function getQueryParams(): array // Decode URL data parse_str($this->uri->getQuery(), $this->queryParams); - // @phpstan-ignore-next-line return is_array($this->queryParams) ? $this->queryParams : []; } diff --git a/src/Stream.php b/src/Stream.php index fa8e268..25a97f8 100644 --- a/src/Stream.php +++ b/src/Stream.php @@ -304,7 +304,7 @@ public function read($length): string { $data = false; - if ($this->isReadable() && $this->stream && $length >= 0) { + if ($this->isReadable() && $this->stream && $length > 0) { $data = fread($this->stream, $length); } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index dbe4a90..eee5637 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -29,7 +29,7 @@ } ], Message::class => [ - 'header' => function (string $string, bool $replace = true, int $statusCode = null): void { + 'header' => function (string $string, bool $replace = true, ?int $statusCode = null): void { HeaderStack::push( [ 'header' => $string,