src/Viserio/Bridge/Twig/Extractor/TwigExtractor.php
protected function extractTemplate(string $template): array
    {
        /** @var \Viserio\Bridge\Twig\NodeVisitor\TranslationNodeVisitor $visitor */
        $visitor = $this->twig->getExtension(TranslatorExtension::class)->getTranslationNodeVisitor();
        $visitor->enable();

        $this->twig->parse($this->twig->tokenize(new Source($template, '')));

        $messages = [];

        foreach ($visitor->getMessages() as $message) {
            $messages[$message[1] ?? $this->defaultDomain][\trim($message[0])] = $this->prefix . \trim($message[0]);
        }

        $visitor->disable();

        return $messages;
    }
protected function extractTemplate(string $template): array
    {
        /** @var \Viserio\Bridge\Twig\NodeVisitor\TranslationNodeVisitor $visitor */
        $visitor = $this->twig->getExtension(TranslatorExtension::class)->getTranslationNodeVisitor();
        $visitor->enable();

        $this->twig->parse($this->twig->tokenize(new Source($template, '')));

        $messages = [];

        foreach ($visitor->getMessages() as $message) {
            $messages[$message[1] ?? $this->defaultDomain][\trim($message[0])] = $this->prefix . \trim($message[0]);
        }

        $visitor->disable();

        return $messages;
    }
@param string $template

@throws \Twig_Error_Syntax

@return array