8000 Twig deprecations · symfony/symfony@942e80b · GitHub
[go: up one dir, main page]

Skip to content

Commit 942e80b

Browse files
committed
Twig deprecations
1 parent e1e6312 commit 942e80b

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/Symfony/Bridge/Twig/Tests/TwigEngineTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
use Symfony\Bridge\Twig\TwigEngine;
1515
use Symfony\Component\Templating\TemplateReference;
1616

17+
/**
18+
* @group legacy
19+
*/
1720
class TwigEngineTest extends \PHPUnit_Framework_TestCase
1821
{
1922
public function testExistsWithTemplateInstances()

src/Symfony/Bridge/Twig/TwigEngine.php

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

1212
namespace Symfony\Bridge\Twig;
1313

14+
@trigger_error('The '.TwigEngine::class.' class is deprecated since version 3.3 and will be removed in 4.0. Use \Twig_Environment instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Templating\EngineInterface;
1517
use Symfony\Component\Templating\StreamingEngineInterface;
1618
use Symfony\Component\Templating\TemplateNameParserInterface;
@@ -20,6 +22,8 @@
2022
* This engine knows how to render Twig templates.
2123
*
2224
* @author Fabien Potencier <fabien@symfony.com>
25+
*
26+
* @deprecated The TwigEngine class will be removed in Symfony 4.0. You should use \Twig_Environment directly instead.
2327
*/
2428
class TwigEngine implements EngineInterface, StreamingEngineInterface
2529
{

src/Symfony/Bundle/TwigBundle/TwigEngine.php

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

1212
namespace Symfony\Bundle\TwigBundle;
1313

14+
@trigger_error('The '.TwigEngine::class.' class is deprecated since version 3.3 and will be removed in 4.0. Use \Twig_Environment instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Bridge\Twig\TwigEngine as BaseEngine;
1517
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
1618
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
@@ -22,6 +24,8 @@
2224
* This engine renders Twig templates.
2325
*
2426
* @author Fabien Potencier <fabien@symfony.com>
27+
*
28+
* @deprecated The TwigEngine class will be removed in Symfony 4.0. You should use \Twig_Environment directly instead.
2529
*/
2630
class TwigEngine extends BaseEngine implements EngineInterface
2731
{

0 commit comments

Comments
 (0)
0