$mainSections * @param list $supportingCards * @param list $technicalSections * @param list $emptyStateNotes */ public function __construct( public string $resourceType, public string $scope, public SummaryHeaderData $header, public array $mainSections = [], public array $supportingCards = [], 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 * }, * mainSections: list>, * supportingCards: list>, * technicalSections: list>, * emptyStateNotes: list * } */ public function toArray(): array { return [ 'resourceType' => $this->resourceType, 'scope' => $this->scope, 'header' => $this->header->toArray(), 'mainSections' => array_values(array_map( static fn (DetailSectionData $section): array => $section->toArray(), $this->mainSections, )), 'supportingCards' => array_values(array_map( static fn (SupportingCardData $card): array => $card->toArray(), $this->supportingCards, )), 'technicalSections' => array_values(array_map( static fn (TechnicalDetailData $section): array => $section->toArray(), $this->technicalSections, )), 'emptyStateNotes' => array_values($this->emptyStateNotes), ]; } }