new TransDefaultDomainTokenParser(),
];
} public function getNodeVisitors(): array
{ return [$this->
getTranslationNodeVisitor(),
new TranslationDefaultDomainNodeVisitor()];
} public function getTranslationNodeVisitor(): TranslationNodeVisitor
{ return $this->translationNodeVisitor ?:
$this->translationNodeVisitor =
new TranslationNodeVisitor();
} /**
* @param array|string $arguments Can be the locale as a string when $message is a TranslatableInterface
*/
public function trans(string|\Stringable|TranslatableInterface|null
$message, array|string
$arguments =
[], string
$domain = null, string
$locale = null, int
$count = null
): string
{ if ($message instanceof TranslatableInterface
) { if ([] !==
$arguments && !\
is_string($arguments)) { throw new \
TypeError(sprintf('Argument 2 passed to "%s()" must be a locale passed as a string when the message is a "%s", "%s" given.', __METHOD__, TranslatableInterface::
class,
get_debug_type($arguments)));
}