authorId = $authorId; return $this; } /** @psalm-param non-empty-string|UuidInterface $cheepId */ public function withCheepIdOf(string|UuidInterface $cheepId): self { $this->cheepId = $cheepId; return $this; } /** @psalm-param non-empty-string $message */ public function withAMessage(string $message): self { $this->cheepMessage = $message; return $this; } public function build(): Cheep { if (null === $this->cheepMessage) { throw new \InvalidArgumentException("Cheep message cannot be null"); } return Cheep::compose( AuthorTestDataBuilder::anAuthorIdentity($this->authorId), self::aCheepIdentity($this->cheepId), CheepMessage::write($this->cheepMessage) ); } }