public function __construct()

in app/classes/ReleaseInsights/Template.php [18:31]


    public function __construct(public string $template, public array $data)
    {
        // Cache compiled templates on production in a twig folder (10x difference)
        $this->template_caching = PRODUCTION ? CACHE_PATH . 'twig/' : false;

        // @codeCoverageIgnoreStart
        // Pass extra variables to template in local dev mode
        if (LOCALHOST && !defined('TESTING_CONTEXT')) {
            $this->data += [
                'branch' => trim((string) shell_exec('git rev-parse --abbrev-ref HEAD')),
            ];
        }
        // @codeCoverageIgnoreEnd
    }