textSession = $session; } public function setDocumentId(int $documentId): void { $this->documentId = $documentId; } public function setDocument(?Document $document): void { $this->document = $document; } public function setUserId(?string $userId): void { $this->userId = $userId; } /** * @throws InvalidSessionException */ public function getSession(): Session { if ($this->textSession === null) { throw new InvalidSessionException(); } return $this->textSession; } /** * @throws InvalidSessionException */ public function getDocumentId(): int { if ($this->documentId === null) { throw new InvalidSessionException(); } return $this->documentId; } /** * @throws InvalidSessionException */ public function getDocument(): Document { if ($this->document === null) { throw new InvalidSessionException(); } return $this->document; } /** * @throws InvalidSessionException */ public function getUserId(): string { if ($this->userId === null) { throw new InvalidSessionException(); } return $this->userId; } }