minor #20421 Twig deprecation removal (fabpot)
This PR was merged into the 2.7 branch.
Discussion
----------
Twig deprecation removal
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
eb0d6c9
removed a deprecation notice
This commit is contained in:
commit
8668aec34e
@ -49,7 +49,7 @@ class TranslationDefaultDomainNodeVisitor extends \Twig_BaseNodeVisitor
|
|||||||
|
|
||||||
return $node;
|
return $node;
|
||||||
} else {
|
} else {
|
||||||
$var = $env->getParser()->getVarName();
|
$var = $this->getVarName();
|
||||||
$name = new \Twig_Node_Expression_AssignName($var, $node->getTemplateLine());
|
$name = new \Twig_Node_Expression_AssignName($var, $node->getTemplateLine());
|
||||||
$this->scope->set('domain', new \Twig_Node_Expression_Name($var, $node->getTemplateLine()));
|
$this->scope->set('domain', new \Twig_Node_Expression_Name($var, $node->getTemplateLine()));
|
||||||
|
|
||||||
@ -123,4 +123,9 @@ class TranslationDefaultDomainNodeVisitor extends \Twig_BaseNodeVisitor
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getVarName()
|
||||||
|
{
|
||||||
|
return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user