Repository navigation
3.0: retain released HTTP adapters with report-once middleware #95
Description
Status and delivery
Report-once HTTP adaptation belongs to PR 3; the owner has now also approved the request/representation scope in 8. The expanded implementation is under local integration. Earlier exact-head checks at c178301 below do not validate these additional changes or establish current merge readiness.
JSON/Whoops renderers and the reporting decorator were delivered in 2.5.0 through 92/96. This major preserves the useful concrete adapters while deliberately migrating their contract and provider wiring.
Approved migration boundary
- Require one scoped lifecycle/reporter and one original diagnostic delivery before a pure response renderer.
- Require
ServerRequestInterfaceas the second argument to everycreateResponseFromThrowableimplementation and direct call. Middleware forwards the current object unchanged. - Replace separate JSON/Whoops provider profiles with one ErrorHandlerServiceProvider. Normal application-first bootstrap supplies overrides; the library provider defines only its own services.
- The default response is request-aware negotiation: generic safe fallback, Symfony HTML for public/debug pages, and Serializer Problem Details for accepted JSON media types. Trusted debug controls details without forcing the representation.
- Retain concrete JSON/HTML/Whoops renderers and explicit public-template capture. Whoops is optional and explicit; its installation never switches the HTML default. Preserve lazy page customization and honest sequential/concurrent limits.
- JSON's required SerializerInterface is third and debug fourth. Update the prior error/envelope payload to Problem Details and migrate direct JSON content type to application/problem+json; negotiation also supports application/json.
- Keep reporter/renderer failure identity, inert construction, cached process services and fresh middleware scopes. Add no HTTP emission or competing native registration.
- Keep the reporting decorator an explicit utility for pipelines that have not already reported; do not wrap this middleware's renderer and report twice.
Whoops ^2.18.7 retains the separately delivered upstream native-source correction. That maintenance adoption does not make Whoops mandatory or solve request negotiation. Detailed Accept/media/debug/fallback/cache/Vary policy and the separately reviewable CLI opt-in are recorded in 8; coherent-major validation is owned by 26.
Completion criteria
- Validate original-once/report-before-render behavior and unchanged collaborator failures under the new required-request and single-provider contracts.
- Verify cached services/fresh scopes, application overrides, lazy unused renderers, optional Whoops absence/configured sequential pages, and explicit capture boundaries.
- Align PHPDoc, source-accurate runnable recipes, API/HTTP/provider/migration guides, site, consumer skill and the major note with the completed implementation.
- Record full local validation and fresh exact-head native checks without suppression or waived coverage/security rules.
- Obtain the owner's code review and merge decision.
Prior-scope adaptation and dependency evidence (historical; superseded as current readiness)
Status and delivery
Ready for owner review. PR #3 is open and no longer Draft at the validated head c178301. This is not owner code approval, merge or publication.
Implemented in PR 3 with Closes #95. JSON/Whoops renderers, reporting decorator and independent profiles already shipped in 2.5.0 through 92/96. This issue adapts those APIs to the major lifecycle; it does not implement them again.
Scope and decisions
Preserve one scoped lifecycle/reporter and one original diagnostic delivery before a pure response renderer. Keep the safe generic default, explicit public-template capture, cached process services, fresh middleware scopes, independent JSON/Whoops provider definitions and application override boundaries. Reporter/renderer failures retain identity; no HTTP emission or competing callback registration is added.
The major adopts optional Whoops ^2.18.7, including the upstream virtual-source correction. Compatible 2.x adoption is now merged in PR 121, closing 99; version PR 122 prepares 2.5.5 and is still an owner-controlled release step. Request/Accept negotiation #8 remains outside this adaptation.
Evidence and completion
Current reconciled-head validation
Public head c178301, tree 78454df6, is reconciled with master e8341f6. PHP CI passed all 10 jobs: quality on PHP 8.3–8.5, five selected production highest/lowest graphs and coverage/report. Documentation, style, Changelog and feedback passed at the same head.
The coverage report records 97.16% → 96.86% (-0.30 percentage points), the unchanged 80% floor, and tested merge commit b3c206a32ff2a4a3bf0f3cac918502fa7872a61c. Local validation passed 355 tests / 1843 assertions and 21 examples, with site/archive and selected production-consumer checks. Nine review threads are resolved; there is no submitted owner approval of this head. The remaining gate is the owner's code review and merge decision.
Public candidate e267b5d passed the integrated native PHP matrix. Its local real-Whoops STDIN/php -r checks preserved trace/status 503/buffers/callbacks and legitimate application warnings with empty stderr. Combined recipe/site/consumer evidence is owned by 26. The reconciled public head is c178301; Native PHP, documentation, style, Changelog and feedback checks passed for this exact head. The inherited fragment was restored byte-for-byte; the policy passed without a waiver. Owner review and merge remain pending.
- Retain released renderer/decorator/profile APIs with deliberate reporting/provider migration.
- Test original-once delivery, failures, optional-package absence, configured sequential pages, aliases/overrides and cached/fresh scopes; document the native concrete-autowiring fallback honestly.
- Align PHPDoc, meaningful tests, runnable recipes, site, API/HTTP/provider/migration guides, consumer skill and major note.
- Revalidate c178301 and the selected dependency graphs without suppressing diagnostics or weakening assertions.
- Obtain owner review and merge of PR 3.
Historical dependency diagnostics: keep the observations distinct
At predecessor 650a662/e9fe523, PHP 8.5.11/E_ALL complete-minimum application used FF 1.6.0, Config1.1.0, PHP-DI7.0.0, Nyholm1.8.0 and Whoops2.18.4. The real HTTP program still rendered generic JSON/status 500 and reported the original once, but exited 255 because its assertion detected an additional Nyholm Response E_DEPRECATED diagnostic. Three UploadedFile deprecations before registration were separate.
Changing only Nyholm to 1.8.2 passed 13 selective cases, yet seven retained PHP-DI implicit-nullability and DotAccessData 3.0.0 return-type diagnostics. That was neither a clean complete-minimum graph nor permission to suppress E_DEPRECATED. FF 1.6 helper availability likewise did not prove full execution. The owner later approved the latest-compatible dependency refresh; these older graphs remain historical and must not be reported as current failures or current coverage.
Possible 2.x applicability was not a confirmed 2.x bug: its optional FastForward integration floor was ^1.9 and requires its own real graph. The separate PSR-14 defect #110 and native concrete-fallback behavior must not be confused with this dependency evidence.
Activity
[-]Reconcile the approved 2.x HTTP adapters with 3.x reporting and provider composition[/-][+]Adapt released 2.5 HTTP adapters to the major reporting lifecycle[/+][-]Adapt released 2.5 HTTP adapters to the major reporting lifecycle[/-][+]3.0: retain released HTTP adapters with report-once middleware[/+]