From ee5e1d7517af4e9eb38d69deae7635bcea79db1a Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Fri, 12 Aug 2016 08:02:04 +0200 Subject: [PATCH] Applied fixes from StyleCI (#3) --- src/Channel.php | 17 ++++++++--------- src/Events/SendingMessage.php | 1 - src/Exceptions/CouldNotSendNotification.php | 2 +- src/Message.php | 4 ++-- src/Telegram.php | 7 ++++--- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/Channel.php b/src/Channel.php index 422d47c..47a9566 100644 --- a/src/Channel.php +++ b/src/Channel.php @@ -2,10 +2,9 @@ namespace NotificationChannels\Telegram; -use NotificationChannels\Telegram\Exceptions\CouldNotSendNotification; +use Illuminate\Notifications\Notification; use NotificationChannels\Telegram\Events\MessageWasSent; use NotificationChannels\Telegram\Events\SendingMessage; -use Illuminate\Notifications\Notification; class Channel { @@ -49,9 +48,9 @@ public function send($notifiable, Notification $notification) } $params = array_merge([ - 'chat_id' => $chatId, - 'text' => trim($message->content), - 'parse_mode' => 'Markdown', + 'chat_id' => $chatId, + 'text' => trim($message->content), + 'parse_mode' => 'Markdown', 'reply_markup' => $this->getReplyMarkup($message), ], $message->options); @@ -61,8 +60,8 @@ public function send($notifiable, Notification $notification) } /** - * @param Message $message - * @param $notifiable + * @param Message $message + * @param $notifiable * * @return mixed */ @@ -84,10 +83,10 @@ protected function getReplyMarkup(Message $message) return; } - return (new Telegram) + return (new Telegram()) ->buttons([ 'text' => $message->actionText, - 'url' => $message->actionUrl, + 'url' => $message->actionUrl, ]) ->getKeyboardMarkup(); } diff --git a/src/Events/SendingMessage.php b/src/Events/SendingMessage.php index f0d5d39..db987fa 100644 --- a/src/Events/SendingMessage.php +++ b/src/Events/SendingMessage.php @@ -6,7 +6,6 @@ class SendingMessage { - protected $notifiable; /** @var \Illuminate\Notifications\Notification */ diff --git a/src/Exceptions/CouldNotSendNotification.php b/src/Exceptions/CouldNotSendNotification.php index 50170da..e27405d 100644 --- a/src/Exceptions/CouldNotSendNotification.php +++ b/src/Exceptions/CouldNotSendNotification.php @@ -49,6 +49,6 @@ public static function telegramBotTokenNotProvided($message) */ public static function serviceCommunicationError() { - return new static("The communication with Telegram failed."); + return new static('The communication with Telegram failed.'); } } diff --git a/src/Message.php b/src/Message.php index e9182b4..3aa9cb6 100644 --- a/src/Message.php +++ b/src/Message.php @@ -86,8 +86,8 @@ public function content($content) /** * Configure the "call to action" button. * - * @param string $text - * @param string $url + * @param string $text + * @param string $url * * @return $this */ diff --git a/src/Telegram.php b/src/Telegram.php index e888820..9466ab3 100644 --- a/src/Telegram.php +++ b/src/Telegram.php @@ -116,7 +116,7 @@ public function getKeyboardMarkup($options = 0) * * @link https://core.telegram.org/bots/api#sendmessage * - * @param array $params + * @param array $params * * @var int|string $params ['chat_id'] * @var string $params ['text'] @@ -139,8 +139,9 @@ public function sendMessage($params) * @param $endpoint * @param $params * - * @return \Psr\Http\Message\ResponseInterface * @throws CouldNotSendNotification + * + * @return \Psr\Http\Message\ResponseInterface */ protected function sendRequest($endpoint, $params) { @@ -182,4 +183,4 @@ protected function isTokenExist() throw CouldNotSendNotification::telegramBotTokenNotProvided('You must provide your telegram bot token to make any API requests.'); } } -} \ No newline at end of file +}