Skip to content

[NFR]: Extract a neutral injection method from ResponseListener #39

Closed

Description

@niden

Summary

The injection logic can run only through an event call. A host with no events manager cannot inject the bar. Move the logic to a public method that takes only a response.

Current state

  • ResponseListener::__invoke(EventInterface $event, mixed $source, mixed $response) holds all the logic (src/DebugBar/ResponseListener.php:55).
  • The logic does not use $event or $source.
  • Injector is already neutral and does not change.

Proposed direction

  • Add a public method that takes a Phalcon\Http\ResponseInterface, and move the logic to it.
  • __invoke() keeps the instanceof check and calls the new method.

Acceptance

  • A test calls the new method with no event, and the bar is injected.
  • The existing ResponseListenerTest 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. changed the title [-][NFR]: Extract a neutral injection method from ResponseListener`[/-] [+][NFR]: Extract a neutral injection method from ResponseListener[/+] on Nov 3, 2026
  4. moved this from Backlog to Active Sprint in Phalcon v5on Nov 3, 2026
  5. niden commented on Nov 3, 2026

    @niden
    SponsorMemberAuthor

    Resolved in #49

  6. moved this from Active Sprint to Implemented in Phalcon v5on 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
    Implemented

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions