removed old code that is not needed anymore

This commit is contained in:
Fabien Potencier
2016-11-11 11:37:15 -08:00
parent fc53b5ab18
commit 60bed59266
3 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -349,7 +349,7 @@ class Twig_ExpressionParser
throw new Twig_Error_Syntax('The "block" function takes one argument (the block name).', $line, $this->parser->getStream()->getSourceContext()->getName());
}
return new Twig_Node_Expression_BlockReference($args->getNode(0), false, $line);
return new Twig_Node_Expression_BlockReference($args->getNode(0), $line);
case 'attribute':
$args = $this->parseArguments();
if (count($args) < 2) {
+9 -6
View File
@@ -17,17 +17,20 @@
*/
class Twig_Node_Expression_BlockReference extends Twig_Node_Expression
{
public function __construct(Twig_NodeInterface $name, $asString = false, $lineno, $tag = null)
public function __construct(Twig_NodeInterface $name, $lineno, $tag = null)
{
parent::__construct(array('name' => $name), array('as_string' => $asString, 'output' => false), $lineno, $tag);
if (is_bool($lineno)) {
@trigger_error(sprintf('The %s method "$asString" argument is deprecated since version 1.28 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED);
$lineno = $tag;
$tag = func_num_args() > 3 ? func_get_arg(3) : null;
}
parent::__construct(array('name' => $name), array('output' => false), $lineno, $tag);
}
public function compile(Twig_Compiler $compiler)
{
if ($this->getAttribute('as_string')) {
$compiler->raw('(string) ');
}
if ($this->getAttribute('output')) {
$compiler
->addDebugInfo($this)
+1 -1
View File
@@ -23,7 +23,7 @@ class Twig_TokenParser_Filter extends Twig_TokenParser
public function parse(Twig_Token $token)
{
$name = $this->parser->getVarName();
$ref = new Twig_Node_Expression_BlockReference(new Twig_Node_Expression_Constant($name, $token->getLine()), true, $token->getLine(), $this->getTag());
$ref = new Twig_Node_Expression_BlockReference(new Twig_Node_Expression_Constant($name, $token->getLine()), $token->getLine(), $this->getTag());
$filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag());
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);