Skip to content

Commit 0d8863b

Browse files
committed
remove service when base class is missing
1 parent ec781c9 commit 0d8863b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Symfony/Bridge/Twig/TwigEngine.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Bridge\Twig;
1313

14-
@trigger_error('The '.TwigEngine::class.' class is deprecated since version 4.3 and will be removed in 5.0; use \Twig\Environment instead.', E_USER_DEPRECATED);
15-
1614
use Symfony\Component\Templating\EngineInterface;
1715
use Symfony\Component\Templating\StreamingEngineInterface;
1816
use Symfony\Component\Templating\TemplateNameParserInterface;

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\TwigBundle\DependencyInjection\Compiler;
1313

14+
use Symfony\Bridge\Twig\TwigEngine;
1415
use Symfony\Component\DependencyInjection\Alias;
1516
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -119,6 +120,10 @@ public function process(ContainerBuilder $container)
119120
$loader = $container->getDefinition('twig.loader.filesystem');
120121
$loader->setMethodCalls(array_merge($twigLoader->getMethodCalls(), $loader->getMethodCalls()));
121122

123+
if (!class_exists(TwigEngine::class)) {
124+
$container->removeDefinition('templating.engine.twig');
125+
}
126+
122127
$twigLoader->clearTag('twig.loader');
123128
} else {
124129
$container->setAlias('twig.loader.filesystem', new Alias('twig.loader.native_filesystem', false));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy