8000 Clarifying that our code is just additions · symfony/symfony-docs@09fb4b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 09fb4b1

Browse files
committed
Clarifying that our code is just additions
1 parent da666af commit 09fb4b1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

bundles/override.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,24 @@ Services & Configuration
4646
If you want to modify service definitions of another bundle, you can use a compiler
4747
pass to change the class of the service or to modify method calls. In the following
4848
example, the implementing class for the ``original-service-id`` is changed to
49-
``App\YourService``::
49+
``App\YourService``:
50+
51+
.. code-block:: diff
5052
5153
// src/Kernel.php
5254
namespace App;
5355
54-
use App\Service\YourService;
55-
use Symfony\Component\DependencyInjection\ContainerBuilder;
56+
// ...
57+
+ use App\Service\YourService;
58+
+ use Symfony\Component\DependencyInjection\ContainerBuilder;
5659
5760
class Kernel extends BaseKernel
5861
{
59-
public function process(ContainerBuilder $container)
60-
{
61-
$definition = $container->findDefinition('original-service-id');
62-
$definition->setClass(YourService::class);
63-
}
62+
+ public function process(ContainerBuilder $container)
63+
+ {
64+
+ $definition = $container->findDefinition('original-service-id');
65+
+ $definition->setClass(YourService::class);
66+
+ }
6467
}
6568
6669
For more information on compiler passes, see :doc:`/service_container/compiler_passes`.

0 commit comments

Comments
 (0)
0