Skip to content

Added: Missing comment on XML and PHP code-block #13979

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
Jul 24, 2020
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
8 changes: 8 additions & 0 deletions service_container/service_decoration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ but keeps a reference of the old one as ``App\DecoratingMailer.inner``:
<services>
<service id="AppBundle\Mailer"/>

<!-- overrides the AppBundle\Mailer service
but that service is still available as AppBundle\DecoratingMailer.inner
private, because usually you do not need to fetch AppBundle\DecoratingMailer directly -->
<service id="AppBundle\DecoratingMailer"
decorates="AppBundle\Mailer"
public="false"
>
<!-- pass the old service as an argument -->
<argument type="service" id="AppBundle\DecoratingMailer.inner"/>
</service>

Expand All @@ -103,9 +107,13 @@ but keeps a reference of the old one as ``App\DecoratingMailer.inner``:

$container->register(Mailer::class);

// overrides the AppBundle\Mailer service
// but that service is still available as AppBundle\DecoratingMailer.inner
$container->register(DecoratingMailer::class)
->setDecoratedService(Mailer::class)
// pass the old service as an argument
->addArgument(new Reference(DecoratingMailer::class.'.inner'))
// private, because usually you do not need to fetch AppBundle\DecoratingMailer directly
->setPublic(false)
;

Expand Down