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:
Fabien Potencier 2016-11-06 08:13:45 -08:00
commit 8668aec34e
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));
}
}