Repository navigation
docs: correct the pipeline wiring instructions - #13
Merged
Merged
Conversation
The README claimed the middleware self-registers via ConfigProvider and that no pipeline edit was needed. It does not: ConfigProvider registers the middleware factory and the navigation view helper and nothing else, so a consumer following that advice gets middleware that never runs. Replaced with the requirement itself, plus why Mezzio's middleware_pipeline is deliberately unused: a priority integer cannot express the ordering this depends on. Refs docs/architecture.md, Decision 7.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
The README said:
That is not true of this package.
src/ConfigProvider.phpreturns onlydependencies(theNavigationMiddlewarefactory) andview_helpers(thenavigationhelper), and emits nomiddleware_pipeline. A consumer following that sentence ends up with the middleware in the container and never piped, so active-route detection silently never runs.The replacement states the actual requirement, names the position the middleware must occupy, and points at Decision 7 in
docs/architecture.md, which already documented the correct placement.It also records why the self-registering route is deliberately not used, so nobody "fixes" this back later: Mezzio's
middleware_pipelineorders middleware by an integer priority, and this middleware's correctness depends on running afterRouteMiddlewareand beforeDispatchMiddleware. That ordering is a requirement rather than a preference, and expressing it as a magic number relative to other packages' magic numbers is fragile.Scope
Documentation only.
docs/architecture.md(Decision 7) anddocs/webware-tools-alignment.mdalready describe manual placement correctly and are untouched; the README was the sole outlier. No PHP changes, so the test, Mago and mutation results are unaffected.