From 578834b5a9d2be095e50276eec4bd8a3b88dd114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20D=C3=ADaz=20Valencia?= Date: Sat, 30 Sep 2023 07:53:24 +0200 Subject: [PATCH 1/5] Update CommentedIncludeTokenParser.php for latest twig compatibility --- src/TokenParser/CommentedIncludeTokenParser.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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(); From 7d9daf528bf4d7e0c3a47d2b5659407ced2be9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20D=C3=ADaz=20Valencia?= Date: Sat, 30 Sep 2023 07:54:29 +0200 Subject: [PATCH 2/5] Update CommentedIncludeNode.php for latest twig compatibility --- src/Node/CommentedIncludeNode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Node/CommentedIncludeNode.php b/src/Node/CommentedIncludeNode.php index ce51e12..7bfb071 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 From b922e241f5eda06327206c3eb27cd78abdfd6820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20D=C3=ADaz=20Valencia?= Date: Sat, 30 Sep 2023 07:55:57 +0200 Subject: [PATCH 3/5] Update CommentedIncludeExtension.php for latest Twig compatibility --- src/Extension/CommentedIncludeExtension.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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() { From dd7c0064d81605db3f8c375e9716c81d59612835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20D=C3=ADaz=20Valencia?= Date: Sat, 30 Sep 2023 07:58:46 +0200 Subject: [PATCH 4/5] Update composer.json This updates makes twig-commented-include incompatible with old twig < 2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From 14ab6d68247553565b88f558fdaccad3a589d849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20D=C3=ADaz=20Valencia?= Date: Fri, 6 Oct 2023 06:55:14 +0200 Subject: [PATCH 5/5] Update CommentedIncludeNode.php --- src/Node/CommentedIncludeNode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Node/CommentedIncludeNode.php b/src/Node/CommentedIncludeNode.php index 7bfb071..98b32b9 100644 --- a/src/Node/CommentedIncludeNode.php +++ b/src/Node/CommentedIncludeNode.php @@ -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);