summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-11-03 11:37:31 (GMT)
committerAlex Pott2015-11-03 11:37:31 (GMT)
commit65dd859920f6e17f5cb9737f2e43796298bad93f (patch)
treeba4f0eda47c6e82178a76c26565cbb9278386974
parente85d6d6839b25ec422dce737851f6402ec2a7d92 (diff)
Issue #2194155 by cosmicdreams, subhojit777, tatarbj, Cottser: Replace deprecated Twig_NodeInterface with recommended Twig_Node
-rw-r--r--core/lib/Drupal/Core/Template/TwigNodeTrans.php6
-rw-r--r--core/lib/Drupal/Core/Template/TwigNodeVisitor.php6
-rw-r--r--core/lib/Drupal/Core/Template/TwigTransTokenParser.php4
3 files changed, 8 insertions, 8 deletions
diff --git a/core/lib/Drupal/Core/Template/TwigNodeTrans.php b/core/lib/Drupal/Core/Template/TwigNodeTrans.php
index 6bd4b8a..9d747b7 100644
--- a/core/lib/Drupal/Core/Template/TwigNodeTrans.php
+++ b/core/lib/Drupal/Core/Template/TwigNodeTrans.php
@@ -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 @@ class TwigNodeTrans extends \Twig_Node {
/**
* 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 @@ class TwigNodeTrans extends \Twig_Node {
* - 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());
}
diff --git a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php
index ac1e676..860cc56 100644
--- a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php
+++ b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php
@@ -16,19 +16,19 @@ namespace Drupal\Core\Template;
*
* @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) {
diff --git a/core/lib/Drupal/Core/Template/TwigTransTokenParser.php b/core/lib/Drupal/Core/Template/TwigTransTokenParser.php
index c67f463..009cc9c 100644
--- a/core/lib/Drupal/Core/Template/TwigTransTokenParser.php
+++ b/core/lib/Drupal/Core/Template/TwigTransTokenParser.php
@@ -82,14 +82,14 @@ class TwigTransTokenParser extends \Twig_TokenParser {
/**
* 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