File tree Expand file tree Collapse file tree 8 files changed +57
-23
lines changed
Expand file tree Collapse file tree 8 files changed +57
-23
lines changed Original file line number Diff line number Diff line change 5353
5454 <service id =" session_listener" class =" Symfony\Component\HttpKernel\EventListener\SessionListener" >
5555 <tag name =" kernel.event_subscriber" />
56- <argument type =" service" >
57- <service class =" Symfony\Component\DependencyInjection\ServiceLocator" >
58- <tag name =" container.service_locator" />
59- <argument type =" collection" >
60- <argument key =" session" type =" service" id =" session" on-invalid =" ignore" />
61- </argument >
62- </service >
63- </argument >
56+ <tag name =" container.service_subscriber" id =" session" />
57+ <argument type =" service" id =" container" />
6458 </service >
6559
6660 <service id =" session.save_listener" class =" Symfony\Component\HttpKernel\EventListener\SaveSessionListener" >
Original file line number Diff line number Diff line change 2222
2323 <service id =" test.session.listener" class =" Symfony\Component\HttpKernel\EventListener\TestSessionListener" >
2424 <tag name =" kernel.event_subscriber" />
25- <argument type =" service" >
26- <service class =" Symfony\Component\DependencyInjection\ServiceLocator" >
27- <tag name =" container.service_locator" />
28- <argument type =" collection" >
29- <argument key =" session" type =" service" id =" session" on-invalid =" ignore" />
30- </argument >
31- </service >
32- </argument >
25+ <tag name =" container.service_subscriber" id =" session" />
26+ <argument type =" service" id =" container" />
3327 </service >
3428 </services >
3529</container >
Original file line number Diff line number Diff line change 1111
1212namespace Symfony \Bundle \FrameworkBundle \Routing ;
1313
14+ use Symfony \Component \Config \Loader \LoaderInterface ;
1415use Symfony \Component \DependencyInjection \Config \ContainerParametersResource ;
16+ use Symfony \Component \DependencyInjection \ServiceSubscriberInterface ;
1517use Symfony \Component \Routing \Router as BaseRouter ;
1618use Symfony \Component \Routing \RequestContext ;
1719use Symfony \Component \DependencyInjection \ContainerInterface ;
2527 *
2628 * @author Fabien Potencier <[email protected] > 2729 */
28- class Router extends BaseRouter implements WarmableInterface
30+ class Router extends BaseRouter implements WarmableInterface, ServiceSubscriberInterface
2931{
3032 private $ container ;
3133 private $ collectedParameters = array ();
@@ -173,4 +175,14 @@ private function resolve($value)
173175
174176 return str_replace ('%% ' , '% ' , $ escapedValue );
175177 }
178+
179+ /**
180+ * {@inheritdoc}
181+ */
182+ public static function getSubscribedServices ()
183+ {
184+ return array (
185+ 'routing.loader ' => LoaderInterface::class,
186+ );
187+ }
176188}
Original file line number Diff line number Diff line change 1212namespace Symfony \Bundle \TwigBundle \CacheWarmer ;
1313
1414use Psr \Container \ContainerInterface ;
15+ use Symfony \Component \DependencyInjection \ServiceSubscriberInterface ;
1516use Symfony \Component \Finder \Finder ;
1617use Symfony \Component \HttpKernel \CacheWarmer \CacheWarmerInterface ;
1718use Symfony \Bundle \FrameworkBundle \CacheWarmer \TemplateFinderInterface ;
2526 *
2627 * @author Fabien Potencier <[email protected] > 2728 */
28- class TemplateCacheCacheWarmer implements CacheWarmerInterface
29+ class TemplateCacheCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
2930{
3031 protected $ container ;
3132 protected $ finder ;
@@ -92,6 +93,16 @@ public function isOptional()
9293 return true ;
9394 }
9495
96+ /**
97+ * {@inheritdoc}
98+ */
99+ public static function getSubscribedServices ()
100+ {
101+ return array (
102+ 'twig ' => \Twig_Environment::class,
103+ );
104+ }
105+
95106 /**
96107 * Find templates in the given directory.
97108 *
Original file line number Diff line number Diff line change 2828
2929 <service id =" twig.cache_warmer" class =" Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer" public =" false" >
3030 <tag name =" kernel.cache_warmer" />
31- <argument type =" service" id =" service_container" />
31+ <tag name =" container.service_subscriber" id =" twig" />
32+ <argument type =" service" id =" container" />
3233 <argument type =" service" id =" templating.finder" on-invalid =" ignore" />
3334 <argument type =" collection" /> <!-- Twig paths -->
3435 </service >
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ CHANGELOG
88 * Deprecated the special ` SYMFONY__ ` environment variables
99 * added the possibility to change the query string parameter used by ` UriSigner `
1010 * deprecated ` LazyLoadingFragmentHandler::addRendererService() `
11- * added ` SessionListener `
12- * added ` TestSessionListener `
1311
14123.2.0
1513-----
Original file line number Diff line number Diff line change 1212namespace Symfony \Component \HttpKernel \EventListener ;
1313
1414use Psr \Container \ContainerInterface ;
15+ use Symfony \Component \DependencyInjection \ServiceSubscriberInterface ;
16+ use Symfony \Component \HttpFoundation \Session \SessionInterface ;
1517
1618/**
1719 * Sets the session in the request.
2022 *
2123 * @final since version 3.3
2224 */
23- class SessionListener extends AbstractSessionListener
25+ class SessionListener extends AbstractSessionListener implements ServiceSubscriberInterface
2426{
2527 private $ container ;
2628
@@ -37,4 +39,14 @@ protected function getSession()
3739
3840 return $ this ->container ->get ('session ' );
3941 }
42+
43+ /**
44+ * {@inheritdoc}
45+ */
46+ public static function getSubscribedServices ()
47+ {
48+ return array (
49+ 'session ' => '? ' .SessionInterface::class,
50+ );
51+ }
4052}
Original file line number Diff line number Diff line change 1212namespace Symfony \Component \HttpKernel \EventListener ;
1313
1414use Psr \Container \ContainerInterface ;
15+ use Symfony \Component \DependencyInjection \ServiceSubscriberInterface ;
16+ use Symfony \Component \HttpFoundation \Session \SessionInterface ;
1517
1618/**
1719 * Sets the session in the request.
2022 *
2123 * @final since version 3.3
2224 */
23- class TestSessionListener extends AbstractTestSessionListener
25+ class TestSessionListener extends AbstractTestSessionListener implements ServiceSubscriberInterface
2426{
2527 private $ container ;
2628
@@ -37,4 +39,14 @@ protected function getSession()
3739
3840 return $ this ->container ->get ('session ' );
3941 }
42+
43+ /**
44+ * {@inheritdoc}
45+ */
46+ public static function getSubscribedServices ()
47+ {
48+ return array (
49+ 'session ' => '? ' .SessionInterface::class,
50+ );
51+ }
4052}
You can’t perform that action at this time.
0 commit comments