mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 19:06:40 +00:00
removed deprecated disable_c_ext attribute on Twig_Node_Expression_GetAttr
This commit is contained in:
@@ -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(');
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user