Skip to content

Search for pattern on debug:event-dispatcher #39323

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

Merged
merged 1 commit into from
Dec 5, 2020

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Dec 5, 2020

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR

When running bin/console event-dispatcher you may pass it an argument to show what event you are interested to see the listeners for. Example:

bin/console event-dispatcher kernel.request
bin/console debug:event-dispatcher "Symfony\Component\Security\Http\Event\CheckPassportEvent"

Since more and more events are using FQCN now, this is a handful to write. Other questions that I face is, should I use single backslash \ or double \\?

This PR propose that you can use a pattern as second argument. If there is no exact match, it will search for similar event names. Say:

bin/console debug:event-dispatcher CheckPassportEvent
bin/console debug:event-dispatcher checkpassport
bin/console debug:event-dispatcher Security
bin/console debug:event-dispatcher Security
bin/console debug:event-dispatcher App

#SymfonyHackday

@fabpot
Copy link
Member

fabpot commented Dec 5, 2020

Thank you @Nyholm.

@Nyholm
Copy link
Member Author

Nyholm commented Dec 5, 2020

Awesome. Thank you for the review and to merge.

@Nyholm Nyholm deleted the event-pattern branch December 5, 2020 15:41
@fabpot fabpot mentioned this pull request Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants