Skip to content

Commit b9ab427

Browse files
committed
formatting
1 parent 673e085 commit b9ab427

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/Illuminate/Broadcasting/BroadcastManager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public function routes(array $attributes = null)
6565
$attributes = $attributes ?: ['middleware' => ['web']];
6666

6767
$this->app['router']->group($attributes, function ($router) {
68-
$router->match(['post', 'get'], '/broadcasting/auth',
68+
$router->match(
69+
['get', 'post'], '/broadcasting/auth',
6970
'\\'.BroadcastController::class.'@authenticate'
7071
);
7172
});

src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,33 +62,34 @@ public function validAuthenticationResponse($request, $result)
6262
{
6363
if (Str::startsWith($request->channel_name, 'private')) {
6464
return $this->decodePusherResponse(
65-
$request,
66-
$this->pusher->socket_auth($request->channel_name, $request->socket_id)
65+
$request, $this->pusher->socket_auth($request->channel_name, $request->socket_id)
6766
);
6867
}
6968

7069
return $this->decodePusherResponse(
7170
$request,
7271
$this->pusher->presence_auth(
73-
$request->channel_name, $request->socket_id, $request->user()->getAuthIdentifier(), $result)
72+
$request->channel_name, $request->socket_id,
73+
$request->user()->getAuthIdentifier(), $result
74+
)
7475
);
7576
}
7677

7778
/**
78-
* Decode the given Pusher response, apply the callback for JSONP support.
79+
* Decode the given Pusher response.
7980
*
80-
* @param mixed $request
81+
* @param \Illuminate\Http\Request $request
8182
* @param mixed $response
8283
* @return array
8384
*/
8485
protected function decodePusherResponse($request, $response)
8586
{
86-
if ($request->callback) {
87-
return response()->json(json_decode($response, true))
88-
->withCallback($request->callback);
87+
if (! $request->callback) {
88+
return json_decode($response, true);
8989
}
9090

91-
return json_decode($response, true);
91+
return response()->json(json_decode($response, true))
92+
->withCallback($request->callback);
9293
}
9394

9495
/**

0 commit comments

Comments
 (0)