Skip to content

Refactor PassageController::handle() into a pipeline of small stages #90

Description

@morcen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorRestructuring without behavior changetech-debtFrom the technical debt registerv3For versions v3.x

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions