-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Deprecated ContainerAwareEventDispatcher #7372
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
Conversation
Instead of documenting the deprecation I would update the example to show code that will be working with Symfony 4.0 too. |
@xabbuh you mean the example in |
Yes, maybe move it to its own article and then also add a link in the existing chapter to it. |
I wonder ... why not remove that example entirely? It doesn't explain nothing special ... just how to define services with tags, right? |
Fine for me too. I am just afraid that users with older Symfony versions might be confused (sure, in an ideal world they wouldn't read the 3.2 docs, but you know what's going on). |
I've checked other articles and I have a question. In $definition = new Definition(AppExtension::class);
$definition->setPublic(false);
$definition->addTag('twig.extension');
$container->setDefinition('app.twig_extension', $definition); But that's not true, right? You need to add some special compiler pass to manage the That's why the example in So I propose the following:
|
Well, |
Registering service definitions and tagging them with the ``kernel.event_listener`` | ||
and ``kernel.event_subscriber`` tags is not enough to enable the event listeners | ||
and event subscribers. You must also register the ``RegisterListenersPass()`` | ||
compiler pass in the container builder:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove the "compiler pass" part here. This reads a bit weird.
Registering service definitions and tagging them with the | ||
``kernel.event_listener`` and ``kernel.event_subscriber`` tags is not enough | ||
to enable the event listeners and event subscribers. You must also register | ||
in the container builder a compiler pass called ``RegisterListenersPass()``:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must also register a compiler pass call RegisterListenersPass
in the container builder
👍 Status: Reviewed |
Thank you @javiereguiluz. |
This fixes #7340.