Skip to content

Commit 5b0cce6

Browse files
committed
remove doctrine.orm.listeners.pdo_session_handler_schema_listener
workaround symfony/symfony#50322
1 parent fe47859 commit 5b0cce6

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

src/Autocomplete/tests/Fixtures/Kernel.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
use Symfony\Bundle\MakerBundle\MakerBundle;
1919
use Symfony\Bundle\SecurityBundle\SecurityBundle;
2020
use Symfony\Bundle\TwigBundle\TwigBundle;
21+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
22+
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
23+
use Symfony\Component\DependencyInjection\ContainerBuilder;
2124
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
2225
use Symfony\Component\DependencyInjection\Reference;
2326
use Symfony\Component\Form\FormFactoryInterface;
@@ -66,6 +69,16 @@ public function registerBundles(): iterable
6669
yield new ZenstruckFoundryBundle();
6770
}
6871

72+
protected function build(ContainerBuilder $container): void
73+
{
74+
$container->addCompilerPass(new class() implements CompilerPassInterface {
75+
public function process(ContainerBuilder $container): void
76+
{
77+
$container->removeDefinition('doctrine.orm.listeners.pdo_session_handler_schema_listener');
78+
}
79+
}, PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
80+
}
81+
6982
protected function configureContainer(ContainerConfigurator $c): void
7083
{
7184
$c->extension('framework', [

src/LiveComponent/tests/Fixtures/Kernel.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1717
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
1818
use Symfony\Bundle\TwigBundle\TwigBundle;
19+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
20+
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
21+
use Symfony\Component\DependencyInjection\ContainerBuilder;
1922
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
2023
use Symfony\Component\HttpFoundation\Response;
2124
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
@@ -26,6 +29,7 @@
2629
use Symfony\UX\TwigComponent\TwigComponentBundle;
2730
use Twig\Environment;
2831
use Zenstruck\Foundry\ZenstruckFoundryBundle;
32+
2933
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
3034

3135
/**
@@ -57,6 +61,16 @@ public function registerBundles(): iterable
5761
yield new ZenstruckFoundryBundle();
5862
}
5963

64+
protected function build(ContainerBuilder $container): void
65+
{
66+
$container->addCompilerPass(new class() implements CompilerPassInterface {
67+
public function process(ContainerBuilder $container): void
68+
{
69+
$container->removeDefinition('doctrine.orm.listeners.pdo_session_handler_schema_listener');
70+
}
71+
}, PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
72+
}
73+
6074
protected function configureContainer(ContainerConfigurator $c): void
6175
{
6276
$c->extension('framework', [
@@ -106,16 +120,15 @@ protected function configureContainer(ContainerConfigurator $c): void
106120

107121
$c->services()
108122
->defaults()
109-
->autowire()
110-
->autoconfigure()
123+
->autowire()
124+
->autoconfigure()
111125
// disable logging errors to the console
112126
->set('logger', NullLogger::class)
113127
->set(MoneyNormalizer::class)->autoconfigure()->autowire()
114128
->set(Entity2Normalizer::class)->autoconfigure()->autowire()
115129
->load(__NAMESPACE__.'\\Component\\', __DIR__.'/Component')
116130
->set(TestingDeterministicIdTwigExtension::class)
117-
->args([service('ux.live_component.deterministic_id_calculator')])
118-
;
131+
->args([service('ux.live_component.deterministic_id_calculator')]);
119132
}
120133

121134
protected function configureRoutes(RoutingConfigurator $routes): void

0 commit comments

Comments
 (0)