From 59e7ca46e80a65266d61ae4e9266c3c28df0c6cf Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 23 Nov 2025 16:55:46 +0100 Subject: [PATCH 1/4] require php 8.4 --- .github/workflows/ci.yml | 6 ++---- CHANGELOG.md | 6 ++++++ composer.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ce6547..e64f44d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,8 +4,6 @@ on: [push, pull_request] jobs: psalm: - uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main + uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@next cs: - uses: innmind/github-workflows/.github/workflows/cs.yml@main - with: - php-version: '8.2' + uses: innmind/github-workflows/.github/workflows/cs.yml@next diff --git a/CHANGELOG.md b/CHANGELOG.md index f00bd88..83cfcc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Changed + +- Requires PHP `8.4` + ## 5.0.0 - 2025-07-13 ### Changed diff --git a/composer.json b/composer.json index 1dc9431..aa1e5b4 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "issues": "http://github.com/Innmind/HttpServer/issues" }, "require": { - "php": "~8.2", + "php": "~8.4", "innmind/http": "~8.0", "innmind/operating-system": "~6.0" }, From 25dfb7aebd6171f32bac8501390c5a3d0d7af7ed Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 23 Nov 2025 16:57:47 +0100 Subject: [PATCH 2/4] update dependencies --- composer.json | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index aa1e5b4..59ff5c6 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,23 @@ }, "require": { "php": "~8.4", - "innmind/http": "~8.0", - "innmind/operating-system": "~6.0" + "innmind/http": "dev-next", + "innmind/operating-system": "dev-next", + "innmind/server-status": "dev-next", + "innmind/file-watch": "dev-next", + "innmind/http-transport": "dev-next", + "innmind/signals": "dev-next", + "innmind/server-control": "dev-next", + "innmind/time-warp": "dev-next", + "innmind/filesystem": "dev-next", + "innmind/io": "dev-next", + "innmind/media-type": "dev-next", + "innmind/validation": "dev-next", + "innmind/url": "dev-next", + "innmind/ip": "dev-next", + "innmind/time-continuum": "dev-next", + "innmind/immutable": "dev-next", + "formal/access-layer": "dev-next" }, "autoload": { "psr-4": { From 5dedb49111de581dd19840f0ce2c9572b4b1775e Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 8 Feb 2026 11:14:38 +0100 Subject: [PATCH 3/4] tag dependencies --- .github/workflows/ci.yml | 4 ++-- CHANGELOG.md | 2 ++ composer.json | 21 +++------------------ src/Main.php | 15 ++++++++++++--- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e64f44d..45d4ce1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,6 @@ on: [push, pull_request] jobs: psalm: - uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@next + uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main cs: - uses: innmind/github-workflows/.github/workflows/cs.yml@next + uses: innmind/github-workflows/.github/workflows/cs.yml@main diff --git a/CHANGELOG.md b/CHANGELOG.md index 83cfcc6..79e6213 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ### Changed - Requires PHP `8.4` +- Requires `innmind/operating-system:~7.0` +- `Innmind\HttpServer\Main::preload()` environment variables are now expressed with a `Innmind\Immutable\Map` ## 5.0.0 - 2025-07-13 diff --git a/composer.json b/composer.json index 59ff5c6..5cdf21b 100644 --- a/composer.json +++ b/composer.json @@ -16,23 +16,8 @@ }, "require": { "php": "~8.4", - "innmind/http": "dev-next", - "innmind/operating-system": "dev-next", - "innmind/server-status": "dev-next", - "innmind/file-watch": "dev-next", - "innmind/http-transport": "dev-next", - "innmind/signals": "dev-next", - "innmind/server-control": "dev-next", - "innmind/time-warp": "dev-next", - "innmind/filesystem": "dev-next", - "innmind/io": "dev-next", - "innmind/media-type": "dev-next", - "innmind/validation": "dev-next", - "innmind/url": "dev-next", - "innmind/ip": "dev-next", - "innmind/time-continuum": "dev-next", - "innmind/immutable": "dev-next", - "formal/access-layer": "dev-next" + "innmind/http": "~9.0", + "innmind/operating-system": "~7.0" }, "autoload": { "psr-4": { @@ -46,7 +31,7 @@ } }, "require-dev": { - "innmind/static-analysis": "^1.2.1", + "innmind/static-analysis": "~1.3", "innmind/coding-standard": "~2.0" } } diff --git a/src/Main.php b/src/Main.php index c86ca0a..a870ec9 100644 --- a/src/Main.php +++ b/src/Main.php @@ -7,7 +7,6 @@ Factory\ServerRequestFactory, Response\Sender\Native, ServerRequest, - ServerRequest\Environment, Response, Response\StatusCode, ProtocolVersion, @@ -19,6 +18,7 @@ OperatingSystem, Config, }; +use Innmind\Immutable\Map; abstract class Main { @@ -36,7 +36,14 @@ final public function __construct(?Config $config = null) return; } - $this->preload($os, $request->environment()); + /** @var Map */ + $env = Map::of(); + + foreach (\getenv() as $key => $value) { + $env = ($env)($key, $value); + } + + $this->preload($os, $env); try { $response = $this->main($request); @@ -58,8 +65,10 @@ final public function __construct(?Config $config = null) * rendered to the client. This is the expected behaviour so it's easier to * watch errors when developping the app. This method should never throw an * exception when in production mode. + * + * @param Map $env Environment variables */ - protected function preload(OperatingSystem $os, Environment $env): void + protected function preload(OperatingSystem $os, Map $env): void { } From 55eca12057de6ac6bfa125ae5e5e2e72b7db3fce Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 8 Feb 2026 11:14:51 +0100 Subject: [PATCH 4/4] fix exception being thrown --- CHANGELOG.md | 4 ++++ src/Main.php | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79e6213..425e8ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ - Requires `innmind/operating-system:~7.0` - `Innmind\HttpServer\Main::preload()` environment variables are now expressed with a `Innmind\Immutable\Map` +### Fixed + +- Errors thrown during the handling of a request were displayed + ## 5.0.0 - 2025-07-13 ### Changed diff --git a/src/Main.php b/src/Main.php index a870ec9..d2c2a34 100644 --- a/src/Main.php +++ b/src/Main.php @@ -48,7 +48,6 @@ final public function __construct(?Config $config = null) try { $response = $this->main($request); } catch (\Throwable $e) { - throw $e; $response = $this->serverError($request); }