Skip to content

Commit d2cd91c

Browse files
committed
Merge branch 'master' of github.com:laravel-notification-channels/twitter
2 parents f8d85f3 + e1abf8a commit d2cd91c

File tree

6 files changed

+10
-20
lines changed

6 files changed

+10
-20
lines changed

src/Exceptions/CouldNotSendNotification.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ public static function serviceRespondedWithAnError($response)
88
{
99
return new static("Couldn't post Twitter status. Error: {$response->errors[0]->code} Message: {$response->errors[0]->message}");
1010
}
11-
1211
}

src/Twitter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace NotificationChannels\Twitter;
44

5-
65
use Abraham\TwitterOAuth\TwitterOAuth;
76

87
class Twitter
@@ -19,4 +18,4 @@ public function __construct(array $config)
1918
$config['access_secret']
2019
);
2120
}
22-
}
21+
}

src/TwitterChannel.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
2+
23
namespace NotificationChannels\Twitter;
34

45
use GuzzleHttp\Client;
5-
use NotificationChannels\Twitter\Exceptions\CouldNotSendNotification;
66
use Illuminate\Notifications\Notification;
7-
use NotificationChannels\Twitter\Exceptions\InvalidConfiguration;
7+
use NotificationChannels\Twitter\Exceptions\CouldNotSendNotification;
88

99
class TwitterChannel
1010
{
@@ -15,7 +15,7 @@ class TwitterChannel
1515
protected $twitter;
1616

1717
/**
18-
* @param Client $client
18+
* @param Client $client
1919
* @param Twitter $twitter
2020
*/
2121
public function __construct(Client $client, Twitter $twitter)
@@ -27,7 +27,7 @@ public function __construct(Client $client, Twitter $twitter)
2727
/**
2828
* Send the given notification.
2929
*
30-
* @param mixed $notifiable
30+
* @param mixed $notifiable
3131
* @param \Illuminate\Notifications\Notification $notification
3232
*
3333
* @throws CouldNotSendNotification
@@ -37,13 +37,10 @@ public function send($notifiable, Notification $notification)
3737
$twitterMessage = $notification->toTwitter($notifiable);
3838

3939
$response = $this->twitter->connection->post(
40-
"statuses/update", ["status" => $twitterMessage->getContent()]);
40+
'statuses/update', ['status' => $twitterMessage->getContent()]);
4141

4242
if (isset($response->errors)) {
4343
throw CouldNotSendNotification::serviceRespondedWithAnError($response);
4444
}
45-
4645
}
47-
4846
}
49-

src/TwitterMessage.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
class TwitterMessage
66
{
7-
8-
/** @var string */
7+
/** @var string */
98
protected $content;
109

1110
/**
@@ -27,13 +26,12 @@ public function __construct($content = '')
2726
}
2827

2928
/**
30-
* Get Twitter message content
29+
* Get Twitter message content.
3130
*
3231
* @return string
3332
*/
3433
public function getContent()
3534
{
3635
return $this->content;
3736
}
38-
3937
}

src/TwitterServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
namespace NotificationChannels\Twitter;
44

55
use Illuminate\Support\ServiceProvider;
6-
use NotificationChannels\Twitter\TwitterChannel;
7-
use GuzzleHttp\Client as HttpClient;
6+
87

98
class TwitterServiceProvider extends ServiceProvider
109
{
@@ -19,6 +18,5 @@ public function boot()
1918
->give(function () {
2019
return new Twitter(config('services.twitter'));
2120
});
22-
2321
}
2422
}

tests/TwitterMessageTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ public function it_accepts_a_message_when_constructing_a_message()
2424

2525
$this->assertEquals('myMessage', $message->getContent());
2626
}
27-
28-
}
27+
}

0 commit comments

Comments
 (0)