From e6734ab62a4542302152d86fbc068ec2839f1d31 Mon Sep 17 00:00:00 2001 From: Matthew Kilgore Date: Sat, 25 Jul 2020 21:10:33 -0400 Subject: [PATCH] Replace depreciated helper function with classfull one --- extensions/pusher/src/Api/Controller/AuthController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/pusher/src/Api/Controller/AuthController.php b/extensions/pusher/src/Api/Controller/AuthController.php index 914a29b0a..0ce7bcf66 100644 --- a/extensions/pusher/src/Api/Controller/AuthController.php +++ b/extensions/pusher/src/Api/Controller/AuthController.php @@ -10,6 +10,7 @@ namespace Flarum\Pusher\Api\Controller; use Flarum\Settings\SettingsRepositoryInterface; +use Illuminate\Support\Arr; use Laminas\Diactoros\Response\EmptyResponse; use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface; @@ -41,7 +42,7 @@ class AuthController implements RequestHandlerInterface $userChannel = 'private-user'.$request->getAttribute('actor')->id; $body = $request->getParsedBody(); - if (array_get($body, 'channel_name') === $userChannel) { + if (Arr::get($body, 'channel_name') === $userChannel) { $pusher = new Pusher( $this->settings->get('flarum-pusher.app_key'), $this->settings->get('flarum-pusher.app_secret'), @@ -49,7 +50,7 @@ class AuthController implements RequestHandlerInterface ['cluster' => $this->settings->get('flarum-pusher.app_cluster')] ); - $payload = json_decode($pusher->socket_auth($userChannel, array_get($body, 'socket_id')), true); + $payload = json_decode($pusher->socket_auth($userChannel, Arr::get($body, 'socket_id')), true); return new JsonResponse($payload); }