Skip to content

Commit 04db5ec

Browse files
committed
remove twig extension if TwigBundle is not installed
1 parent 11543b2 commit 04db5ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/DependencyInjection/SentryExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Sentry\SentryBundle\Tracing\Doctrine\DBAL\ConnectionConfigurator;
2626
use Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverMiddleware;
2727
use Sentry\SentryBundle\Tracing\Twig\TwigTracingExtension;
28+
use Sentry\SentryBundle\Twig\SentryExtension as TwigSentryExtension;
2829
use Sentry\Serializer\RepresentationSerializer;
2930
use Symfony\Bundle\TwigBundle\TwigBundle;
3031
use Symfony\Component\Cache\CacheItem;
@@ -263,6 +264,7 @@ private function registerTwigTracingConfiguration(ContainerBuilder $container, a
263264
}
264265

265266
if (!$isConfigEnabled) {
267+
$container->removeDefinition(TwigSentryExtension::class);
266268
$container->removeDefinition(TwigTracingExtension::class);
267269
}
268270
}

0 commit comments

Comments
 (0)