Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[TwigBridge] Use non-deprecated Twig_Node::getTemplateLine() #20253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function compile(\Twig_Compiler $compiler)
// the variables in the third argument
$label = $arguments[1];
$variables = isset($arguments[2]) ? $arguments[2] : null;
$lineno = $label->getLine();
$lineno = $label->getTemplateLine();

if ($label instanceof \Twig_Node_Expression_Constant) {
// If the label argument is given as a constant, we can either
Expand Down
6 changes: 3 additions & 3 deletions 6 src/Symfony/Bridge/Twig/Node/TransNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ protected function compileString(\Twig_Node $body, \Twig_Node_Expression_Array $
preg_match_all('/(?<!%)%([^%]+)%/', $msg, $matches);

foreach ($matches[1] as $var) {
$key = new \Twig_Node_Expression_Constant('%'.$var.'%', $body->getLine());
$key = new \Twig_Node_Expression_Constant('%'.$var.'%', $body->getTemplateLine());
if (!$vars->hasElement($key)) {
if ('count' === $var && $this->hasNode('count')) {
$vars->addElement($this->getNode('count'), $key);
} else {
$varExpr = new \Twig_Node_Expression_Name($var, $body->getLine());
$varExpr = new \Twig_Node_Expression_Name($var, $body->getTemplateLine());
$varExpr->setAttribute('ignore_strict_check', $ignoreStrictCheck);
$vars->addElement($varExpr, $key);
}
}
}

return array(new \Twig_Node_Expression_Constant(str_replace('%%', '%', trim($msg)), $body->getLine()), $vars);
return array(new \Twig_Node_Expression_Constant(str_replace('%%', '%', trim($msg)), $body->getTemplateLine()), $vars);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ protected function doEnterNode(\Twig_Node $node, \Twig_Environment $env)
return $node;
} else {
$var = $env->getParser()->getVarName();
$name = new \Twig_Node_Expression_AssignName($var, $node->getLine());
$this->scope->set('domain', new \Twig_Node_Expression_Name($var, $node->getLine()));
$name = new \Twig_Node_Expression_AssignName($var, $node->getTemplateLine());
$this->scope->set('domain', new \Twig_Node_Expression_Name($var, $node->getTemplateLine()));

return new \Twig_Node_Set(false, new \Twig_Node(array($name)), new \Twig_Node(array($node->getNode('expr'))), $node->getLine());
return new \Twig_Node_Set(false, new \Twig_Node(array($name)), new \Twig_Node(array($node->getNode('expr'))), $node->getTemplateLine());
}
}

Expand All @@ -71,7 +71,7 @@ protected function doEnterNode(\Twig_Node $node, \Twig_Environment $env)
} else {
if (!$arguments->hasNode($ind)) {
if (!$arguments->hasNode($ind - 1)) {
$arguments->setNode($ind - 1, new \Twig_Node_Expression_Array(array(), $node->getLine()));
$arguments->setNode($ind - 1, new \Twig_Node_Expression_Array(array(), $node->getTemplateLine()));
}

$arguments->setNode($ind, $this->scope->get('domain'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function parse(\Twig_Token $token)
$body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true);

if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) {
throw new \Twig_Error_Syntax('A message inside a transchoice tag must be a simple text.', $body->getLine(), $stream->getSourceContext()->getName());
throw new \Twig_Error_Syntax('A message inside a transchoice tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()->getName());
}

$stream->expect(\Twig_Token::BLOCK_END_TYPE);
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function parse(\Twig_Token $token)
$body = $this->parser->subparse(array($this, 'decideTransFork'), true);

if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) {
throw new \Twig_Error_Syntax('A message inside a trans tag must be a simple text.', $body->getLine(), $stream->getSourceContext()->getName());
throw new \Twig_Error_Syntax('A message inside a trans tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()->getName());
}

$stream->expect(\Twig_Token::BLOCK_END_TYPE);
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.