Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 92abf48

Browse filesBrowse files
committed
Remove more code related to the legacy templating services
1 parent e3fabe5 commit 92abf48
Copy full SHA for 92abf48

File tree

6 files changed

+4
-29
lines changed
Filter options

6 files changed

+4
-29
lines changed

‎src/Symfony/Bridge/Twig/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/composer.json
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"symfony/mime": "^4.4|^5.0",
3131
"symfony/polyfill-intl-icu": "~1.0",
3232
"symfony/routing": "^4.4|^5.0",
33-
"symfony/templating": "^4.4|^5.0",
3433
"symfony/translation": "^4.4|^5.0",
3534
"symfony/yaml": "^4.4|^5.0",
3635
"symfony/security-acl": "^2.8|^3.0",
@@ -56,7 +55,6 @@
5655
"symfony/form": "For using the FormExtension",
5756
"symfony/http-kernel": "For using the HttpKernelExtension",
5857
"symfony/routing": "For using the RoutingExtension",
59-
"symfony/templating": "For using the TwigEngine",
6058
"symfony/translation": "For using the TranslationExtension",
6159
"symfony/yaml": "For using the YamlExtension",
6260
"symfony/security-core": "For using the SecurityExtension",

‎src/Symfony/Bundle/FrameworkBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/composer.json
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"symfony/serializer": "^4.4|^5.0",
5050
"symfony/stopwatch": "^4.4|^5.0",
5151
"symfony/translation": "^4.4|^5.0",
52-
"symfony/templating": "^4.4|^5.0",
5352
"symfony/twig-bundle": "^5.0",
5453
"symfony/validator": "^4.4|^5.0",
5554
"symfony/var-dumper": "^4.4|^5.0",

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616

1717
/**
18-
* Registers the Twig exception listener if Twig is registered as a templating engine.
18+
* Registers the Twig exception listener if required dependencies do exist.
1919
*
2020
* @author Fabien Potencier <fabien@symfony.com>
2121
*/
@@ -27,14 +27,9 @@ public function process(ContainerBuilder $container)
2727
return;
2828
}
2929

30-
// register the exception controller only if Twig is enabled and required dependencies do exist
30+
// register the exception controller only if required dependencies do exist
3131
if (!class_exists('Symfony\Component\Debug\Exception\FlattenException') || !interface_exists('Symfony\Component\EventDispatcher\EventSubscriberInterface')) {
3232
$container->removeDefinition('twig.exception_listener');
33-
} elseif ($container->hasParameter('templating.engines')) {
34-
$engines = $container->getParameter('templating.engines');
35-
if (!\in_array('twig', $engines)) {
36-
$container->removeDefinition('twig.exception_listener');
37-
}
3833
}
3934
}
4035
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
+1-11Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,7 @@ public function process(ContainerBuilder $container)
8787
$container->getDefinition('twig.extension.weblink')->addTag('twig.extension');
8888
}
8989

90-
$twigLoader = $container->getDefinition('twig.loader.native_filesystem');
91-
if ($container->has('templating')) {
92-
$loader = $container->getDefinition('twig.loader.filesystem');
93-
$loader->setMethodCalls(array_merge($twigLoader->getMethodCalls(), $loader->getMethodCalls()));
94-
95-
$twigLoader->clearTag('twig.loader');
96-
} else {
97-
$container->setAlias('twig.loader.filesystem', new Alias('twig.loader.native_filesystem', false));
98-
$container->removeDefinition('templating.engine.twig');
99-
$container->removeDefinition('twig.cache_warmer');
100-
}
90+
$container->setAlias('twig.loader.filesystem', new Alias('twig.loader.native_filesystem', false));
10191

10292
if ($container->has('assets.packages')) {
10393
$container->getDefinition('twig.extension.assets')->addTag('twig.extension');

‎src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/ExtensionPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/ExtensionPassTest.php
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public function testProcessDoesNotDropExistingFileLoaderMethodCalls()
2424
$container->setParameter('kernel.debug', false);
2525

2626
$container->register('twig.app_variable', '\Symfony\Bridge\Twig\AppVariable');
27-
$container->register('templating', '\Symfony\Bundle\TwigBundle\TwigEngine');
2827
$container->register('twig.extension.yaml');
2928
$container->register('twig.extension.debug.stopwatch');
3029
$container->register('twig.extension.expression');
@@ -33,14 +32,9 @@ public function testProcessDoesNotDropExistingFileLoaderMethodCalls()
3332
$nativeTwigLoader->addMethodCall('addPath', []);
3433
$container->setDefinition('twig.loader.native_filesystem', $nativeTwigLoader);
3534

36-
$filesystemLoader = new Definition('\Symfony\Bundle\TwigBundle\Loader\FilesystemLoader');
37-
$filesystemLoader->setArguments([null, null, null]);
38-
$filesystemLoader->addMethodCall('addPath', []);
39-
$container->setDefinition('twig.loader.filesystem', $filesystemLoader);
40-
4135
$extensionPass = new ExtensionPass();
4236
$extensionPass->process($container);
4337

44-
$this->assertCount(2, $filesystemLoader->getMethodCalls());
38+
$this->assertCount(1, $nativeTwigLoader->getMethodCalls());
4539
}
4640
}

‎src/Symfony/Component/HttpKernel/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/composer.json
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"symfony/process": "^4.4|^5.0",
3737
"symfony/routing": "^4.4|^5.0",
3838
"symfony/stopwatch": "^4.4|^5.0",
39-
"symfony/templating": "^4.4|^5.0",
4039
"symfony/translation": "^4.4|^5.0",
4140
"symfony/translation-contracts": "^1.1",
4241
"symfony/var-dumper": "^4.4|^5.0",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.