Skip to content

[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

Closed
wants to merge 2 commits into from

Conversation

HeahDude
Copy link
Contributor

Fixes #7538.

On top of #8232, until this merge please just review b1e658e.

@HeahDude HeahDude force-pushed the fix/di-instanceof branch from b1e658e to 0e993e5 Compare August 1, 2017 08:35
@HeahDude HeahDude changed the base branch from master to 3.3 August 1, 2017 08:39
@HeahDude
Copy link
Contributor Author

HeahDude commented Aug 1, 2017

#8232 has been merged, rebased here.

----------------------------------

And the final big change is ``_instanceof``, it acts as a default definition
template (see `service-33-default_definition`_), but only for service whose
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

services

5) Auto-configure with _instanceof
----------------------------------

And the final big change is ``_instanceof``, it acts as a default definition
Copy link
Member

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.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

share

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:
Copy link
Member

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"

@HeahDude
Copy link
Contributor Author

HeahDude commented Aug 5, 2017

@xabbuh I've addressed your comments, thanks!

)
;

$this->registerClasses($definition, 'AppBundle\\', '../../src/AppBundle/{Entity,Repository}');
Copy link
Member

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">
Copy link
Contributor

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

greg0ire pushed a commit to greg0ire/symfony-docs that referenced this pull request Oct 9, 2017
@xabbuh
Copy link
Member

xabbuh commented Oct 9, 2017

will be finished in #8496

@xabbuh xabbuh closed this Oct 9, 2017
greg0ire pushed a commit to greg0ire/symfony-docs that referenced this pull request Oct 9, 2017
greg0ire pushed a commit to greg0ire/symfony-docs that referenced this pull request Oct 10, 2017
xabbuh added a commit that referenced this pull request Oct 13, 2017
This PR was merged into the 3.3 branch.

Discussion
----------

[DI] Added _instanceof example

@HeahDude seems to be away, and I think this is badly needed in the docs, so let's carry his PR.

Closes #8239

Commits
-------

691c547 [DI] Added _instanceof example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants