@@ -56,7 +56,7 @@ |
||
| 56 | 56 | ->createRequest() |
| 57 | 57 | ->setMethod('post') |
| 58 | 58 | ->setUrl($this->getUri()) |
| 59 | - ->addHeaders(['Authorization' => 'Basic ' . base64_encode("{$this->accountSid}:{$this->authToken}")]) |
|
| 59 | + ->addHeaders(['Authorization' => 'Basic '.base64_encode("{$this->accountSid}:{$this->authToken}")]) |
|
| 60 | 60 | ->setData($data) |
| 61 | 61 | ->send(); |
| 62 | 62 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $recipients = [$recipients]; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if (!is_array($notifications)){ |
|
| 81 | + if (!is_array($notifications)) { |
|
| 82 | 82 | /** |
| 83 | 83 | * @var $notifications NotificationInterface[] |
| 84 | 84 | */ |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | foreach ($channels as $channel) { |
| 97 | 97 | $channelInstance = $this->getChannelInstance($channel); |
| 98 | 98 | try { |
| 99 | - \Yii::info("Sending notification " . get_class($notification) . " to " . get_class($recipient) . " via {$channel}", __METHOD__); |
|
| 99 | + \Yii::info("Sending notification ".get_class($notification)." to ".get_class($recipient)." via {$channel}", __METHOD__); |
|
| 100 | 100 | $response = $channelInstance->send($recipient, $notification); |
| 101 | 101 | } catch (\Exception $e) { |
| 102 | 102 | $response = $e; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | parent::init(); |
| 65 | 65 | |
| 66 | - if(!isset($this->bot_id) || !isset($this->bot_token)){ |
|
| 66 | + if (!isset($this->bot_id) || !isset($this->bot_token)) { |
|
| 67 | 67 | throw new InvalidConfigException("Bot id or bot token is undefined"); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $message = $notification->exportFor('telegram'); |
| 89 | 89 | $text = "*{$message->subject}*\n{$message->body}"; |
| 90 | 90 | $chat_id = $recipient->routeNotificationFor('telegram'); |
| 91 | - if(!$chat_id){ |
|
| 91 | + if (!$chat_id) { |
|
| 92 | 92 | throw new \Exception("User doesn't have telegram_id"); |
| 93 | 93 | } |
| 94 | 94 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | "text" => $text, |
| 98 | 98 | 'disable_notification' => $this->silent_mode |
| 99 | 99 | ]; |
| 100 | - if($this->parse_mode != null){ |
|
| 100 | + if ($this->parse_mode != null) { |
|
| 101 | 101 | $data["parse_mode"] = $this->parse_mode; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -111,6 +111,6 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | private function createUrl() |
| 113 | 113 | { |
| 114 | - return $this->api_url . $this->bot_id . ":" . $this->bot_token . "/sendmessage"; |
|
| 114 | + return $this->api_url.$this->bot_id.":".$this->bot_token."/sendmessage"; |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | \ No newline at end of file |