From 3fe39397656b32b5386b8d44cfa992a3c791fa9e Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Thu, 8 Aug 2024 12:38:41 +0200 Subject: [PATCH 1/5] Add PHP 8.4 nightly to tests So we can find problems with time. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a310546b..4b8cc064d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: ["8.1", "8.2", "8.3"] + php: ["8.1", "8.2", "8.3", "8.4"] stability: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} From 7f6b51f275bdc4578100cdc94f581e708749b4e8 Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Sat, 19 Oct 2024 13:00:01 +0200 Subject: [PATCH 2/5] Small change to rerun CI --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b8cc064d..0ca57a9a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: ["8.1", "8.2", "8.3", "8.4"] + php: ["8.1", "8.2", "8.3", "8.4"] stability: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} From bab53ee9699e2ca18ae4b9711cd0b41e0b420547 Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Sat, 19 Oct 2024 13:08:40 +0200 Subject: [PATCH 3/5] Fix Request.php to use explicit nullable for PHP8.4 --- src/Protocols/Http/Request.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Protocols/Http/Request.php b/src/Protocols/Http/Request.php index 548735828..2ff2c2855 100644 --- a/src/Protocols/Http/Request.php +++ b/src/Protocols/Http/Request.php @@ -119,7 +119,7 @@ public function __construct(protected string $buffer) {} * @param mixed $default * @return mixed */ - public function get(string $name = null, mixed $default = null): mixed + public function get(?string $name = null, mixed $default = null): mixed { if (!isset($this->data['get'])) { $this->parseGet(); @@ -137,7 +137,7 @@ public function get(string $name = null, mixed $default = null): mixed * @param mixed $default * @return mixed */ - public function post(string $name = null, mixed $default = null): mixed + public function post(?string $name = null, mixed $default = null): mixed { if (!isset($this->data['post'])) { $this->parsePost(); @@ -155,7 +155,7 @@ public function post(string $name = null, mixed $default = null): mixed * @param mixed $default * @return mixed */ - public function header(string $name = null, mixed $default = null): mixed + public function header(?string $name = null, mixed $default = null): mixed { if (!isset($this->data['headers'])) { $this->parseHeaders(); @@ -174,7 +174,7 @@ public function header(string $name = null, mixed $default = null): mixed * @param mixed $default * @return mixed */ - public function cookie(string $name = null, mixed $default = null): mixed + public function cookie(?string $name = null, mixed $default = null): mixed { if (!isset($this->data['cookie'])) { $this->data['cookie'] = []; @@ -192,7 +192,7 @@ public function cookie(string $name = null, mixed $default = null): mixed * @param string|null $name * @return array|null */ - public function file(string $name = null) + public function file(?string $name = null) { if (!isset($this->data['files'])) { $this->parsePost(); @@ -295,7 +295,7 @@ public function session(): Session * @return string * @throws Exception */ - public function sessionId(string $sessionId = null): string + public function sessionId(?string $sessionId = null): string { if ($sessionId) { unset($this->sid); From cf2baf32fdb926a89f24cf64d96e4bfa5a639f37 Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Sat, 19 Oct 2024 13:14:01 +0200 Subject: [PATCH 4/5] Update Pest.php to use explicit nullable --- tests/Pest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Pest.php b/tests/Pest.php index 7db6ab1bc..f2a84413a 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -42,7 +42,7 @@ function something() // .. } -function testWithConnectionClose(Closure $closure, string $dataContains = null, $connectionClass = TcpConnection::class): void +function testWithConnectionClose(Closure $closure, ?string $dataContains = null, $connectionClass = TcpConnection::class): void { $tcpConnection = Mockery::spy($connectionClass); $closure($tcpConnection); From 103239825920d6e5456aeeb694979e780b99dc6d Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Sat, 19 Oct 2024 13:29:34 +0200 Subject: [PATCH 5/5] Update Response.php with explicit nullable --- src/Protocols/Http/Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocols/Http/Response.php b/src/Protocols/Http/Response.php index 0df251983..2f73e30af 100644 --- a/src/Protocols/Http/Response.php +++ b/src/Protocols/Http/Response.php @@ -244,7 +244,7 @@ public function getHeaders(): array * @param string|null $reasonPhrase * @return $this */ - public function withStatus(int $code, string $reasonPhrase = null): static + public function withStatus(int $code, ?string $reasonPhrase = null): static { $this->status = $code; $this->reason = $reasonPhrase;