Skip to content

Commit

Permalink
Merge pull request #1 from laravel-notification-channels/analysis-zGg3A9
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
mpociot committed Aug 14, 2016
2 parents 9f3a519 + 49a0c37 commit 25749ce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/WebhookChannel.php
Expand Up @@ -8,11 +8,9 @@
use NotificationChannels\Webhook\Events\MessageWasSent;
use NotificationChannels\Webhook\Events\SendingMessage;
use Illuminate\Notifications\Notification;
use NotificationChannels\Webhook\Exceptions\InvalidConfiguration;

class WebhookChannel
{

/** @var Client */
protected $client;

Expand Down Expand Up @@ -49,7 +47,7 @@ public function send($notifiable, Notification $notification)
$response = $this->client->post($url, [
'body' => json_encode(Arr::get($webhookData, 'data')),
'verify' => false,
'headers' => Arr::get($webhookData, 'headers')
'headers' => Arr::get($webhookData, 'headers'),
]);

if ($response->getStatusCode() !== 200) {
Expand Down
4 changes: 1 addition & 3 deletions src/WebhookMessage.php
Expand Up @@ -2,8 +2,6 @@

namespace NotificationChannels\Webhook;

use DateTime;

class WebhookMessage
{
/** @var mixed */
Expand Down Expand Up @@ -83,7 +81,7 @@ public function toArray()
{
return [
'data' => $this->data,
'headers' => $this->headers
'headers' => $this->headers,
];
}
}
8 changes: 4 additions & 4 deletions tests/ChannelTest.php
Expand Up @@ -26,8 +26,8 @@ public function it_can_send_a_notification()
'verify' => false,
'headers' => [
'User-Agent' => 'WebhookAgent',
'X-Custom' => 'CustomHeader'
]
'X-Custom' => 'CustomHeader',
],
])
->andReturn($response);
$channel = new WebhookChannel($client);
Expand Down Expand Up @@ -71,8 +71,8 @@ public function toWebhook($notifiable)
(new WebhookMessage(
[
'payload' => [
'webhook' => 'data'
]
'webhook' => 'data',
],
]
))->userAgent('WebhookAgent')
->header('X-Custom', 'CustomHeader');
Expand Down
1 change: 0 additions & 1 deletion tests/MessageTest.php
Expand Up @@ -2,7 +2,6 @@

namespace NotificationChannels\Webhook\Test;

use DateTime;
use Illuminate\Support\Arr;
use NotificationChannels\Webhook\WebhookMessage;

Expand Down

0 comments on commit 25749ce

Please sign in to comment.