Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 6.4:
  [DoctrineBridge] Fix Connection::createSchemaManager() for Doctrine DBAL v2
  [HttpClient] Various cleanups after recent changes
  do not add child nodes to EmptyNode instances
  consider write property visibility to decide whether a property is writable
  add comment explaining why HttpClient tests are run separately
  silence warnings issued by Redis Sentinel on connection issues
  • Loading branch information
nicolas-grekas committed Nov 25, 2024
2 parents 535ab0b + 32ec012 commit 67ea8a5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions NodeVisitor/TranslationDefaultDomainNodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Bridge\Twig\Node\TransNode;
use Twig\Environment;
use Twig\Node\BlockNode;
use Twig\Node\EmptyNode;
use Twig\Node\Expression\ArrayExpression;
use Twig\Node\Expression\AssignNameExpression;
use Twig\Node\Expression\ConstantExpression;
Expand Down Expand Up @@ -70,6 +71,12 @@ public function enterNode(Node $node, Environment $env): Node

if ($node instanceof FilterExpression && 'trans' === ($node->hasAttribute('twig_callable') ? $node->getAttribute('twig_callable')->getName() : $node->getNode('filter')->getAttribute('value'))) {
$arguments = $node->getNode('arguments');

if ($arguments instanceof EmptyNode) {
$arguments = new Nodes();
$node->setNode('arguments', $arguments);
}

if ($this->isNamedArguments($arguments)) {
if (!$arguments->hasNode('domain') && !$arguments->hasNode(1)) {
$arguments->setNode('domain', $this->scope->get('domain'));
Expand Down

0 comments on commit 67ea8a5

Please sign in to comment.