File tree 1 file changed +11
-8
lines changed
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -46,21 +46,24 @@ Services & Configuration
46
46
If you want to modify service definitions of another bundle, you can use a compiler
47
47
pass to change the class of the service or to modify method calls. In the following
48
48
example, the implementing class for the ``original-service-id `` is changed to
49
- ``App\YourService ``::
49
+ ``App\YourService ``:
50
+
51
+ .. code-block :: diff
50
52
51
53
// src/Kernel.php
52
54
namespace App;
53
55
54
- use App\Service\YourService;
55
- use Symfony\Component\DependencyInjection\ContainerBuilder;
56
+ // ...
57
+ + use App\Service\YourService;
58
+ + use Symfony\Component\DependencyInjection\ContainerBuilder;
56
59
57
60
class Kernel extends BaseKernel
58
61
{
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
+ + }
64
67
}
65
68
66
69
For more information on compiler passes, see :doc: `/service_container/compiler_passes `.
You can’t perform that action at this time.
0 commit comments