setTopic($config['topic']); } return $instance; } public function __construct(Client $client) { $this->client = $client; } public function setTopic(string $topic): void { $this->topic = $topic; } public function send(string $title, string $message): void { assert(strlen($title) > 0); assert(strlen($title) < 256); assert(strlen($message) > 0); assert(strlen($message) < 4096); $msg = new Message(); $msg->topic($this->topic); $msg->title($title); $msg->body($message); $this->client->send($msg); } }