@@ -19,17 +19,17 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @throws CouldNotSendNotification |
21 | 21 | */ |
22 | - public function send($notifiable, Notification $notification): array|object |
|
22 | + public function send($notifiable, Notification $notification): array | object |
|
23 | 23 | { |
24 | 24 | $this->changeTwitterSettingsIfNeeded($notifiable); |
25 | 25 | |
26 | 26 | $twitterMessage = $notification->toTwitter($notifiable); |
27 | 27 | $twitterMessage = $this->addImagesIfGiven($twitterMessage); |
28 | 28 | $twitterMessage = $this->addVideosIfGiven($twitterMessage); |
29 | - if($twitterMessage instanceof TwitterDirectMessage){ |
|
30 | - $requestBody = $twitterMessage->getRequestBody($this->twitter); |
|
31 | - }else{ |
|
32 | - $requestBody = $twitterMessage->getRequestBody(); |
|
29 | + if ($twitterMessage instanceof TwitterDirectMessage) { |
|
30 | + $requestBody = $twitterMessage->getRequestBody($this->twitter); |
|
31 | + } else { |
|
32 | + $requestBody = $twitterMessage->getRequestBody(); |
|
33 | 33 | } |
34 | 34 | $twitterApiResponse = $this->twitter->post( |
35 | 35 | $twitterMessage->getApiEndpoint(), |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if (is_a($twitterMessage, TwitterStatusUpdate::class) && $twitterMessage->getImages()) { |
73 | 73 | $this->twitter->setTimeouts(10, 15); |
74 | 74 | |
75 | - $twitterMessage->imageIds = collect($twitterMessage->getImages())->map(function (TwitterImage $image) { |
|
75 | + $twitterMessage->imageIds = collect($twitterMessage->getImages())->map(function(TwitterImage $image) { |
|
76 | 76 | $media = $this->twitter->upload('media/upload', ['media' => $image->getPath()]); |
77 | 77 | |
78 | 78 | return $media->media_id_string; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if (is_a($twitterMessage, TwitterStatusUpdate::class) && $twitterMessage->getVideos()) { |
91 | 91 | $this->twitter->setTimeouts(10, 15); |
92 | 92 | |
93 | - $twitterMessage->videoIds = collect($twitterMessage->getVideos())->map(function (TwitterVideo $video) { |
|
93 | + $twitterMessage->videoIds = collect($twitterMessage->getVideos())->map(function(TwitterVideo $video) { |
|
94 | 94 | $media = $this->twitter->upload('media/upload', [ |
95 | 95 | 'media' => $video->getPath(), |
96 | 96 | 'media_category' => 'tweet_video', |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $twitterMessage = $this->addVideosIfGiven($twitterMessage); |
29 | 29 | if($twitterMessage instanceof TwitterDirectMessage){ |
30 | 30 | $requestBody = $twitterMessage->getRequestBody($this->twitter); |
31 | - }else{ |
|
31 | + } else{ |
|
32 | 32 | $requestBody = $twitterMessage->getRequestBody(); |
33 | 33 | } |
34 | 34 | $twitterApiResponse = $this->twitter->post( |