From 4616e406f163f8193469b30782ee584e739dc761 Mon Sep 17 00:00:00 2001 From: Alex Renoki Date: Tue, 7 Dec 2021 12:09:50 +0200 Subject: [PATCH 1/3] Added support for client in Pusher instance --- composer.json | 13 +++++-------- src/Illuminate/Broadcasting/BroadcastManager.php | 8 ++++++-- src/Illuminate/Broadcasting/composer.json | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 27535bc6f966..0b3d31c0a159 100644 --- a/composer.json +++ b/composer.json @@ -155,14 +155,11 @@ "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8).", "predis/predis": "Required to use the predis connector (^1.1.9).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^5.0|^6.0|^7.0).", - "symfony/amazon-mailer": "Required to enable support for the SES mail transport (^6.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^6.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", - "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.0).", - "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.0).", - "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.0).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.4).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", + "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)." }, "config": { "sort-packages": true diff --git a/src/Illuminate/Broadcasting/BroadcastManager.php b/src/Illuminate/Broadcasting/BroadcastManager.php index a4957cde900f..ba7a0f14745b 100644 --- a/src/Illuminate/Broadcasting/BroadcastManager.php +++ b/src/Illuminate/Broadcasting/BroadcastManager.php @@ -4,6 +4,7 @@ use Ably\AblyRest; use Closure; +use GuzzleHttp\Client as GuzzleClient; use Illuminate\Broadcasting\Broadcasters\AblyBroadcaster; use Illuminate\Broadcasting\Broadcasters\LogBroadcaster; use Illuminate\Broadcasting\Broadcasters\NullBroadcaster; @@ -214,8 +215,11 @@ protected function callCustomCreator(array $config) protected function createPusherDriver(array $config) { $pusher = new Pusher( - $config['key'], $config['secret'], - $config['app_id'], $config['options'] ?? [] + $config['key'], + $config['secret'], + $config['app_id'], + $config['options'] ?? [], + new GuzzleClient($config['client_options'] ?? []), ); if ($config['log'] ?? false) { diff --git a/src/Illuminate/Broadcasting/composer.json b/src/Illuminate/Broadcasting/composer.json index 37d06024f818..dbc0bf4ad8b6 100644 --- a/src/Illuminate/Broadcasting/composer.json +++ b/src/Illuminate/Broadcasting/composer.json @@ -34,7 +34,7 @@ } }, "suggest": { - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^5.0|^6.0|^7.0))." + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0)." }, "config": { "sort-packages": true From d02d5e161040ded56dc9e2d436c15c77fb1c7510 Mon Sep 17 00:00:00 2001 From: Alex Renoki Date: Tue, 7 Dec 2021 16:39:40 +0200 Subject: [PATCH 2/3] Reverted accidental merge conflict changes --- composer.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 0b3d31c0a159..b29e8ba51798 100644 --- a/composer.json +++ b/composer.json @@ -156,10 +156,13 @@ "predis/predis": "Required to use the predis connector (^1.1.9).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^5.4).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", - "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)." + "symfony/amazon-mailer": "Required to enable support for the SES mail transport (^6.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^6.0).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.0).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.0).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.0).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." }, "config": { "sort-packages": true From 6652b0ee1c01f7139b7df0375e747af90ae43b90 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 8 Dec 2021 07:04:28 -0600 Subject: [PATCH 3/3] formatting --- src/Illuminate/Broadcasting/BroadcastManager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Broadcasting/BroadcastManager.php b/src/Illuminate/Broadcasting/BroadcastManager.php index ba7a0f14745b..68ab16856c7e 100644 --- a/src/Illuminate/Broadcasting/BroadcastManager.php +++ b/src/Illuminate/Broadcasting/BroadcastManager.php @@ -219,7 +219,9 @@ protected function createPusherDriver(array $config) $config['secret'], $config['app_id'], $config['options'] ?? [], - new GuzzleClient($config['client_options'] ?? []), + isset($config['client_options']) && ! empty($config['client_options']) + ? new GuzzleClient($config['client_options']) + : null, ); if ($config['log'] ?? false) {