-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Symfony version(s) affected
7.2 (91588b3)
Description
getVarName
only appears on 7.1, and replaced with constant in 7.2:
symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php
Lines 122 to 125 in 6161368
private function getVarName(): string | |
{ | |
return sprintf('__internal_%s', hash('xxh128', uniqid(mt_rand(), true))); | |
} |
The 7.2 TranslationDefaultDomainNodeVisitor
references getVarName
, which does not exist in version 7.2:
symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php
Line 58 in 91588b3
$var = $this->getVarName(); |
This issue appears to stem from a mistakenly ahead porting by @nicolas-grekas. I'm unsure if it is safe to reference INTERNAL_VAR_NAME
in this context.
symfony/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php
Line 36 in 91588b3
private const INTERNAL_VAR_NAME = '__internal_trans_default_domain'; |
How to reproduce
- Clone https://github.com/database-playground/app-sf/tree/def0e92908d3eaadf41802142742a4d8b5e3f2b0
- Run
composer update
- It throws
Attempted to call an undefined method named "getVarName" of class "Symfony\Bridge\Twig \NodeVisitor\TranslationDefaultDomainNodeVisitor".
Possible Solution
Change getVarName
to INTERNAL_VAR_NAME
.
Additional Context
No response