CodeExplorer TransDefaultDomainNode example
public static function getTransTag($message,
$domain = null
) { return new TransNode( new BodyNode([],
['data' =>
$message]),
$domain ?
new ConstantExpression($domain, 0
) : null
);
} public static function getTransDefaultDomainTag($domain) { return new TransDefaultDomainNode( new ConstantExpression($domain, 0
) );
}} final class TransDefaultDomainTokenParser extends AbstractTokenParser
{ public function parse(Token
$token): Node
{ $expr =
$this->parser->
getExpressionParser()->
parseExpression();
$this->parser->
getStream()->
expect(Token::BLOCK_END_TYPE
);
return new TransDefaultDomainNode($expr,
$token->
getLine(),
$this->
getTag());
} public function getTag(): string
{ return 'trans_default_domain';
}}