File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -639,32 +639,27 @@ to remove the ``kernel.reset`` tag from some services in your test environment::
639639 // src/Kernel.php
640640 namespace App;
641641
642- use App\DependencyInjection\Compiler\CustomPass;
643642 use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
643+ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
644644 use Symfony\Component\DependencyInjection\ContainerBuilder;
645645 use Symfony\Component\HttpKernel\Kernel as BaseKernel;
646646
647- class Kernel extends BaseKernel
647+ class Kernel extends BaseKernel implements CompilerPassInterface
648648 {
649649 use MicroKernelTrait;
650650
651651 // ...
652652
653- protected function build (ContainerBuilder $container): void
653+ protected function process (ContainerBuilder $container): void
654654 {
655655 if ('test' === $this->environment) {
656- $container->addCompilerPass(new class() implements CompilerPassInterface {
657- public function process(ContainerBuilder $container): void
658- {
659- // prevents the security token to be cleared
660- $container->getDefinition('security.token_storage')->clearTag('kernel.reset');
661-
662- // prevents Doctrine entities to be detached
663- $container->getDefinition('doctrine')->clearTag('kernel.reset');
664-
665- // ...
666- }
667- });
656+ // prevents the security token to be cleared
657+ $container->getDefinition('security.token_storage')->clearTag('kernel.reset');
658+
659+ // prevents Doctrine entities to be detached
660+ $container->getDefinition('doctrine')->clearTag('kernel.reset');
661+
662+ // ...
668663 }
669664 }
670665 }
You can’t perform that action at this time.
0 commit comments