File tree Expand file tree Collapse file tree 5 files changed +13
-35
lines changed
Expand file tree Collapse file tree 5 files changed +13
-35
lines changed Original file line number Diff line number Diff line change 66
77class CouldNotSendNotification extends Exception
88{
9- /**
10- * @param $response
11- * @return CouldNotSendNotification
12- */
13- public static function serviceRespondsNotSuccessful ($ response ): CouldNotSendNotification
9+ public static function serviceRespondsNotSuccessful (mixed $ response ): CouldNotSendNotification
1410 {
1511 if (isset ($ response ->error )) {
1612 return new static ("Couldn't post notification. Response: " .$ response ->error );
@@ -21,11 +17,7 @@ public static function serviceRespondsNotSuccessful($response): CouldNotSendNoti
2117 return new static ("Couldn't post notification. Response: " .$ responseBody );
2218 }
2319
24- /**
25- * @param $response
26- * @return CouldNotSendNotification
27- */
28- public static function userWasNotFound ($ response ): CouldNotSendNotification
20+ public static function userWasNotFound (mixed $ response ): CouldNotSendNotification
2921 {
3022 $ responseBody = print_r ($ response ->errors [0 ]->message , true );
3123
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ public function getApiEndpoint(): string
2222 /**
2323 * Get Twitter direct message receiver.
2424 *
25- * @param TwitterOAuth $twitter
2625 * @return string|mixed
2726 *
2827 * @throws CouldNotSendNotification
@@ -49,9 +48,6 @@ public function getReceiver(TwitterOAuth $twitter): mixed
4948 /**
5049 * Build Twitter request body.
5150 *
52- * @param TwitterOAuth $twitter
53- * @return array
54- *
5551 * @throws CouldNotSendNotification
5652 */
5753 public function getRequestBody (TwitterOAuth $ twitter ): array
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ public function getApiEndpoint(): string
3131 /**
3232 * Set Twitter media files.
3333 *
34- * @param array|string $images
3534 * @return $this
3635 */
3736 public function withImage (array |string $ images ): static
@@ -47,8 +46,6 @@ public function withImage(array|string $images): static
4746
4847 /**
4948 * Get Twitter images list.
50- *
51- * @return array|null
5249 */
5350 public function getImages (): ?array
5451 {
Original file line number Diff line number Diff line change 33namespace NotificationChannels \Twitter \Test ;
44
55use Abraham \TwitterOAuth \TwitterOAuth ;
6+ use Illuminate \Notifications \Notifiable ;
67use Illuminate \Notifications \Notification ;
78use Mockery ;
89use NotificationChannels \Twitter \Exceptions \CouldNotSendNotification ;
1314
1415class TwitterChannelTest extends TestCase
1516{
16- /** @var Mockery\Mock */
17+ /**
18+ * @var Mockery\Mock
19+ */
1720 protected $ twitter ;
1821
19- /** @var \NotificationChannels\Twitter\TwitterChannel */
20- protected $ channel ;
22+ protected TwitterChannel $ channel ;
2123
2224 public function setUp (): void
2325 {
@@ -100,10 +102,10 @@ public function it_throws_an_exception_when_it_could_not_send_the_notification()
100102
101103class TestNotifiable
102104{
103- use \ Illuminate \ Notifications \ Notifiable;
105+ use Notifiable;
104106
105107 /**
106- * @return int
108+ * @return false
107109 */
108110 public function routeNotificationForTwitter ()
109111 {
@@ -113,9 +115,11 @@ public function routeNotificationForTwitter()
113115
114116class TestNotifiableWithDifferentSettings
115117{
116- use \ Illuminate \ Notifications \ Notifiable;
118+ use Notifiable;
117119
118- /** @return array */
120+ /**
121+ * @return array
122+ */
119123 public function routeNotificationForTwitter ()
120124 {
121125 return ['1 ' , '2 ' , '3 ' , '4 ' ];
Original file line number Diff line number Diff line change 22
33namespace NotificationChannels \Twitter \Test ;
44
5- use Abraham \TwitterOAuth \TwitterOAuth ;
65use ArgumentCountError ;
7- use Mockery ;
8- use NotificationChannels \Twitter \TwitterDirectMessage ;
96use NotificationChannels \Twitter \TwitterMessage ;
107
118class TwitterMessageTest extends TestCase
129{
13- // public function setUp(): void
14- // {
15- // parent::setUp();
16- // $this->twitter = Mockery::mock(TwitterOAuth::class);
17- // $this->messageWithUserId = new TwitterDirectMessage(1234, 'myMessage');
18- // $this->messageWithScreenName = new TwitterDirectMessage('receiver', 'myMessage');
19- // }
20-
2110 /** @test */
2211 public function it_needs_a_content ()
2312 {
You can’t perform that action at this time.
0 commit comments