Skip to content

Commit 5fac2b0

Browse files
authored
fix immediately discarded twitter version
The `changeTwitterSettingsIfNeeded` method creates a new instance of the TwitterOAuth class. The default API version in TwitterOAuth is 2. Setting the api version *before* changing the twitter settings creates an opportunity for the api version to be **immediately** overwritten if the settings need to be changed. Flipping these lines is all that is necessary to remediate the error.
1 parent afa080e commit 5fac2b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TwitterChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function __construct(protected TwitterOAuth $twitter)
2121
*/
2222
public function send($notifiable, Notification $notification): array|object
2323
{
24-
$this->twitter->setApiVersion('1.1');
2524
$this->changeTwitterSettingsIfNeeded($notifiable);
25+
$this->twitter->setApiVersion('1.1');
2626

2727
$twitterMessage = $notification->toTwitter($notifiable);
2828
$twitterMessage = $this->addImagesIfGiven($twitterMessage);

0 commit comments

Comments
 (0)