I think there may have been some misunderstanding of what the official documentation says. In most cases, you want to insert a request directly with the scope="request" attribute in the service element. This will accelerate the expansion of the scope.
<service id="zayso_core.openid.rpx" class="Zayso\CoreBundle\Component\OpenidRpx" public="true" scope="request">
or yml
zayso_core.openid.rpx: class: Zayso\CoreBundle\Component\OpenidRpx public: true scope: request
This is only in special cases, such as Twig extensions, where you need to insert a container.
And the core is not even mentioned on the page in the area. Kernel injection is much worse (conceptually) than container injection.
UPDATE: for S2.4 and newer use @Blowski answer below.
Cerad Feb 18 2018-12-18T00: 00Z
source share