Skip to content

[EventDispatcher] Document event name aliases #12420

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
Feb 7, 2020

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Oct 4, 2019

This PR fixes #12418 by documenting symfony/symfony#33793

Question: On the component's doc page, the sidebar block "Registering Event Listeners and Subscribers in the Service Container" has grown a bit larger with my changes. Would it make sense to move that block to a dedicated page now?

@derrabus derrabus force-pushed the improvement/custom-aliased-events branch from a2c105e to 4bc9fe9 Compare October 4, 2019 19:13
@wouterj
Copy link
Member

wouterj commented Oct 7, 2019

Thanks a lot for this extensive documentation @derrabus!

I think we won't need to document this in the components section. If there is someone that uses both these components in a standalone application and wants this behaviour, they'll probably find out how to use it themselves. We might only want to add one sentences (like To alias event classes to event names, use the :class:`....` class.).

For the main guide, I think the part about your custom aliases should probably be moved to a subtopic, as it's an advanced usage. But before you do anything, let's hear what @javiereguiluz thinks about that as he's busy creating a consistent structure of the documentation these weeks.

@derrabus derrabus force-pushed the improvement/custom-aliased-events branch from e2f12ab to c87632c Compare October 7, 2019 14:09
@OskarStark OskarStark requested a review from wouterj November 1, 2019 05:24
@OskarStark OskarStark added this to the 4.4 milestone Nov 1, 2019
@derrabus
Copy link
Member Author

derrabus commented Feb 7, 2020

Is there anything left for me to do to get this PR merged?

@@ -246,6 +246,73 @@ there are some minor advantages for each of them:
* **Listeners are more flexible** because bundles can enable or disable each of
them conditionally depending on some configuration value.

.. _event-aliases:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed as it is not used and the anchor does not differ from the current headline.

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor, please ping me afterwards and we are good to go 🚀

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice contribution! Thank you.

@@ -220,11 +220,55 @@ determine which instance is passed.
$containerBuilder->register('subscriber_service_id', \AcmeSubscriber::class)
->addTag('kernel.event_subscriber');

``RegisterListenersPass`` is able to resolve aliased class names which for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is able to resolve -> resolves ?

@OskarStark
Copy link
Contributor

Thank you, I made the changes while merging! 👍

OskarStark added a commit that referenced this pull request Feb 7, 2020
This PR was merged into the 4.4 branch.

Discussion
----------

[EventDispatcher] Document event name aliases

This PR fixes #12418 by documenting symfony/symfony#33793

Question: On the component's doc page, the `sidebar` block "Registering Event Listeners and Subscribers in the Service Container" has grown a bit larger with my changes. Would it make sense to move that block to a dedicated page now?

Commits
-------

c87632c [EventDispatcher] Document event name aliases.
OskarStark added a commit that referenced this pull request Feb 7, 2020
@OskarStark OskarStark merged commit c87632c into symfony:4.4 Feb 7, 2020
OskarStark added a commit that referenced this pull request Feb 7, 2020
* 4.4:
  Minor #12420
  [EventDispatcher] Document event name aliases.
OskarStark added a commit that referenced this pull request Feb 7, 2020
* 5.0:
  Remove old versionadded directives
  Minor #12420
  [EventDispatcher] Document event name aliases.
@derrabus
Copy link
Member Author

derrabus commented Feb 7, 2020

Thank you, @OskarStark. 😃

@derrabus derrabus deleted the improvement/custom-aliased-events branch February 7, 2020 13:09
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.

7 participants