File tree Expand file tree Collapse file tree 4 files changed +3
-6
lines changed
DependencyInjection/Compiler Expand file tree Collapse file tree 4 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 44namespace SimonMarx \Symfony \Bundles \ServiceAnnotations \DependencyInjection \Compiler ;
55
66
7- use App \Serializer \CircularReference \DefaultCircularReferenceHandler ;
87use SimonMarx \Symfony \Bundles \ServiceAnnotations \Annotation \ServiceTag ;
98use SimonMarx \Symfony \Bundles \ServiceAnnotations \Annotation \ServiceTagArgument ;
109use SimonMarx \Symfony \Bundles \ServiceAnnotations \Exception \InvalidServiceAnnotationException ;
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ class SomeChild extends MyParent {}
202202```
203203
204204
205- #### Example 5 : DependencyInjection via Annotation
205+ #### Example 6 : DependencyInjection via Annotation
206206
207207In case you want to inject something from your container into the constructor (e.g. tagged_iterator) which is not handled by autowiring
208208you can use the ` @DependencyInjection ` annotation.
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ public function build(ContainerBuilder $container)
2121 $ container
2222 ->addCompilerPass (new ServiceTagPass ())
2323 ->addCompilerPass (new ServiceAliasPass ())
24+ ->addCompilerPass (new DependencyInjectionPass ())
2425 ->addCompilerPass (new ServiceTagArgumentPass ())
25- ->addCompilerPass (new NoServicePass ())
26- ->addCompilerPass (new DependencyInjectionPass ());
26+ ->addCompilerPass (new NoServicePass ());
2727 }
2828}
Original file line number Diff line number Diff line change 33
44namespace SimonMarx \Symfony \Bundles \ServiceAnnotations \Utils ;
55
6-
7- use App \Command \PermissionPersistCommand ;
86use ReflectionClass ;
97use ReflectionException ;
108use ReflectionMethod ;
You can’t perform that action at this time.
0 commit comments