Skip to content

Commit

Permalink
Merge pull request #1 from laravel-notification-channels/analysis-8PevpY
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
mpociot authored Aug 14, 2016
2 parents 94e18d0 + 371f340 commit 4cd4a32
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
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
8 changes: 4 additions & 4 deletions src/TrelloChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(Client $client)
*/
public function send($notifiable, Notification $notification)
{
if (!$routing = collect($notifiable->routeNotificationFor('Trello'))) {
if (! $routing = collect($notifiable->routeNotificationFor('Trello'))) {
return;
}

Expand All @@ -48,14 +48,14 @@ public function send($notifiable, Notification $notification)

$shouldSendMessage = event(new SendingMessage($notifiable, $notification), [], true) !== false;

if (!$shouldSendMessage) {
if (! $shouldSendMessage) {
return;
}

$trelloParameters = $notification->toTrello($notifiable)->toArray();

$response = $this->client->post(self::API_ENDPOINT . '?key='. $key .'&token='. $routing->get('token'), [
'form_params' => Arr::set($trelloParameters, 'idList', $routing->get('idList'))
$response = $this->client->post(self::API_ENDPOINT.'?key='.$key.'&token='.$routing->get('token'), [
'form_params' => Arr::set($trelloParameters, 'idList', $routing->get('idList')),
]);

if ($response->getStatusCode() !== 200) {
Expand Down
1 change: 0 additions & 1 deletion src/TrelloMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class TrelloMessage
/** @var string|null */
protected $due;


/**
* @param string $name
*
Expand Down
11 changes: 5 additions & 6 deletions tests/ChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public function it_can_send_a_notification()
'desc' => 'TrelloDescription',
'pos' => 'top',
'due' => null,
'idList' => 'TrelloListId'
]
'idList' => 'TrelloListId',
],
])
->andReturn($response);
$channel = new TrelloChannel($client);
Expand Down Expand Up @@ -86,10 +86,9 @@ class TestNotification extends Notification
{
public function toTrello($notifiable)
{
return (
return
(new TrelloMessage('TrelloName'))
->description('TrelloDescription')
->top()
);
->top();
}
}
}

0 comments on commit 4cd4a32

Please sign in to comment.