Skip to content

[NFR]: Move MVC event names from collectors to an MVC bridge #15

Description

@niden

Summary

Collectors hold framework event names in their subscribe() methods. Move these names to one bridge that calls the collector push methods from #44. MVC behavior does not change.

ADR does not depend on this issue. It is a cleanup, so that a collector has no framework event names.

Current coupling

  • DatabaseCollector → db:beforeQuery, db:afterQuery
  • ViewCollector → view:beforeRenderView, view:afterRenderView
  • RouteCollector → router:matchedRoute
  • ExceptionsCollector → dispatch:beforeException
  • CacheCollector → cache:afterGet, cache:afterSet, cache:afterHas, cache:afterDelete

Proposed direction

  • Add an MVC bridge that attaches these listeners and calls the push methods. Provider boots it.
  • The typed push methods are the canonical signal set. Do not add a separate signal vocabulary or event bus. This replaces the three layers in the earlier text of this issue, and needs less code.
  • Keep the Subscriber contract and the subscription loop for third-party collectors. Built-in collectors stop implementing it.
  • view:* and cache:* also fire outside MVC. Put these listeners in a part that the ADR bridge can use also.
  • The bridge gives RouteCollector a callable that reads the MVC router at collect time (see [NFR]: Add a direct push API to collectors #44).

Acceptance

  • Built-in collectors have no framework event names.
  • A collector gets data with no events manager.
  • The MVC bridge keeps the current behavior (as used by phalcon/vokuro). Existing subscribe() tests move to the bridge with the same assertions.
  • Tests pass with full coverage. phpcs and phpstan pass.
  • RouteCollector has no Phalcon\Mvc imports.

Depends on

Part of

#13

Activity

  1. self-assigned this
    on Jul 22, 2026
  2. added theissue type on Jul 22, 2026
  3. moved this from Backlog to Active Sprint in Phalcon v5on Oct 17, 2026
  4. changed the title [-][NFR]: Decouple collectors from framework event names (bridge + canonical signals)[/-] [+][NFR]: Move MVC event names from collectors to an MVC bridge[/+] on Nov 3, 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
    Active Sprint

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions