Skip to content

Extract PassageRouteRegistry to deduplicate handler discovery #88

Description

@morcen

Problem

Three call sites independently find Passage routes, read _passage_handler, check PassageControllerInterface, and merge config('passage.options') with getOptions(). They already disagree: the controller resolves handlers through the container ($this->app->make()), while PassageListCommand uses new $handler, which breaks for handlers with constructor dependencies. The two commands also match routes differently (action name string vs uses string).

Location

  • PassageController::handle()
  • PassageHealthCommand::passageRoutes()
  • PassageListCommand::handle()

Fix

Extract a PassageRouteRegistry (find routes, resolve handler, merge options) and use it from all three call sites.

Sizing

Priority 16 (Impact 2, Risk 2, Effort 2). Estimated half a day.

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