removed deprecated disable_c_ext attribute on Twig_Node_Expression_GetAttr

This commit is contained in:
Fabien Potencier
2016-12-21 10:31:38 +01:00
parent c9cb8becd9
commit 9eeaa699ca
2 changed files with 2 additions and 28 deletions
+2 -6
View File
@@ -18,16 +18,12 @@ class Twig_Node_Expression_GetAttr extends Twig_Node_Expression
$nodes['arguments'] = $arguments;
}
parent::__construct($nodes, array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false), $lineno);
parent::__construct($nodes, array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false), $lineno);
}
public function compile(Twig_Compiler $compiler)
{
if ($this->getAttribute('disable_c_ext')) {
@trigger_error(sprintf('Using the "disable_c_ext" attribute on %s is deprecated since version 1.30 and will be removed in 2.0.', __CLASS__), E_USER_DEPRECATED);
}
if (function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) {
if (function_exists('twig_template_get_attributes')) {
$compiler->raw('twig_template_get_attributes($this, ');
} else {
$compiler->raw('$this->getAttribute(');
-22
View File
@@ -629,25 +629,3 @@ class Twig_TemplateMagicMethodExceptionObject
throw new BadMethodCallException(sprintf('Unknown method "%s".', $method));
}
}
class CExtDisablingNodeVisitor implements Twig_NodeVisitorInterface
{
public function enterNode(Twig_Node $node, Twig_Environment $env)
{
if ($node instanceof Twig_Node_Expression_GetAttr) {
$node->setAttribute('disable_c_ext', true);
}
return $node;
}
public function leaveNode(Twig_Node $node, Twig_Environment $env)
{
return $node;
}
public function getPriority()
{
return 0;
}
}