> */ private function collectTemplateExternals(?string $templateIdentifier, int|string|null $version = null): array { if (empty($templateIdentifier)) { return []; } try { $template = $this->templateManager->getTemplate($templateIdentifier); if (! $template || empty($template['externals']) || ! is_array($template['externals'])) { return []; } return TemplateExternals::normalize($template['externals'], $templateIdentifier, $version); } catch (\Exception $e) { Log::warning('Failed to collect template externals: '.$e->getMessage()); return []; } } }