Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 658236b

Browse filesBrowse files
committed
bug #23073 [TwigBridge] Fix namespaced classes (ogizanagi)
This PR was merged into the 2.7 branch. Discussion ---------- [TwigBridge] Fix namespaced classes | Q | A | ------------- | --- | Branch? | 2.7 <!-- see comment below --> | Bug fix? | yes | New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #23072 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A Commits ------- a1cdc2d [TwigBridge] Fix namespaced classes
2 parents 621b769 + a1cdc2d commit 658236b
Copy full SHA for 658236b

File tree

1 file changed

+5
-3
lines changed
Filter options

1 file changed

+5
-3
lines changed

‎src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
use Symfony\Bridge\Twig\Node\TransNode;
1515
use Symfony\Bridge\Twig\Node\TransDefaultDomainNode;
1616
use Twig\Environment;
17+
use Twig\Node\BlockNode;
1718
use Twig\Node\Expression\ArrayExpression;
1819
use Twig\Node\Expression\AssignNameExpression;
1920
use Twig\Node\Expression\ConstantExpression;
2021
use Twig\Node\Expression\FilterExpression;
2122
use Twig\Node\Expression\NameExpression;
2223
use Twig\Node\ModuleNode;
2324
use Twig\Node\Node;
25+
use Twig\Node\SetNode;
2426
use Twig\NodeVisitor\AbstractNodeVisitor;
2527

2628
/**
@@ -48,7 +50,7 @@ public function __construct()
4850
*/
4951
protected function doEnterNode(Node $node, Environment $env)
5052
{
51-
if ($node instanceof Node_Block || $node instanceof ModuleNode) {
53+
if ($node instanceof BlockNode || $node instanceof ModuleNode) {
5254
$this->scope = $this->scope->enter();
5355
}
5456

@@ -62,7 +64,7 @@ protected function doEnterNode(Node $node, Environment $env)
6264
$name = new AssignNameExpression($var, $node->getTemplateLine());
6365
$this->scope->set('domain', new NameExpression($var, $node->getTemplateLine()));
6466

65-
return new Node_Set(false, new Node(array($name)), new Node(array($node->getNode('expr'))), $node->getTemplateLine());
67+
return new SetNode(false, new Node(array($name)), new Node(array($node->getNode('expr'))), $node->getTemplateLine());
6668
}
6769
}
6870

@@ -104,7 +106,7 @@ protected function doLeaveNode(Node $node, Environment $env)
104106
return false;
105107
}
106108

107-
if ($node instanceof Node_Block || $node instanceof ModuleNode) {
109+
if ($node instanceof BlockNode || $node instanceof ModuleNode) {
108110
$this->scope = $this->scope->leave();
109111
}
110112

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.