8000 [EventDispatcher] Allow to omit the event name when registering listene… · Issue #12451 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[EventDispatcher] Allow to omit the event name when registering listene… #12451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nicolas-grekas opened this issue Oct 9, 2019 · 8 comments

Comments

@nicolas-grekas
Copy link
Member
Q A
Feature PR symfony/symfony#33851
PR author(s) @derrabus
Merged in 4.4
@javiereguiluz javiereguiluz added this to the 4.4 milestone Oct 9, 2019
@derrabus
Copy link
Member
derrabus commented Oct 9, 2019

I'll write the documentation probably tomorrow.

@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@derrabus
Copy link
Member

I completely forgot about this one. 🙈

@carsonbot carsonbot removed the Stalled label Dec 18, 2020
@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@carsonbot
Copy link
Collaborator

Could I get a reply or should I close this?

@derrabus
Copy link
Member
derrabus commented Jan 2, 2022

Still relevant, I suppose.

8000

@alamirault
Copy link
Contributor

This was introduce in 4.4, I think is now a good practice to use FQCN instead declare event: kernel.exception.

https://symfony.com/doc/current/components/event_dispatcher.html

https://symfony.com/doc/current/event_dispatcher.html

Are you ok if I do theses changes ? I will add a note below

.. note::
There is an optional attribute for the ``kernel.event_listener`` tag called
``priority``, which is a positive or negative integer that defaults to ``0``
and it controls the order in which listeners are executed (the higher the
number, the earlier a listener is executed). This is useful when you need to
guarantee that one listener is executed before another. The priorities of the
internal Symfony listeners usually range from ``-256`` to ``256`` but your
own listeners can use any positive or negative integer.

javiereguiluz added a commit that referenced this issue Jan 10, 2023
…stering listeners (alamirault)

This PR was squashed before being merged into the 5.4 branch.

Discussion
----------

[EventDispatcher] Allow to omit the event name when registering listeners

Try complete #12451

I think best practice today is to not define `event` manually

`@derrabus`, I will appreciate your review 🙏

Commits
-------

62f5165 [EventDispatcher] Allow to omit the event name when registering listeners
@javiereguiluz
Copy link
Member

Fixed in #17685.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
0