Skip to content

Commit

Permalink
Merge pull request #31 from alsar/twig2.0
Browse files Browse the repository at this point in the history
Changed deprecated type hint Twig_NodeInterface to Twig_Node
  • Loading branch information
Richtermeister authored Jun 1, 2017
2 parents 9db8d47 + 6884597 commit 7d72427
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Twig/InlineCssNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

use Twig_Compiler;

class InlineCssNode extends \Twig_Node
class InlineCssNode extends \Twig_Node
{
private $debug;
public function __construct(\Twig_NodeInterface $body, $css, $lineno = 0, $debug, $tag = 'inlinecss')

public function __construct(\Twig_Node $body, $css, $lineno = 0, $debug, $tag = 'inlinecss')
{
$this->debug = $debug;
parent::__construct(array('body' => $body), array('css' => $css), $lineno, $tag);
Expand Down
12 changes: 6 additions & 6 deletions Twig/InlineCssParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

use Symfony\Component\Config\FileLocatorInterface;
use Symfony\Component\Templating\TemplateNameParserInterface;
use Twig_NodeInterface;
use Twig_Node;
use Twig_Token;

class InlineCssParser extends \Twig_TokenParser
class InlineCssParser extends \Twig_TokenParser
{
/**
* @var TemplateNameParserInterface
Expand Down Expand Up @@ -57,18 +57,18 @@ public function __construct(FileLocatorInterface $locator, TemplateNameParserInt
*
* @param Twig_Token $token A Twig_Token instance
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
* @return Twig_Node A Twig_Node instance
*/
public function parse(Twig_Token $token)
{
$lineNo = $token->getLine();
$stream = $this->parser->getStream();
$stream = $this->parser->getStream();
$path = $stream->expect(Twig_Token::STRING_TYPE)->getValue();
$stream->expect(Twig_Token::BLOCK_END_TYPE);
$body = $this->parser->subparse(array($this, 'decideEnd'), true);
$stream->expect(Twig_Token::BLOCK_END_TYPE);

return new InlineCssNode($body, $this->resolvePath($path), $lineNo, $this->debug);
return new InlineCssNode($body, $this->resolvePath($path), $lineNo, $this->debug);
}

/**
Expand All @@ -80,7 +80,7 @@ public function getTag()
{
return 'inlinecss';
}

public function decideEnd(Twig_Token $token)
{
return $token->test('endinlinecss');
Expand Down

0 comments on commit 7d72427

Please sign in to comment.