Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
#69 Support twig 3
Browse files Browse the repository at this point in the history
  • Loading branch information
migo315 committed Jan 22, 2020
1 parent 3bc23bd commit c91f5f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"symfony/yaml": "^2.7|^3.0|^4.0|^5.0",
"symfony/config": "^2.7|^3.0|^4.0|^5.0",
"symfony/http-kernel": "^2.7|^3.0|^4.0|^5.0",
"twig/twig": "^1.18|^2.0",
"twig/twig": "^1.34|^2.4|^3.0",
"doctrine/annotations": "^1.0",
"flagception/flagception": "^1.5"
},
Expand Down
12 changes: 6 additions & 6 deletions src/Twig/ToggleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

use Flagception\Manager\FeatureManagerInterface;
use Flagception\Model\Context;
use Twig_Extension;
use Twig_SimpleFunction;
use Twig_SimpleTest;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
use Twig\TwigTest;

/**
* Class ToggleExtension
*
* @author Michel Chowanski <michel.chowanski@bestit-online.de>
* @package Flagception\Bundle\FlagceptionBundle\Twig
*/
class ToggleExtension extends Twig_Extension
class ToggleExtension extends AbstractExtension
{
/**
* The manager
Expand Down Expand Up @@ -57,7 +57,7 @@ public function isActive($name, array $contextValues = [])
public function getFunctions()
{
return [
new Twig_SimpleFunction('feature', [$this, 'isActive']),
new TwigFunction('feature', [$this, 'isActive']),
];
}

Expand All @@ -67,7 +67,7 @@ public function getFunctions()
public function getTests()
{
return [
new Twig_SimpleTest('active feature', [$this, 'isActive']),
new TwigTest('active feature', [$this, 'isActive']),
];
}

Expand Down

0 comments on commit c91f5f9

Please sign in to comment.