Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
christophrumpel committed Mar 16, 2023
1 parent 558da07 commit bd321f1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/TwitterChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct(protected TwitterOAuth $twitter)
/**
* Send the given notification.
*
* @param mixed $notifiable Should be an object that uses the Illuminate\Notifications\Notifiable trait.
* @param mixed $notifiable Should be an object that uses the Illuminate\Notifications\Notifiable trait.
*
* @throws CouldNotSendNotification
*/
Expand All @@ -26,10 +26,11 @@ public function send($notifiable, Notification $notification): array|object
$twitterMessage = $notification->toTwitter($notifiable);
$twitterMessage = $this->addImagesIfGiven($twitterMessage);
$twitterMessage = $this->addVideosIfGiven($twitterMessage);
if($twitterMessage instanceof TwitterDirectMessage){
$requestBody = $twitterMessage->getRequestBody($this->twitter);
}else{
$requestBody = $twitterMessage->getRequestBody();

if ($twitterMessage instanceof TwitterDirectMessage) {
$requestBody = $twitterMessage->getRequestBody($this->twitter);
} else {
$requestBody = $twitterMessage->getRequestBody();
}
$twitterApiResponse = $this->twitter->post(
$twitterMessage->getApiEndpoint(),
Expand All @@ -47,7 +48,7 @@ public function send($notifiable, Notification $notification): array|object
/**
* Use per user settings instead of default ones.
*
* @param object $notifiable Provide an object that uses the Illuminate\Notifications\Notifiable trait.
* @param object $notifiable Provide an object that uses the Illuminate\Notifications\Notifiable trait.
*/
private function changeTwitterSettingsIfNeeded(object $notifiable)
{
Expand Down

0 comments on commit bd321f1

Please sign in to comment.