Make userAgent a true multi-stage routine#163
Merged
alganet merged 1 commit intoRespect:masterfrom Mar 17, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #163 +/- ##
============================================
+ Coverage 96.10% 96.30% +0.19%
- Complexity 418 433 +15
============================================
Files 27 27
Lines 1027 1055 +28
============================================
+ Hits 987 1016 +29
+ Misses 40 39 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Turn userAgent() into a routine that can participate in multiple phases of the request lifecycle instead of only post-processing responses. Changes: - move negotiated callback storage/helpers into AbstractCallbackMediator so mediator-based routines can share state across stages - make UserAgent implement ProxyableBy as well as ProxyableThrough - allow userAgent callbacks to block before the route runs by returning false, a ResponseInterface, or a forwarded route - preserve response transformation behavior through userAgent callbacks after the route runs - avoid double-running zero-argument userAgent callbacks by preparing the through-stage result during by() - preserve through-only behavior for callbacks that require a response/input parameter and therefore cannot run safely before the route Tests: - add router coverage for pre-route blocking via userAgent - add coverage for a single userAgent routine participating in both by and through stages - add coverage for transformer-style userAgent callbacks that remain post-route only - extend UserAgent routine tests for deny behavior and prepared through results Verification: - composer qa
3d4ad09 to
8f3768c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turn userAgent() into a routine that can participate in multiple phases of the request lifecycle instead of only post-processing responses.
Changes:
Tests:
Verification: