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 1
1
Types of Injection
2
2
==================
3
3
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
5
5
into it is a good way of making a class more reusable, testable and decoupled
6
6
from the others.
7
7
8
8
There are several ways that the dependencies can be injected. Each injection
9
9
point 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.
11
11
12
12
Constructor Injection
13
13
---------------------
@@ -81,7 +81,7 @@ service container configuration:
81
81
Type hinting the injected object means that you can be sure that a suitable
82
82
dependency has been injected. By type-hinting, you'll get a clear error
83
83
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
85
85
more flexible. And assuming you only use methods defined in the interface,
86
86
you can gain that flexibility and still safely use the object.
87
87
You can’t perform that action at this time.
0 commit comments