>, * primaryNextStep?: array{ * label?: string, * text: string, * source: string, * secondaryGuidance?: list * }, * compactCounts?: array{ * summaryLine?: ?string, * primaryFacts?: list>, * diagnosticFacts?: list> * }, * attentionNote?: ?string * }|null $decisionZone * @param list $mainSections * @param list $supportingGroups * @param list $technicalSections * @param list $emptyStateNotes */ public function __construct( public string $resourceType, public string $scope, public SummaryHeaderData $header, public ?array $decisionZone = null, public array $mainSections = [], public array $supportingGroups = [], public array $technicalSections = [], public array $emptyStateNotes = [], ) {} /** * @return array{ * resourceType: string, * scope: string, * header: array{ * title: string, * subtitle: ?string, * statusBadges: list, * keyFacts: list, * primaryActions: list, * descriptionHint: ?string * }, * decisionZone: array|null, * mainSections: list>, * supportingGroups: list>, * technicalSections: list>, * emptyStateNotes: list * } */ public function toArray(): array { return [ 'resourceType' => $this->resourceType, 'scope' => $this->scope, 'header' => $this->header->toArray(), 'decisionZone' => $this->decisionZone, 'mainSections' => array_values(array_map( static fn (DetailSectionData $section): array => $section->toArray(), $this->mainSections, )), 'supportingGroups' => array_values(array_map( static fn (SupportingCardData $group): array => $group->toArray(), $this->supportingGroups, )), 'technicalSections' => array_values(array_map( static fn (TechnicalDetailData $section): array => $section->toArray(), $this->technicalSections, )), 'emptyStateNotes' => array_values($this->emptyStateNotes), ]; } }