Skip to content

Conversation

@matthieuauger
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT

Currently if you run debug:event-dispatcher on an event without registered listeners, the output looks like this

capture d ecran de 2014-10-13 00 43 26

This PR just add a friendly message like debug:container or debug:router :

capture d ecran de 2014-10-13 00 44 38

@matthieuauger matthieuauger changed the title Displays friendly message if the event does not have any registered listeners [FrameworkBundle] [DX] Displays friendly message if the event does not have any registered listeners Oct 12, 2014
@Tobion
Copy link
Contributor

Tobion commented Oct 12, 2014

It should not be an exception but a notice of some kind. See symfony/symfony-docs#4265

@stof
Copy link
Member

stof commented Oct 13, 2014

I agree that it should not be an exception. Not having any listener registered does not mean it is a failure

@matthieuauger
Copy link
Contributor Author

Thanks, I didn't know there was an initiative for console style, this is great. I should wait for #12035

@fabpot
Copy link
Member

fabpot commented Feb 5, 2015

@matthieuauger Any news on this PR?

@matthieuauger
Copy link
Contributor Author

I was waiting for symfony/symfony-docs#4265 but it seems to be dead.
I'll quickly update this PR to display a standard notice instead.

@matthieuauger matthieuauger force-pushed the debug-event-dispatcher-unkown-event branch 2 times, most recently from dab62b7 to 5161a7e Compare February 17, 2015 16:54
@matthieuauger
Copy link
Contributor Author

I updated the PR to display a message instead of an exception. I followed the Console Style Guide for the formatting. Any feedbacks welcome

screen shot 2015-02-17 at 18 05 46

The PR is currently headed to master, but I think it should be merged in 2.6. Tell me if you want me to create another PR

@matthieuauger matthieuauger force-pushed the debug-event-dispatcher-unkown-event branch from 5161a7e to 8bb9302 Compare February 23, 2015 09:54
@fabpot
Copy link
Member

fabpot commented Mar 26, 2015

Thank you @matthieuauger.

@fabpot fabpot closed this Mar 26, 2015
fabpot added a commit that referenced this pull request Mar 26, 2015
…event does not have any registered listeners (matthieuauger)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #12216).

Discussion
----------

[FrameworkBundle] [DX] Displays friendly message if the event does not have any registered listeners

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT

Currently if you run debug:event-dispatcher on an event without registered listeners, the output looks like this

![capture d ecran de 2014-10-13 00 43 26](https://cloud.githubusercontent.com/assets/1172099/4607814/486213e4-5261-11e4-93b3-6ef009c19a05.png)

This PR just add a friendly message like debug:container or debug:router :

![capture d ecran de 2014-10-13 00 44 38](https://cloud.githubusercontent.com/assets/1172099/4607819/7a28a01e-5261-11e4-9b07-d0ca36725da2.png)

Commits
-------

a5628bd Displays friendly message if the event does not have any registered listeners
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