File tree 1 file changed +11
-1
lines changed
src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,17 @@ public function process(ContainerBuilder $container)
28
28
$ definition = $ container ->getDefinition ('twig.runtime_loader ' );
29
29
$ mapping = array ();
30
30
foreach ($ container ->findTaggedServiceIds ('twig.runtime ' ) as $ id => $ attributes ) {
31
- $ mapping [$ container ->getDefinition ($ id )->getClass ()] = $ id ;
31
+ $ def = $ container ->getDefinition ($ id );
32
+
33
+ if (!$ def ->isPublic ()) {
34
+ throw new InvalidArgumentException (sprintf ('The service "%s" must be public as it can be lazy-loaded. ' , $ id ));
35
+ }
36
+
37
+ if ($ def ->isAbstract ()) {
38
+ throw new InvalidArgumentException (sprintf ('The service "%s" must not be abstract as it can be lazy-loaded. ' , $ id ));
39
+ }
40
+
41
+ $ mapping [$ def ->getClass ()] = $ id ;
32
42
}
33
43
34
44
$ definition ->replaceArgument (1 , $ mapping );
You can’t perform that action at this time.
0 commit comments