diff --git a/composer.json b/composer.json index 84bc006..5f08855 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": ">=5.6", - "twig/twig": "^1.14|^2.0|^3.0" + "twig/twig": "^2.0|^3.0" }, "require-dev": { "symfony/framework-bundle": "^2.7|^3.2", diff --git a/src/Extension/CommentedIncludeExtension.php b/src/Extension/CommentedIncludeExtension.php index 92c0e53..4730ea7 100644 --- a/src/Extension/CommentedIncludeExtension.php +++ b/src/Extension/CommentedIncludeExtension.php @@ -11,12 +11,12 @@ namespace Djboris88\Twig\Extension; use Djboris88\Twig\TokenParser\CommentedIncludeTokenParser; -use Twig_Extension; +use Twig\Extension\AbstractExtension; /** * @author Boris Đemrovski */ -class CommentedIncludeExtension extends Twig_Extension +class CommentedIncludeExtension extends AbstractExtension { /** @@ -27,7 +27,7 @@ public function getName() { } /** - * @return array|\Twig_TokenParserInterface[] + * @return array|\CommentedIncludeTokenParser[] */ public function getTokenParsers() { diff --git a/src/Node/CommentedIncludeNode.php b/src/Node/CommentedIncludeNode.php index ce51e12..98b32b9 100644 --- a/src/Node/CommentedIncludeNode.php +++ b/src/Node/CommentedIncludeNode.php @@ -12,7 +12,7 @@ use Twig\Node\IncludeNode; use Twig\Node\NodeOutputInterface; -use Twig_Compiler; +use Twig\Compiler; /** * @author Boris Đemrovski @@ -23,7 +23,7 @@ class CommentedIncludeNode extends IncludeNode implements NodeOutputInterface /** * @param \Twig_Compiler $compiler */ - public function compile(Twig_Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->addDebugInfo($this); diff --git a/src/TokenParser/CommentedIncludeTokenParser.php b/src/TokenParser/CommentedIncludeTokenParser.php index a4c56cc..a1eb751 100644 --- a/src/TokenParser/CommentedIncludeTokenParser.php +++ b/src/TokenParser/CommentedIncludeTokenParser.php @@ -12,7 +12,8 @@ use Djboris88\Twig\Node\CommentedIncludeNode; use Twig\TokenParser\IncludeTokenParser; -use Twig_Token; +use Twig\Token; + /** * @author Boris Đemrovski @@ -24,7 +25,7 @@ class CommentedIncludeTokenParser extends IncludeTokenParser * * @return \Djboris88\Twig\Node\CommentedIncludeNode */ - public function parse(Twig_Token $token) + public function parse(Token $token): CommentedIncludeNode { $expr = $this->parser->getExpressionParser()->parseExpression();