File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -46,20 +46,19 @@ Services & Configuration
4646If you want to modify service definitions of another bundle, you can use a compiler
4747pass to change the class of the service or to modify method calls. In the following
4848example, the implementing class for the ``original-service-id `` is changed to
49- ``Acme\DemoBundle \YourService ``::
49+ ``App \YourService ``::
5050
51- // src/Acme/DemoBundle/DependencyInjection/Compiler/OverrideServiceCompilerPass .php
52- namespace Acme\DemoBundle\DependencyInjection\Compiler ;
51+ // src/Kernel .php
52+ namespace App ;
5353
54- use Acme\DemoBundle\YourService;
55- use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
54+ use App\Service\YourService;
5655 use Symfony\Component\DependencyInjection\ContainerBuilder;
5756
58- class OverrideServiceCompilerPass implements CompilerPassInterface
57+ class Kernel extends BaseKernel
5958 {
6059 public function process(ContainerBuilder $container)
6160 {
62- $definition = $container->getDefinition ('original-service-id');
61+ $definition = $container->findDefinition ('original-service-id');
6362 $definition->setClass(YourService::class);
6463 }
6564 }
You can’t perform that action at this time.
0 commit comments