8000 language tweak for the tip introduced in #3743 by xabbuh · Pull Request #3793 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

language tweak for the tip introduced in #3743 #3793

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

Merged
merged 1 commit into from
Apr 12, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions components/dependency_injection/parentservices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ a parent for a service.
use Symfony\Component\DependencyInjection\Reference;

// ...

$mailManager = new Definition();
$mailManager
->setAbstract(true);
Expand All @@ -254,11 +254,11 @@ a parent for a service.
))
;
$container->setDefinition('mail_manager', $mailManager);

$newsletterManager = new DefinitionDecorator('mail_manager');
$newsletterManager->setClass('%newsletter_manager.class%');
$container->setDefinition('newsletter_manager', $newsletterManager);

$greetingCardManager = new DefinitionDecorator('mail_manager');
$greetingCardManager->setClass('%greeting_card_manager.class%');
$container->setDefinition('greeting_card_manager', $greetingCardManager);
Expand Down Expand Up @@ -291,13 +291,13 @@ would cause an exception to be raised for a non-abstract service.
In order for parent dependencies to resolve, the ``ContainerBuilder`` must
first be compiled. See :doc:`/components/dependency_injection/compilation`
for more details.

.. tip::

In the examples shown, the classes sharing the same configuration also extend
from the same parent in PHP. This does not need to be the case though, you can
extract common parts of similar service definitions into a parent service without
also extending a parent class in PHP.
In the examples shown, the classes sharing the same configuration also
extend from the same parent class in PHP. This isn't necessary at all.
You can just extract common parts of similar service definitions into
a parent service without also extending a parent class in PHP.

Overriding Parent Dependencies
------------------------------
Expand Down Expand Up @@ -377,7 +377,7 @@ to the ``NewsletterManager`` class, the config would look like this:

// ...
$container->setDefinition('my_alternative_mailer', ...);

$mailManager = new Definition();
$mailManager
->setAbstract(true);
Expand Down
0