|null */ public function templateForDepartment(string $reportDepartmentKey): ?array { return $this->databaseStructuredTemplateFactory->templateForDepartment($reportDepartmentKey) ?? $this->blueprintTemplate($reportDepartmentKey) ?? $this->sourceStructuredTemplateFactory->templateForDepartment($reportDepartmentKey); } /** * @return array|null */ private function blueprintTemplate(string $reportDepartmentKey): ?array { $department = collect($this->departmentCatalog->departments()) ->firstWhere('key', $reportDepartmentKey); if ($department === null) { return null; } return $this->reportInputTypeBlueprintFactory->templateForDepartment($department); } }