File tree 8 files changed +57
-23
lines changed
8 files changed +57
-23
lines changed Original file line number Diff line number Diff line change 49
49
50
50
<service id =" session_listener" class =" Symfony\Component\HttpKernel\EventListener\SessionListener" >
51
51
<tag name =" kernel.event_subscriber" />
52
- <argument type =" service" >
53
- <service class =" Symfony\Component\DependencyInjection\ServiceLocator" >
54
- <tag name =" container.service_locator" />
55
- <argument type =" collection" >
56
- <argument key =" session" type =" service" id =" session" on-invalid =" ignore" />
57
- </argument >
58
- </service >
59
- </argument >
52
+ <tag name =" container.service_subscriber" id =" session" />
53
+ <argument type =" service" id =" container" />
60
54
</service >
61
55
62
56
<service id =" session.save_listener" class =" Symfony\Component\HttpKernel\EventListener\SaveSessionListener" >
Original file line number Diff line number Diff line change 22
22
23
23
<service id =" test.session.listener" class =" Symfony\Component\HttpKernel\EventListener\TestSessionListener" >
24
24
<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" />
33
27
</service >
34
28
</services >
35
29
</container >
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Bundle \FrameworkBundle \Routing ;
13
13
14
+ use Symfony \Component \Config \Loader \LoaderInterface ;
14
15
use Symfony \Component \DependencyInjection \Config \ContainerParametersResource ;
16
+ use Symfony \Component \DependencyInjection \ServiceSubscriberInterface ;
15
17
use Symfony \Component \Routing \Router as BaseRouter ;
16
18
use Symfony \Component \Routing \RequestContext ;
17
19
use Symfony \Component \DependencyInjection \ContainerInterface ;
25
27
*
26
28
* @author Fabien Potencier <[email protected] >
27
29
*/
28
- class Router extends BaseRouter implements WarmableInterface
30
+ class Router extends BaseRouter implements WarmableInterface, ServiceSubscriberInterface
29
31
{
30
32
private $ container ;
31
33
private $ collectedParameters = array ();
@@ -173,4 +175,14 @@ private function resolve($value)
173
175
174
176
return str_replace ('%% ' , '% ' , $ escapedValue );
175
177
}
178
+
179
+ /**
180
+ * {@inheritdoc}
181
+ */
182
+ public static function getSubscribedServices ()
183
+ {
184
+ return array (
185
+ 'routing.loader ' => LoaderInterface::class,
186
+ );
187
+ }
176
188
}
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Bundle \TwigBundle \CacheWarmer ;
13
13
14
14
use Psr \Container \ContainerInterface ;
15
+ use Symfony \Component \DependencyInjection \ServiceSubscriberInterface ;
15
16
use Symfony \Component \Finder \Finder ;
16
17
use Symfony \Component \HttpKernel \CacheWarmer \CacheWarmerInterface ;
17
18
use Symfony \Bundle \FrameworkBundle \CacheWarmer \TemplateFinderInterface ;
25
26
*
26
27
* @author Fabien Potencier <[email protected] >
27
28
*/
28
- class TemplateCacheCacheWarmer implements CacheWarmerInterface
29
+ class TemplateCacheCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
29
30
{
30
31
protected $ container ;
31
32
protected $ finder ;
@@ -92,6 +93,16 @@ public function isOptional()
92
93
return true ;
93
94
}
94
95
96
+ /**
97
+ * {@inheritdoc}
98
+ */
99
+ public static function getSubscribedServices ()
100
+ {
101
+ return array (
102
+ 'twig ' => \Twig_Environment::class,
103
+ );
104
+ }
105
+
95
106
/**
96
107
* Find templates in the given directory.
97
108
*
Original file line number Diff line number Diff line change 27
27
28
28
<service id =" twig.cache_warmer" class =" Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer" public =" false" >
29
29
<tag name =" kernel.cache_warmer" />
30
- <argument type =" service" id =" service_container" />
30
+ <tag name =" container.service_subscriber" id =" twig" />
31
+ <argument type =" service" id =" container" />
31
32
<argument type =" service" id =" templating.finder" on-invalid =" ignore" />
32
33
<argument type =" collection" /> <!-- Twig paths -->
33
34
</service >
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ CHANGELOG
6
6
7
7
* added the possibility to change the query string parameter used by ` UriSigner `
8
8
* deprecated ` LazyLoadingFragmentHandler::addRendererService() `
9
- * added ` SessionListener `
10
- * added ` TestSessionListener `
11
9
12
10
3.2.0
13
11
-----
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \HttpKernel \EventListener ;
13
13
14
14
use Psr \Container \ContainerInterface ;
15
+ use Symfony \Component \DependencyInjection \ServiceSubscriberInterface ;
16
+ use Symfony \Component \HttpFoundation \Session \SessionInterface ;
15
17
16
18
/**
17
19
* Sets the session in the request.
20
22
*
21
23
* @final since version 3.3
22
24
*/
23
- class SessionListener extends AbstractSessionListener
25
+ class SessionListener extends AbstractSessionListener implements ServiceSubscriberInterface
24
26
{
25
27
private $ container ;
26
28
@@ -37,4 +39,14 @@ protected function getSession()
37
39
38
40
return $ this ->container ->get ('session ' );
39
41
}
42
+
43
+ /**
44
+ * {@inheritdoc}
45
+ */
46
+ public static function getSubscribedServices ()
47
+ {
48
+ return array (
49
+ 'session ' => '? ' .SessionInterface::class,
50
+ );
51
+ }
40
52
}
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \HttpKernel \EventListener ;
13
13
14
14
use Psr \Container \ContainerInterface ;
15
+ use Symfony \Component \DependencyInjection \ServiceSubscriberInterface ;
16
+ use Symfony \Component \HttpFoundation \Session \SessionInterface ;
15
17
16
18
/**
17
19
* Sets the session in the request.
20
22
*
21
23
* @final since version 3.3
22
24
*/
23
- class TestSessionListener extends AbstractTestSessionListener
25
+ class TestSessionListener extends AbstractTestSessionListener implements ServiceSubscriberInterface
24
26
{
25
27
private $ container ;
26
28
@@ -37,4 +39,14 @@ protected function getSession()
37
39
38
40
return $ this ->container ->get ('session ' );
39
41
}
42
+
43
+ /**
44
+ * {@inheritdoc}
45
+ */
46
+ public static function getSubscribedServices ()
47
+ {
48
+ return array (
49
+ 'session ' => '? ' .SessionInterface::class,
50
+ );
51
+ }
40
52
}
You can’t perform that action at this time.
0 commit comments