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 061f622

Browse filesBrowse files
committed
feature #31821 [FrameworkBundle][TwigBundle] Add missing deprecations for PHP templating layer (yceruto)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle][TwigBundle] Add missing deprecations for PHP templating layer | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As part of #21035 and 7169f4d Commits ------- 61613d0 Add missing deprecations for PHP templating layer
2 parents 693cbff + 61613d0 commit 061f622
Copy full SHA for 061f622

File tree

10 files changed

+29
-0
lines changed
Filter options

10 files changed

+29
-0
lines changed

‎UPGRADE-4.4.md

Copy file name to clipboardExpand all lines: UPGRADE-4.4.md
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ Messenger
3131
* Deprecated passing a `ContainerInterface` instance as first argument of the `ConsumeMessagesCommand` constructor,
3232
pass a `RoutableMessageBus` instance instead.
3333

34+
FrameworkBundle
35+
---------------
36+
37+
* Deprecated support for `templating` engine in `TemplateController`, use Twig instead
38+
3439
MonologBridge
3540
--------------
3641

‎UPGRADE-5.0.md

Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ FrameworkBundle
219219
* Removed support for legacy translations directories `src/Resources/translations/` and `src/Resources/<BundleName>/translations/`, use `translations/` instead.
220220
* Support for the legacy directory structure in `translation:update` and `debug:translation` commands has been removed.
221221
* Removed the "Psr\SimpleCache\CacheInterface" / "cache.app.simple" service, use "Symfony\Contracts\Cache\CacheInterface" / "cache.app" instead.
222+
* Removed support for `templating` engine in `TemplateController`, use Twig instead
222223

223224
HttpFoundation
224225
--------------

‎src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.4.0
5+
-----
6+
7+
* Deprecated support for `templating` engine in `TemplateController`, use Twig instead
8+
49
4.3.0
510
-----
611

‎src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class TemplateController
2929

3030
public function __construct(Environment $twig = null, EngineInterface $templating = null)
3131
{
32+
if (null !== $templating) {
33+
@trigger_error(sprintf('Using a "%s" instance for "%s" is deprecated since version 4.4; use a \Twig\Environment instance instead.', EngineInterface::class, __CLASS__), E_USER_DEPRECATED);
34+
}
35+
3236
$this->twig = $twig;
3337
$this->templating = $templating;
3438
}

‎src/Symfony/Bundle/FrameworkBundle/Tests/Controller/TemplateControllerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Controller/TemplateControllerTest.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public function testTwig()
3131
$this->assertEquals('bar', $controller('mytemplate')->getContent());
3232
}
3333

34+
/**
35+
* @group legacy
36+
*/
3437
public function testTemplating()
3538
{
3639
$templating = $this->getMockBuilder(EngineInterface::class)->getMock();

‎src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Bundle\TwigBundle\CacheWarmer;
1313

14+
@trigger_error('The '.TemplateCacheCacheWarmer::class.' class is deprecated since version 4.4 and will be removed in 5.0; use Twig instead.', E_USER_DEPRECATED);
15+
1416
use Psr\Container\ContainerInterface;
1517
use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface;
1618
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
@@ -26,6 +28,8 @@
2628
* as the Twig loader will need the cache generated by it.
2729
*
2830
* @author Fabien Potencier <fabien@symfony.com>
31+
*
32+
* @deprecated since version 4.4, to be removed in 5.0; use Twig instead.
2933
*/
3034
class TemplateCacheCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
3135
{

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public function process(ContainerBuilder $container)
105105
} else {
106106
$container->setAlias('twig.loader.filesystem', new Alias('twig.loader.native_filesystem', false));
107107
$container->removeDefinition('templating.engine.twig');
108+
$container->removeDefinition('twig.cache_warmer');
108109
}
109110

110111
if ($container->has('assets.packages')) {

‎src/Symfony/Bundle/TwigBundle/Resources/config/templating.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Resources/config/templating.xml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<argument type="service" id="twig" />
1818
<argument type="service" id="templating.name_parser" />
1919
<argument type="service" id="templating.locator" />
20+
21+
<deprecated>The "%service_id%" service is deprecated since Symfony 4.4 and will be removed in 5.0.</deprecated>
2022
</service>
2123
</services>
2224
</container>

‎src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
<argument type="service" id="Psr\Container\ContainerInterface" />
3636
<argument type="service" id="templating.finder" on-invalid="ignore" />
3737
<argument type="collection" /> <!-- Twig paths -->
38+
39+
<deprecated>The "%service_id%" service is deprecated since Symfony 4.4 and will be removed in 5.0.</deprecated>
3840
</service>
3941

4042
<service id="twig.template_iterator" class="Symfony\Bundle\TwigBundle\TemplateIterator">

‎src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public function __construct($templating = null, UriSigner $signer = null, string
5252
* @param EngineInterface|Environment|null $templating An EngineInterface or an Environment instance
5353
*
5454
* @throws \InvalidArgumentException
55+
*
56+
* @internal
5557
*/
5658
public function setTemplating($templating)
5759
{

0 commit comments

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