Skip to content

Commit 2398096

Browse files
[Notifier] Bring consistency to bridges
1 parent 29721da commit 2398096

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ZulipTransport.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ protected function doSend(MessageInterface $message): SentMessage
5959
throw new UnsupportedMessageTypeException(__CLASS__, ChatMessage::class, $message);
6060
}
6161

62-
if (null !== $message->getOptions() && !($message->getOptions() instanceof ZulipOptions)) {
63-
throw new LogicException(sprintf('The "%s" transport only supports instances of "%s" for options.', __CLASS__, ZulipOptions::class));
64-
}
65-
66-
$options = ($opts = $message->getOptions()) ? $opts->toArray() : [];
62+
$options = $message->getOptions()?->toArray() ?? [];
6763
$options['content'] = $message->getSubject();
6864

6965
if (null === $message->getRecipientId() && empty($options['topic'])) {
@@ -81,7 +77,7 @@ protected function doSend(MessageInterface $message): SentMessage
8177
$endpoint = sprintf('https://%s/api/v1/messages', $this->getEndpoint());
8278

8379
$response = $this->client->request('POST', $endpoint, [
84-
'auth_basic' => $this->email.':'.$this->token,
80+
'auth_basic' => [$this->email, $this->token],
8581
'body' => $options,
8682
]);
8783

0 commit comments

Comments
 (0)