-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[DI] Added _instanceof example #8239
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
Conversation
b1e658e
to
0e993e5
Compare
#8232 has been merged, rebased here. |
service_container/3.3-di-changes.rst
Outdated
---------------------------------- | ||
|
||
And the final big change is ``_instanceof``, it acts as a default definition | ||
template (see `service-33-default_definition`_), but only for service whose |
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.
services
service_container/3.3-di-changes.rst
Outdated
5) Auto-configure with _instanceof | ||
---------------------------------- | ||
|
||
And the final big change is ``_instanceof``, it acts as a default definition |
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.
Let's start a new sentence with it
to split this long one.
service_container/3.3-di-changes.rst
Outdated
And the final big change is ``_instanceof``, it acts as a default definition | ||
template (see `service-33-default_definition`_), but only for service whose | ||
class matches a defined one. | ||
This can be very useful when many services shares some tag that cannot be |
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.
share
service_container/3.3-di-changes.rst
Outdated
template (see `service-33-default_definition`_), but only for service whose | ||
class matches a defined one. | ||
This can be very useful when many services shares some tag that cannot be | ||
inherited from abstract definition: |
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.
"[...] form abstract definitions" or "[...] from an abstract definition"
@xabbuh I've addressed your comments, thanks! |
) | ||
; | ||
|
||
$this->registerClasses($definition, 'AppBundle\\', '../../src/AppBundle/{Entity,Repository}'); |
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.
we don't have this in the YAML or XML example
<services> | ||
<!-- ... --> | ||
|
||
<instanceof class="AppBundle\Domain\LoaderInterface" public="true"> |
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.
Looks like it's id
instead of class
based of my research in the codebase with 3.3
will be finished in #8496 |
Fixes #7538.
On top of #8232, until this merge please just review b1e658e.