ctx = $ctx; $this->assets = $ctx->getWebAssetInfo(); } public function getFunctions() { return [ new TwigFunction('asset', $this->getAssetPath(...)), new TwigFunction('git_commit_hash', GitInfo::hash(...)), new TwigFunction('git_tag', GitInfo::tag(...)), new TwigFunction('git_branch', GitInfo::branch(...)), new TwigFunction('startup_time', fn(float $time = HAU_STARTUP) => microtime(true) - $time), new TwigFunction('sql_query_count', $this->ctx->getDbQueryCount(...)), ]; } public function getAssetPath(string $name): string { return $this->assets?->{$name} ?? ''; } }