diff --git a/.changelog/fix-optional-callable-event-composition.md b/.changelog/fix-optional-callable-event-composition.md deleted file mode 100644 index 2293483..0000000 --- a/.changelog/fix-optional-callable-event-composition.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -category: fixed -type: patch ---- - -Skip structural autowiring failure for an unconfigured optional callable reporter so the default major aggregate still delivers PSR-14 events. Preserve configured reporter order and explicit factory failures, and document the container's remaining concrete fallback boundary. diff --git a/.changelog/modernize-error-handler.md b/.changelog/modernize-error-handler.md deleted file mode 100644 index 13d7860..0000000 --- a/.changelog/modernize-error-handler.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -category: changed -type: major ---- - -Modernize the library for PHP 8.3+ while retaining the package -`coisa/error-handler` and namespace `CoiSA\ErrorHandler`. -- Require PHP `^8.3`, with a tested CI matrix of PHP 8.3–8.5. -- Require FastForward Container `^1.10` and expose the Interop service provider as the - container entrypoint. Remove the standalone Container/ConfigProvider APIs, - their package-specific exceptions and constructor-only factories. Keep explicit - lifecycle/composition factories under `ServiceProvider\Factory`. -- Keep construction and discovery inert. Preserve cached services and provide - explicit fresh handler/middleware factories. Require reverse-order unregistration, - retain one shutdown callback per handler and notify only the active owner. -- Exit 1 after successful registered uncaught-exception reporting. Preserve direct - calls without termination; propagate reporter failures without retry during a - failed registration while allowing independent direct deliveries. -- Separate HTTP reporting from rendering. Middleware requires both contracts, - reports once and then invokes a pure response factory. Use a generic stream by - default, standard reason phrases and integer HTTP error statuses through 599. -- Keep explicit public output capture as an opt-in renderer adapter. Preserve `0`, - use a generic fallback for empty output, clean reachable buffers after success and failure, - and retain renderer-failure precedence over cleanup failures. If no capture - remains above the caller's entry depth, use the generic fallback without reading caller output. -- Retain delivered 2.x handlers and native release tooling. Add distribution checks - and organized PHPUnit Unit/Functional/Process coverage. Cover partial callback - ownership, fail-fast reporter identity and native fatal diagnostic metadata. - Preserve the configurable 80% overall coverage floor and real comparisons; - retire the prototype Fire/HTTP/Python parents and custom release publisher. -- Check all complete cookbook recipes against executable source, retaining - the exact inventory and omitting only each leading license header. -- Ship the canonical `resources/skills/coisa-error-handler` package with - configuration-first examples for the Interop provider and pure - renderer contracts. Preserve its license and optional installer metadata, and - require the complete consumer payload in distribution checks. -- Add a direct native regression for output-handler destruction that replaces its - removed buffer, proving bounded cleanup, primary-failure and caller ownership. -- Preserve the JSON, optional Whoops and explicit reporting adapters published in - 2.5.0. Compose pure renderers after the middleware report; retain trusted debug - configuration, lazy page overrides and fresh middleware scopes without a second - diagnostic delivery. Consolidate response profiles into the request-aware - provider described in the companion negotiation entry. -- Accept matching callables in all three ErrorHandler constructor inputs using - existing adapters. Preserve interface identity and precedence, required reporter, - optional null defaults, inert construction and the existing reporting policies. - Keep explicit provider factories for cached services and fresh scopes. -- Refresh Composer development-tool ranges to the current stable lines, retaining - PHP 8.3 support through PHPUnit 12.5 and Symfony Process 7.4 alternatives. - Require Nyholm 1.8.2 in development for its PHP 8.5 fixes; retain the compatible - PSR ranges and optional Whoops 2.18.7 minimum with its upstream native STDIN source-read fix. - The Whoops compatibility fix preserves its renderer contract; the lifecycle and - HTTP-default changes above apply to this major. -- Describe the accompanying API without temporary PR or publication status, - and clarify that diagnostic reporter output remains outside the PSR-7 body. -- Correct callable-filtering guidance, clarify generic stream and fatal-reporting - contracts, and distinguish checkout recipes from bundled application examples. - Keep installed documentation links usable and release instructions current. -- Keep available representations and diagnostic authorization under application control. diff --git a/.changelog/negotiate-the-html-response-charset.md b/.changelog/negotiate-the-html-response-charset.md deleted file mode 100644 index e006834..0000000 --- a/.changelog/negotiate-the-html-response-charset.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -category: fixed -type: patch ---- - -Negotiate the built-in HTML renderer using its actual UTF-8 media type. Honor -charset-specific Accept preferences and exclusions instead of choosing HTML when -its charset is explicitly forbidden or falling back when UTF-8 HTML is accepted. diff --git a/.changelog/request-aware-response-negotiation.md b/.changelog/request-aware-response-negotiation.md deleted file mode 100644 index 35f8be1..0000000 --- a/.changelog/request-aware-response-negotiation.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -category: changed -type: major ---- - -Negotiate error responses from the current request through a single -`ErrorHandlerServiceProvider`. Replace the JSON and Whoops profile providers with -lazy Problem Details JSON, plain-text and Symfony HTML representations. Accept a required -`ServerRequestInterface` alongside the original throwable in every response -factory and forward it unchanged after one middleware report. - -Keep diagnostic output disabled by default. Explicit debug configuration enables -JSON diagnostics and Symfony's detailed HTML, while production HTML remains a -generic status page. Keep Whoops available only through explicit application -composition, without changing the default based on installed optional packages. -Respect Accept quality and exclusions, preserve existing Vary fields and keep -selection independent across requests that reuse the same cached service. - -Serialize Problem Details with Symfony Serializer, preserving public HTTP status -codes and keeping trace arguments and objects out of debug responses. Support -compatible Symfony component majors without requiring a matching VarDumper major. -Exclude older component patches that emit native PHP 8.4+ deprecations, including -incompatible transitive VarDumper versions, without adding a direct dependency. -Offer an explicit Symfony CLI reporter through the same provider, writing to -STDERR or the application's Console error output without installing native hooks. -Demonstrate PSR-14 reporting with FastForward Event Dispatcher and its provider. diff --git a/CHANGELOG.md b/CHANGELOG.md index 1549835..fa4b832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,100 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 The entries for 1.0.0 and 2.0.0 were reconstructed from their published Git tags. +## [3.0.0] - 2026-10-28 + +### Changed + +- Modernize the library for PHP 8.3+ while retaining the package + `coisa/error-handler` and namespace `CoiSA\ErrorHandler`. + - Require PHP `^8.3`, with a tested CI matrix of PHP 8.3–8.5. + - Require FastForward Container `^1.10` and expose the Interop service provider as the + container entrypoint. Remove the standalone Container/ConfigProvider APIs, + their package-specific exceptions and constructor-only factories. Keep explicit + lifecycle/composition factories under `ServiceProvider\Factory`. + - Keep construction and discovery inert. Preserve cached services and provide + explicit fresh handler/middleware factories. Require reverse-order unregistration, + retain one shutdown callback per handler and notify only the active owner. + - Exit 1 after successful registered uncaught-exception reporting. Preserve direct + calls without termination; propagate reporter failures without retry during a + failed registration while allowing independent direct deliveries. + - Separate HTTP reporting from rendering. Middleware requires both contracts, + reports once and then invokes a pure response factory. Use a generic stream by + default, standard reason phrases and integer HTTP error statuses through 599. + - Keep explicit public output capture as an opt-in renderer adapter. Preserve `0`, + use a generic fallback for empty output, clean reachable buffers after success and failure, + and retain renderer-failure precedence over cleanup failures. If no capture + remains above the caller's entry depth, use the generic fallback without reading caller output. + - Retain delivered 2.x handlers and native release tooling. Add distribution checks + and organized PHPUnit Unit/Functional/Process coverage. Cover partial callback + ownership, fail-fast reporter identity and native fatal diagnostic metadata. + Preserve the configurable 80% overall coverage floor and real comparisons; + retire the prototype Fire/HTTP/Python parents and custom release publisher. + - Check all complete cookbook recipes against executable source, retaining + the exact inventory and omitting only each leading license header. + - Ship the canonical `resources/skills/coisa-error-handler` package with + configuration-first examples for the Interop provider and pure + renderer contracts. Preserve its license and optional installer metadata, and + require the complete consumer payload in distribution checks. + - Add a direct native regression for output-handler destruction that replaces its + removed buffer, proving bounded cleanup, primary-failure and caller ownership. + - Preserve the JSON, optional Whoops and explicit reporting adapters published in + 2.5.0. Compose pure renderers after the middleware report; retain trusted debug + configuration, lazy page overrides and fresh middleware scopes without a second + diagnostic delivery. Consolidate response profiles into the request-aware + provider described in the companion negotiation entry. + - Accept matching callables in all three ErrorHandler constructor inputs using + existing adapters. Preserve interface identity and precedence, required reporter, + optional null defaults, inert construction and the existing reporting policies. + Keep explicit provider factories for cached services and fresh scopes. + - Refresh Composer development-tool ranges to the current stable lines, retaining + PHP 8.3 support through PHPUnit 12.5 and Symfony Process 7.4 alternatives. + Require Nyholm 1.8.2 in development for its PHP 8.5 fixes; retain the compatible + PSR ranges and optional Whoops 2.18.7 minimum with its upstream native STDIN source-read fix. + The Whoops compatibility fix preserves its renderer contract; the lifecycle and + HTTP-default changes above apply to this major. + - Describe the accompanying API without temporary PR or publication status, + and clarify that diagnostic reporter output remains outside the PSR-7 body. + - Correct callable-filtering guidance, clarify generic stream and fatal-reporting + contracts, and distinguish checkout recipes from bundled application examples. + Keep installed documentation links usable and release instructions current. + - Keep available representations and diagnostic authorization under application control. + + ([#3](https://github.com/coisa/error-handler/pull/3)) + +- Negotiate error responses from the current request through a single + `ErrorHandlerServiceProvider`. Replace the JSON and Whoops profile providers with + lazy Problem Details JSON, plain-text and Symfony HTML representations. Accept a required + `ServerRequestInterface` alongside the original throwable in every response + factory and forward it unchanged after one middleware report. + + Keep diagnostic output disabled by default. Explicit debug configuration enables + JSON diagnostics and Symfony's detailed HTML, while production HTML remains a + generic status page. Keep Whoops available only through explicit application + composition, without changing the default based on installed optional packages. + Respect Accept quality and exclusions, preserve existing Vary fields and keep + selection independent across requests that reuse the same cached service. + + Serialize Problem Details with Symfony Serializer, preserving public HTTP status + codes and keeping trace arguments and objects out of debug responses. Support + compatible Symfony component majors without requiring a matching VarDumper major. + Exclude older component patches that emit native PHP 8.4+ deprecations, including + incompatible transitive VarDumper versions, without adding a direct dependency. + Offer an explicit Symfony CLI reporter through the same provider, writing to + STDERR or the application's Console error output without installing native hooks. + Demonstrate PSR-14 reporting with FastForward Event Dispatcher and its provider. + + ([#3](https://github.com/coisa/error-handler/pull/3)) + +### Fixed + +- Skip structural autowiring failure for an unconfigured optional callable reporter so the default major aggregate still delivers PSR-14 events. Preserve configured reporter order and explicit factory failures, and document the container's remaining concrete fallback boundary. ([#3](https://github.com/coisa/error-handler/pull/3)) +- Negotiate the built-in HTML renderer using its actual UTF-8 media type. Honor + charset-specific Accept preferences and exclusions instead of choosing HTML when + its charset is explicitly forbidden or falling back when UTF-8 HTML is accepted. + + ([#3](https://github.com/coisa/error-handler/pull/3)) + ## [2.5.5] - 2026-10-20 ### Fixed @@ -298,6 +392,7 @@ This version is marked as a prerelease on GitHub. - A Composer library requiring PHP `^7.1`, with Apache 2.0 licensing. +[3.0.0]: https://github.com/coisa/error-handler/compare/v2.5.5...v3.0.0 [2.5.5]: https://github.com/coisa/error-handler/compare/v2.5.4...v2.5.5 [2.5.4]: https://github.com/coisa/error-handler/compare/v2.5.3...v2.5.4 [2.5.3]: https://github.com/coisa/error-handler/compare/v2.5.2...v2.5.3