Skip to content

docs: correct the pipeline wiring instructions - #13

Merged
tyrsson merged 1 commit into
1.0.xfrom
docs/pipeline-wiring
Sep 25, 2026
Merged

tyrsson merged 1 commit into
1.0.xfrom
docs/pipeline-wiring

Conversation

@tyrsson

@tyrsson tyrsson commented Sep 25, 2026

Copy link
Copy Markdown
Member

The README said:

The middleware is self-registering via ConfigProvider. No manual pipeline edit is required beyond the entry in config/config.php.

That is not true of this package. src/ConfigProvider.php returns only dependencies (the NavigationMiddleware factory) and view_helpers (the navigation helper), and emits no middleware_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_pipeline orders middleware by an integer priority, and this middleware's correctness depends on running after RouteMiddleware and before DispatchMiddleware. 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) and docs/webware-tools-alignment.md already 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.

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

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tyrsson
tyrsson merged commit 58d9116 into 1.0.x Sep 25, 2026
12 checks passed
@tyrsson
tyrsson deleted the docs/pipeline-wiring branch September 25, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant