diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 5a59b3bd..82830939 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -20,8 +20,13 @@ class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() { //Create tree builder - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('combodo_doctrine_encrypt'); + if (method_exists(TreeBuilder::class, 'getRootNode')) { + $treeBuilder = new TreeBuilder('combodo_doctrine_encrypt'); + $rootNode = $treeBuilder->getRootNode(); + } else { + $treeBuilder = new TreeBuilder(); + $rootNode = $treeBuilder->root('combodo_doctrine_encrypt'); + } // Grammar of config tree $rootNode diff --git a/Twig/EncryptExtension.php b/Twig/EncryptExtension.php index 396b0c82..2e5cc1fc 100644 --- a/Twig/EncryptExtension.php +++ b/Twig/EncryptExtension.php @@ -5,7 +5,7 @@ use Combodo\DoctrineEncryptBundle\Services\EncryptorInterface; -class EncryptExtension extends \Twig_Extension +class EncryptExtension extends \Twig\Extension\AbstractExtension { private $encryptor; @@ -19,7 +19,7 @@ public function __construct(EncryptorInterface $encryptor) public function getFilters() { return [ - new \Twig_SimpleFilter('decrypt', [$this,'decrypt'], [ + new \Twig\TwigFilter('decrypt', [$this,'decrypt'], [ //'is_safe' => ['html'],//to avoid autoescaping of HTML ]), diff --git a/composer.json b/composer.json index 69276970..8456150a 100644 --- a/composer.json +++ b/composer.json @@ -3,10 +3,10 @@ "type": "library", "keywords": ["doctrine", "symfony", "aes256", "openssl", "encrypt", "decrypt", "bundle"], "license": "MIT", - "description": "Symfony 2 bundle which allows to encrypt data in database with some encrypt algorithm, this fork make use of open ssl", + "description": "Symfony 3+ bundle which allows to encrypt data in database with some encrypt algorithm, this fork make use of open ssl", "require": { - "php": ">=5.4", - "symfony/framework-bundle": ">=2.5", + "php": ">=5.5.9", + "symfony/framework-bundle": "^3.4|>=4.4", "doctrine/orm": ">=2.5", "ext-openssl": "*" },