Skip to content

Commit a9adb5b

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: Remove paragraph about the impossibility to typehint a property
2 parents 093a625 + beec921 commit a9adb5b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

service_container/injection_types.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,11 @@ Another possibility is setting public fields of the class directly::
363363
};
364364
365365
There are mainly only disadvantages to using property injection, it is similar
366-
to setter injection but with these additional important problems:
366+
to setter injection but with this additional important problem:
367367

368368
* You cannot control when the dependency is set at all, it can be changed
369369
at any point in the object's lifetime.
370370

371-
* You cannot use type hinting so you cannot be sure what dependency is injected
372-
except by writing into the class code to explicitly test the class instance
373-
before using it.
374-
375371
But, it is useful to know that this can be done with the service container,
376372
especially if you are working with code that is out of your control, such
377373
as in a third party library, which uses public properties for its dependencies.

0 commit comments

Comments
 (0)