-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[DependencyInjection] Corrections and rephrasings #21347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DependencyInjection] Corrections and rephrasings #21347
Conversation
================== | ||
|
||
Making a class's dependencies explicit and requiring that they be injected | ||
Making a class's dependencies explicit and requiring that they must injected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making a class's dependencies explicit and requiring that they must injected | |
Making a class's dependencies explicit and requiring that they must be injected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xabbuh I corrected it.
dependency has been injected. By type-hinting, you'll get a clear error | ||
immediately if an unsuitable dependency is injected. By type hinting | ||
using an interface rather than a class you can make the choice of dependency | ||
using an interface rather than a class you can make the choice of the dependency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks wrong to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xabbuh Finally, I deleted the "the".
There are several ways that the dependencies can be injected. Each injection | ||
point has advantages and disadvantages to consider, as well as different | ||
ways of working with them when using the service container. | ||
ways of working with when using the service container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks wrong to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xabbuh I finally put again them. It is ok.
Making a class's dependencies explicit and requiring that they must injected | ||
into it is a good way of making a class more reusable, testable and decoupled | ||
from others. | ||
from the others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from the others. | |
from other parts of the code. |
Maybe like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xabbuh Yes, I think it is nice. I replaced with your suggestion.
8f1f2f0
to
072f64e
Compare
Thanks Stephan! |
Some corrections and rephrasings concerning the documentation.