Skip to content

Commit

Permalink
Replaces the deprecated Templating dependency with Twig (#46)
Browse files Browse the repository at this point in the history
* Use Twig instead of templating / EngineInterface

* Use Twig instead of templating / EngineInterface

* Update .gitignore


Co-authored-by: Richard van Laak <[email protected]>
  • Loading branch information
Richard87 and rvanlaak committed Nov 4, 2019
1 parent 199eae1 commit e331dcc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
2 changes: 1 addition & 1 deletion Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<service id="apy_breadcrumb_trail.twig.extension" class="%apy_breadcrumb_trail.twig.extension.class%">
<argument type="service" id="apy_breadcrumb_trail" />
<argument type="service" id="templating" />
<argument type="service" id="twig" />
<tag name="twig.extension" />
</service>

Expand Down
9 changes: 5 additions & 4 deletions Twig/BreadcrumbTrailExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
Expand Down

0 comments on commit e331dcc

Please sign in to comment.