Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applied fixes from StyleCI #3

Merged
merged 1 commit into from
Aug 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.');
}
}
}
}