From e331dcc92cb5eb75ca99e8a0375afe8d2e4abd27 Mon Sep 17 00:00:00 2001 From: Richard Hagen Date: Mon, 4 Nov 2019 16:56:40 +0100 Subject: [PATCH] Replaces the deprecated Templating dependency with Twig (#46) * Use Twig instead of templating / EngineInterface * Use Twig instead of templating / EngineInterface * Update .gitignore Co-authored-by: Richard van Laak --- .gitignore | 1 + Resources/config/services.xml | 2 +- Twig/BreadcrumbTrailExtension.php | 9 +++++---- composer.json | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57872d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/Resources/config/services.xml b/Resources/config/services.xml index 2f87913..03a1e3a 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -22,7 +22,7 @@ - + diff --git a/Twig/BreadcrumbTrailExtension.php b/Twig/BreadcrumbTrailExtension.php index e466d09..8d132da 100644 --- a/Twig/BreadcrumbTrailExtension.php +++ b/Twig/BreadcrumbTrailExtension.php @@ -12,12 +12,13 @@ namespace APY\BreadcrumbTrailBundle\Twig; use APY\BreadcrumbTrailBundle\BreadcrumbTrail\Trail; -use Symfony\Component\Templating\EngineInterface; +use Twig\Environment; +use Twig\Extension\AbstractExtension; /** * Provides an extension for Twig to output breadcrumbs */ -class BreadcrumbTrailExtension extends \Twig_Extension +class BreadcrumbTrailExtension extends AbstractExtension { private $trail; private $templating; @@ -26,9 +27,9 @@ class BreadcrumbTrailExtension extends \Twig_Extension /** * BreadcrumbTrailExtension constructor. * @param Trail $trail - * @param EngineInterface $templating + * @param Environment $templating */ - public function __construct(Trail $trail, EngineInterface $templating) + public function __construct(Trail $trail, Environment $templating) { $this->trail = $trail; $this->templating = $templating; diff --git a/composer.json b/composer.json index a8c9066..bc7c298 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,8 @@ ], "require": { "php": ">=5.3.3", - "symfony/framework-bundle": "^2.3|^3.0|^4.0" + "symfony/framework-bundle": "^2.3|^3.0|^4.0", + "twig/twig": "^1.41|^2.0" }, "suggest": { "ext-intl": "*"