File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -46,20 +46,19 @@ 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
- ``Acme\DemoBundle \YourService ``::
49
+ ``App \YourService ``::
50
50
51
- // src/Acme/DemoBundle/DependencyInjection/Compiler/OverrideServiceCompilerPass .php
52
- namespace Acme\DemoBundle\DependencyInjection\Compiler ;
51
+ // src/Kernel .php
52
+ namespace App ;
53
53
54
- use Acme\DemoBundle\YourService;
55
- use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
54
+ use App\Service\YourService;
56
55
use Symfony\Component\DependencyInjection\ContainerBuilder;
57
56
58
- class OverrideServiceCompilerPass implements CompilerPassInterface
57
+ class Kernel extends BaseKernel
59
58
{
60
59
public function process(ContainerBuilder $container)
61
60
{
62
- $definition = $container->getDefinition ('original-service-id');
61
+ $definition = $container->findDefinition ('original-service-id');
63
62
$definition->setClass(YourService::class);
64
63
}
65
64
}
You can’t perform that action at this time.
0 commit comments