Problem
One 100-line method covers handler resolution, option merging, guard checks, retry setup, header stripping, validation, request transform, cache read/write, event dispatch, streaming branch, and error mapping. Collaborators are already extracted, so this is sequencing debt rather than tangle debt, but every new feature adds another branch to the same method.
Location
src/Http/Controllers/PassageController.php:46-149
Fix
Restructure as a middleware-style pipeline of small stages. Do this after the correctness fixes from the audit land, so the refactor carries tests with it.
Sizing
Priority 15 (Impact 3, Risk 2, Effort 3). Estimated 1-2 days.
From the tech debt audit dated 2026-07-05.
Problem
One 100-line method covers handler resolution, option merging, guard checks, retry setup, header stripping, validation, request transform, cache read/write, event dispatch, streaming branch, and error mapping. Collaborators are already extracted, so this is sequencing debt rather than tangle debt, but every new feature adds another branch to the same method.
Location
src/Http/Controllers/PassageController.php:46-149Fix
Restructure as a middleware-style pipeline of small stages. Do this after the correctness fixes from the audit land, so the refactor carries tests with it.
Sizing
Priority 15 (Impact 3, Risk 2, Effort 3). Estimated 1-2 days.
From the tech debt audit dated 2026-07-05.