domainKey) === '' || trim($this->subjectClass) === '' || trim($this->subjectTypeKey) === '' || trim($this->subjectKey) === '') { throw new InvalidArgumentException('Compare subject identities require non-empty domain, subject class, subject type key, and subject key values.'); } } /** * @return array{ * domain_key: string, * subject_class: string, * subject_type_key: string, * external_subject_id: ?string, * subject_key: string * } */ public function toArray(): array { return [ 'domain_key' => $this->domainKey, 'subject_class' => $this->subjectClass, 'subject_type_key' => $this->subjectTypeKey, 'external_subject_id' => $this->externalSubjectId, 'subject_key' => $this->subjectKey, ]; } }