tenantId <= 0) { throw new InvalidArgumentException('Tenant governance aggregates require a positive tenant id.'); } if ($this->workspaceId <= 0) { throw new InvalidArgumentException('Tenant governance aggregates require a positive workspace id.'); } if (trim($this->compareState) === '') { throw new InvalidArgumentException('Tenant governance aggregates require a compare state.'); } if (trim($this->headline) === '') { throw new InvalidArgumentException('Tenant governance aggregates require a headline.'); } if (trim($this->nextActionLabel) === '') { throw new InvalidArgumentException('Tenant governance aggregates require a next-action label.'); } if (! in_array($this->nextActionTarget, [ BaselineCompareSummaryAssessment::NEXT_TARGET_FINDINGS, BaselineCompareSummaryAssessment::NEXT_TARGET_LANDING, BaselineCompareSummaryAssessment::NEXT_TARGET_RUN, BaselineCompareSummaryAssessment::NEXT_TARGET_NONE, ], true)) { throw new InvalidArgumentException('Tenant governance aggregates require a supported next-action target.'); } } /** * @return array{ * tenantId: int, * workspaceId: int, * profileName: ?string, * compareState: string, * stateFamily: string, * tone: string, * headline: string, * supportingMessage: ?string, * reasonCode: ?string, * lastComparedLabel: ?string, * visibleDriftFindingsCount: int, * overdueOpenFindingsCount: int, * expiringGovernanceCount: int, * lapsedGovernanceCount: int, * activeNonNewFindingsCount: int, * highSeverityActiveFindingsCount: int, * nextActionLabel: string, * nextActionTarget: string, * positiveClaimAllowed: bool * } */ public function toArray(): array { return [ 'tenantId' => $this->tenantId, 'workspaceId' => $this->workspaceId, 'profileName' => $this->profileName, 'compareState' => $this->compareState, 'stateFamily' => $this->stateFamily, 'tone' => $this->tone, 'headline' => $this->headline, 'supportingMessage' => $this->supportingMessage, 'reasonCode' => $this->reasonCode, 'lastComparedLabel' => $this->lastComparedLabel, 'visibleDriftFindingsCount' => $this->visibleDriftFindingsCount, 'overdueOpenFindingsCount' => $this->overdueOpenFindingsCount, 'expiringGovernanceCount' => $this->expiringGovernanceCount, 'lapsedGovernanceCount' => $this->lapsedGovernanceCount, 'activeNonNewFindingsCount' => $this->activeNonNewFindingsCount, 'highSeverityActiveFindingsCount' => $this->highSeverityActiveFindingsCount, 'nextActionLabel' => $this->nextActionLabel, 'nextActionTarget' => $this->nextActionTarget, 'positiveClaimAllowed' => $this->positiveClaimAllowed, ]; } }