File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public function __toString(): string
4646
4747 public function supports (MessageInterface $ message ): bool
4848 {
49- return $ message instanceof ChatMessage;
49+ return $ message instanceof ChatMessage && ( null === $ message -> getOptions () || $ message -> getOptions () instanceof FirebaseOptions) ;
5050 }
5151
5252 protected function doSend (MessageInterface $ message ): SentMessage
@@ -56,14 +56,12 @@ protected function doSend(MessageInterface $message): SentMessage
5656 }
5757
5858 $ endpoint = sprintf ('https://%s ' , $ this ->getEndpoint ());
59- $ options = ($ opts = $ message ->getOptions ()) ? $ opts ->toArray () : [];
60- if (!isset ($ options ['to ' ])) {
61- $ options ['to ' ] = $ message ->getRecipientId ();
62- }
63- if (null === $ options ['to ' ]) {
59+ $ options = $ message ->getOptions ()?->toArray() ?? [];
60+ $ options ['to ' ] = $ message ->getRecipientId ();
61+
62+ if (!$ options ['to ' ]) {
6463 throw new InvalidArgumentException (sprintf ('The "%s" transport required the "to" option to be set. ' , __CLASS__ ));
6564 }
66- $ options ['notification ' ] ??= [];
6765 $ options ['notification ' ]['body ' ] = $ message ->getSubject ();
6866 $ options ['data ' ] ??= [];
6967
You can’t perform that action at this time.
0 commit comments