Skip to content

[NFR]: Extract a neutral history handler from HistoryController #42

Closed

Description

@niden

Summary

The history list, read and clear logic is in an MVC controller. An ADR Action cannot use it. Move the logic to a class with no MVC types, and keep HistoryController as a thin MVC adapter. MVC behavior does not change.

Current coupling

  • HistoryController implements Phalcon\Mvc\ControllerInterface (src/DebugBar/Controllers/HistoryController.php:33).
  • The class has no other MVC dependency. Its constructor takes History, AccessGate, RequestInterface and ResponseInterface.

Proposed direction

  • Add a new class that takes the same four dependencies. Move the method check, access check, list, read, clear and JSON logic to it.
  • HistoryController::openAction(), indexAction() and clearAction() call the new class.

Acceptance

  • The new class has no Phalcon\Mvc or Phalcon\Di imports.
  • A test covers the new class with no MVC objects.
  • The existing HistoryControllerTest tests pass with the same expected results.
  • Tests pass with full coverage. phpcs and phpstan pass.

Part of

#13

Activity

  1. self-assigned this
    on Nov 3, 2026
  2. added theissue type on Nov 3, 2026
  3. moved this from Backlog to Active Sprint in Phalcon v5on Nov 3, 2026
  4. niden commented on Nov 5, 2026

    @niden
    SponsorMemberAuthor

    Resolved in #58

  5. moved this from Active Sprint to Implemented in Phalcon v5on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

  • Status
    Implemented

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions