From d9306b7288ecf040e9dc1d3b17d42f23489907c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1?= Date: Thu, 14 Mar 2024 08:57:08 +0100 Subject: [PATCH 1/4] phpstan fix --- src/Request.php | 1 - 1 file changed, 1 deletion(-) 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 : []; } From 4930c30af8834ab9df033d7609ff42950062f49d Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Sat, 8 Jun 2024 15:25:42 +0100 Subject: [PATCH 2/4] Add PHP8.3 to the CI matrix --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From ad89d922dd845325b0253f5fde2660cc0b264ecd Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Sat, 8 Jun 2024 15:31:15 +0100 Subject: [PATCH 3/4] Update phpstan config for ignoring iterable value types --- phpstan.neon.dist | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From d7b67674d7d854c380de67d62980c9c28ca33592 Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Sat, 8 Jun 2024 15:31:44 +0100 Subject: [PATCH 4/4] Only read the stream if the length > 0 --- src/Stream.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }