mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-26 23:46:39 +00:00
Refactor code
This commit is contained in:
@@ -533,7 +533,7 @@ class ExpressionParser
|
||||
public function getFunctionNode($name, $line)
|
||||
{
|
||||
if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) {
|
||||
return new MacroReferenceExpression(new TemplateVariable($alias['node']->getAttribute('name'), $line), $alias['name'], $this->createArguments($line), $line);
|
||||
return new MacroReferenceExpression($alias['node']->getNode('var'), $alias['name'], $this->createArguments($line), $line);
|
||||
}
|
||||
|
||||
$args = $this->parseOnlyArguments();
|
||||
@@ -750,7 +750,7 @@ class ExpressionParser
|
||||
}
|
||||
|
||||
if ('defined' === $test->getName() && $node instanceof NameExpression && null !== $alias = $this->parser->getImportedSymbol('function', $node->getAttribute('name'))) {
|
||||
$node = new MacroReferenceExpression(new TemplateVariable($alias['node']->getAttribute('name'), $node->getTemplateLine()), $alias['name'], new ArrayExpression([], $node->getTemplateLine()), $node->getTemplateLine());
|
||||
$node = new MacroReferenceExpression($alias['node']->getNode('var'), $alias['name'], new ArrayExpression([], $node->getTemplateLine()), $node->getTemplateLine());
|
||||
}
|
||||
|
||||
$ready = $test instanceof TwigTest;
|
||||
@@ -957,7 +957,7 @@ class ExpressionParser
|
||||
$node instanceof NameExpression
|
||||
&&
|
||||
(
|
||||
null !== $this->parser->getImportedSymbol('template', (new TemplateVariable($node->getAttribute('name'), $node->getTemplateLine()))->getAttribute('name'))
|
||||
null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))
|
||||
||
|
||||
'_self' === $node->getAttribute('name') && $attribute instanceof ConstantExpression
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user