removed a deprecation notice

This commit is contained in:
Fabien Potencier 2016-11-05 23:09:07 -07:00
parent f37ac131e1
commit eb0d6c94ca
1 changed files with 6 additions and 1 deletions

View File

@ -49,7 +49,7 @@ class TranslationDefaultDomainNodeVisitor extends \Twig_BaseNodeVisitor
return $node;
} else {
$var = $env->getParser()->getVarName();
$var = $this->getVarName();
$name = new \Twig_Node_Expression_AssignName($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;
}
private function getVarName()
{
return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
}
}