use Twig\NodeVisitor\AbstractNodeVisitor;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
final class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
{ private Scope
$scope;
public function __construct() { $this->scope =
new Scope();
} protected function doEnterNode(Node
$node, Environment
$env): Node
{ if ($node instanceof BlockNode ||
$node instanceof ModuleNode
) { $this->scope =
$this->scope->
enter();
} if ($node instanceof TransDefaultDomainNode
) { if ($node->
getNode('expr'
) instanceof ConstantExpression
) { $this->scope->
set('domain',
$node->
getNode('expr'
));