diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php index a926606671cc0..3faff33c4a7af 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php @@ -30,6 +30,8 @@ */ final class TranslationDefaultDomainNodeVisitor implements NodeVisitorInterface { + private const INTERNAL_VAR_NAME = '__internal_trans_default_domain'; + private Scope $scope; public function __construct() @@ -49,9 +51,8 @@ public function enterNode(Node $node, Environment $env): Node return $node; } else { - $var = $this->getVarName(); - $name = new AssignNameExpression($var, $node->getTemplateLine()); - $this->scope->set('domain', new NameExpression($var, $node->getTemplateLine())); + $name = new AssignNameExpression(self::INTERNAL_VAR_NAME, $node->getTemplateLine()); + $this->scope->set('domain', new NameExpression(self::INTERNAL_VAR_NAME, $node->getTemplateLine())); return new SetNode(false, new Node([$name]), new Node([$node->getNode('expr')]), $node->getTemplateLine()); } @@ -111,9 +112,4 @@ private function isNamedArguments(Node $arguments): bool return false; } - - private function getVarName(): string - { - return \sprintf('__internal_%s', hash('xxh128', uniqid(mt_rand(), true))); - } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy