Commit 65dd8599 authored by alexpott's avatar alexpott

Issue #2194155 by cosmicdreams, subhojit777, tatarbj, Cottser: Replace...

Issue #2194155 by cosmicdreams, subhojit777, tatarbj, Cottser: Replace deprecated Twig_NodeInterface with recommended Twig_Node
parent e85d6d68
......@@ -22,7 +22,7 @@ class TwigNodeTrans extends \Twig_Node {
/**
* {@inheritdoc}
*/
public function __construct(\Twig_NodeInterface $body, \Twig_NodeInterface $plural = NULL, \Twig_Node_Expression $count = NULL, \Twig_Node_Expression $options = NULL, $lineno, $tag = NULL) {
public function __construct(\Twig_Node $body, \Twig_Node $plural = NULL, \Twig_Node_Expression $count = NULL, \Twig_Node_Expression $options = NULL, $lineno, $tag = NULL) {
parent::__construct(array(
'count' => $count,
'body' => $body,
......@@ -88,7 +88,7 @@ public function compile(\Twig_Compiler $compiler) {
/**
* Extracts the text and tokens for the "trans" tag.
*
* @param \Twig_NodeInterface $body
* @param \Twig_Node $body
* The node to compile.
*
* @return array
......@@ -98,7 +98,7 @@ public function compile(\Twig_Compiler $compiler) {
* - array $tokens
* The extracted tokens as new \Twig_Node_Expression_Name instances.
*/
protected function compileString(\Twig_NodeInterface $body) {
protected function compileString(\Twig_Node $body) {
if ($body instanceof \Twig_Node_Expression_Name || $body instanceof \Twig_Node_Expression_Constant || $body instanceof \Twig_Node_Expression_TempName) {
return array($body, array());
}
......
......@@ -16,19 +16,19 @@
*
* @see twig_render
*/
class TwigNodeVisitor implements \Twig_NodeVisitorInterface {
class TwigNodeVisitor extends \Twig_BaseNodeVisitor {
/**
* {@inheritdoc}
*/
public function enterNode(\Twig_NodeInterface $node, \Twig_Environment $env) {
protected function doEnterNode(\Twig_Node $node, \Twig_Environment $env) {
return $node;
}
/**
* {@inheritdoc}
*/
public function leaveNode(\Twig_NodeInterface $node, \Twig_Environment $env) {
protected function doLeaveNode(\Twig_Node $node, \Twig_Environment $env) {
// We use this to inject a call to render_var -> TwigExtension->renderVar()
// before anything is printed.
if ($node instanceof \Twig_Node_Print) {
......
......@@ -82,14 +82,14 @@ public function getTag() {
/**
* Ensure that any nodes that are parsed are only of allowed types.
*
* @param \Twig_NodeInterface $body
* @param \Twig_Node $body
* The expression to check.
* @param integer $lineno
* The source line.
*
* @throws \Twig_Error_Syntax
*/
protected function checkTransString(\Twig_NodeInterface $body, $lineno) {
protected function checkTransString(\Twig_Node $body, $lineno) {
foreach ($body as $node) {
if (
$node instanceof \Twig_Node_Text
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment