Skip to content

Commit 16dd2cc

Browse files
committed
also check for new twig environment class for when they remove the non-namespaced layer
1 parent bd28312 commit 16dd2cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/DependencyInjection/HttplugExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2727
use Symfony\Component\DependencyInjection\Reference;
2828
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
29+
use Twig\Environment as TwigEnvironment;
2930

3031
/**
3132
* @author David Buchmann <mail@davidbu.ch>
@@ -79,7 +80,7 @@ public function load(array $configs, ContainerBuilder $container)
7980
->addArgument($config['profiling']['captured_body_length'])
8081
;
8182

82-
if (!class_exists(\Twig_Environment::class)) {
83+
if (!class_exists(TwigEnvironment::class) && !class_exists(\Twig_Environment::class)) {
8384
$container->removeDefinition('httplug.collector.twig.http_message');
8485
}
8586
}

0 commit comments

Comments
 (0)