Skip to content

Commit b54c02c

Browse files
Merge branch '7.1' into 7.2
* 7.1: [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
2 parents b7efcdf + 67ea8a5 commit b54c02c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

NodeVisitor/TranslationDefaultDomainNodeVisitor.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Bridge\Twig\Node\TransNode;
1616
use Twig\Environment;
1717
use Twig\Node\BlockNode;
18+
use Twig\Node\EmptyNode;
1819
use Twig\Node\Expression\ArrayExpression;
1920
use Twig\Node\Expression\AssignNameExpression;
2021
use Twig\Node\Expression\ConstantExpression;
@@ -75,6 +76,12 @@ public function enterNode(Node $node, Environment $env): Node
7576

7677
if ($node instanceof FilterExpression && 'trans' === ($node->hasAttribute('twig_callable') ? $node->getAttribute('twig_callable')->getName() : $node->getNode('filter')->getAttribute('value'))) {
7778
$arguments = $node->getNode('arguments');
79+
80+
if ($arguments instanceof EmptyNode) {
81+
$arguments = new Nodes();
82+
$node->setNode('arguments', $arguments);
83+
}
84+
7885
if ($this->isNamedArguments($arguments)) {
7986
if (!$arguments->hasNode('domain') && !$arguments->hasNode(1)) {
8087
$arguments->setNode('domain', $this->scope->get('domain'));

0 commit comments

Comments
 (0)