File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11Types of Injection
22==================
33
4- Making a class's dependencies explicit and requiring that they must injected
4+ Making a class's dependencies explicit and requiring that they must be injected
55into it is a good way of making a class more reusable, testable and decoupled
66from the others.
77
88There are several ways that the dependencies can be injected. Each injection
99point has advantages and disadvantages to consider, as well as different
10- ways of working with when using the service container.
10+ ways of working with them when using the service container.
1111
1212Constructor Injection
1313---------------------
@@ -81,7 +81,7 @@ service container configuration:
8181 Type hinting the injected object means that you can be sure that a suitable
8282 dependency has been injected. By type-hinting, you'll get a clear error
8383 immediately if an unsuitable dependency is injected. By type hinting
84- using an interface rather than a class you can make the choice of the dependency
84+ using an interface rather than a class you can make the choice of dependency
8585 more flexible. And assuming you only use methods defined in the interface,
8686 you can gain that flexibility and still safely use the object.
8787
You can’t perform that action at this time.
0 commit comments