Skip to content

Commit

Permalink
Merge pull request #1 from EstudioNexos/master
Browse files Browse the repository at this point in the history
Upgraded for usage with latest twig
  • Loading branch information
djboris88 authored Jan 16, 2024
2 parents 9fdf6b3 + 14ab6d6 commit 3becd7a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/Extension/CommentedIncludeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
namespace Djboris88\Twig\Extension;

use Djboris88\Twig\TokenParser\CommentedIncludeTokenParser;
use Twig_Extension;
use Twig\Extension\AbstractExtension;

/**
* @author Boris Đemrovski <djboris88@gmail.com>
*/
class CommentedIncludeExtension extends Twig_Extension
class CommentedIncludeExtension extends AbstractExtension
{

/**
Expand All @@ -27,7 +27,7 @@ public function getName() {
}

/**
* @return array|\Twig_TokenParserInterface[]
* @return array|\CommentedIncludeTokenParser[]
*/
public function getTokenParsers()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Node/CommentedIncludeNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use Twig\Node\IncludeNode;
use Twig\Node\NodeOutputInterface;
use Twig_Compiler;
use Twig\Compiler;

/**
* @author Boris Đemrovski <djboris88@gmail.com>
Expand All @@ -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);

Expand Down
5 changes: 3 additions & 2 deletions src/TokenParser/CommentedIncludeTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

use Djboris88\Twig\Node\CommentedIncludeNode;
use Twig\TokenParser\IncludeTokenParser;
use Twig_Token;
use Twig\Token;


/**
* @author Boris Đemrovski <djboris88@gmail.com>
Expand All @@ -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();

Expand Down

0 comments on commit 3becd7a

Please sign in to comment.