src/Viserio/Bridge/Twig/DataCollector/TwigDataCollector.php
public function collect(ServerRequestInterface $serverRequest, ResponseInterface $response): void
    {
        $this->data['template_paths'] = [];

        $templateFinder = function (Profile $profile) use (&$templateFinder): void {
            if ($profile->isTemplate() &&
                $template = $this->twigEnvironment->load($profile->getName())->getSourceContext()->getPath()
            ) {
                $this->data['template_paths'][$profile->getName()] = $template;
            }

            foreach ($profile as $p) {
                $templateFinder($p);
            }
        };

        $templateFinder($this->profile);
    }
public function collect(ServerRequestInterface $serverRequest, ResponseInterface $response): void
    {
        $this->data['template_paths'] = [];

        $templateFinder = function (Profile $profile) use (&$templateFinder): void {
            if ($profile->isTemplate() &&
                $template = $this->twigEnvironment->load($profile->getName())->getSourceContext()->getPath()
            ) {
                $this->data['template_paths'][$profile->getName()] = $template;
            }

            foreach ($profile as $p) {
                $templateFinder($p);
            }
        };

        $templateFinder($this->profile);
    }
{@inheritdoc}