Skip to content

Commit

Permalink
Applied fixes from StyleCI (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze authored Aug 12, 2016
1 parent fd2fc66 commit ee5e1d7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
17 changes: 8 additions & 9 deletions src/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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);

Expand All @@ -61,8 +60,8 @@ public function send($notifiable, Notification $notification)
}

/**
* @param Message $message
* @param $notifiable
* @param Message $message
* @param $notifiable
*
* @return mixed
*/
Expand All @@ -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();
}
Expand Down
1 change: 0 additions & 1 deletion src/Events/SendingMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SendingMessage
{

protected $notifiable;

/** @var \Illuminate\Notifications\Notification */
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/CouldNotSendNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
}
4 changes: 2 additions & 2 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
7 changes: 4 additions & 3 deletions src/Telegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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)
{
Expand Down Expand Up @@ -182,4 +183,4 @@ protected function isTokenExist()
throw CouldNotSendNotification::telegramBotTokenNotProvided('You must provide your telegram bot token to make any API requests.');
}
}
}
}

0 comments on commit ee5e1d7

Please sign in to comment.