@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function boot(BroadcastManager $broadcastManager) |
| 19 | 19 | { |
| 20 | - $broadcastManager->extend('centrifugo', function ($app) { |
|
| 20 | + $broadcastManager->extend('centrifugo', function($app) { |
|
| 21 | 21 | return new CentrifugoBroadcaster($app->make('centrifugo')); |
| 22 | 22 | }); |
| 23 | 23 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function register() |
| 31 | 31 | { |
| 32 | - $this->app->singleton('centrifugo', function ($app) { |
|
| 32 | + $this->app->singleton('centrifugo', function($app) { |
|
| 33 | 33 | $config = $app->make('config')->get('broadcasting.connections.centrifugo'); |
| 34 | 34 | $http = new HttpClient(); |
| 35 | 35 | |
@@ -87,13 +87,13 @@ |
||
| 87 | 87 | public function broadcast(array $channels, $event, array $payload = []) |
| 88 | 88 | { |
| 89 | 89 | $payload['event'] = $event; |
| 90 | - $channels = array_map(function ($channel) { |
|
| 90 | + $channels = array_map(function($channel) { |
|
| 91 | 91 | return str_replace('private-', '$', $channel); |
| 92 | 92 | }, $channels); |
| 93 | 93 | |
| 94 | 94 | $response = $this->centrifugo->broadcast($this->formatChannels($channels), $payload); |
| 95 | 95 | |
| 96 | - if (is_array($response) && ! isset($response['error'])) { |
|
| 96 | + if (is_array($response) && !isset($response['error'])) { |
|
| 97 | 97 | return; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function __construct(array $config = null, HttpClient $httpClient = null) |
| 33 | 33 | { |
| 34 | 34 | $this->httpClient = $httpClient ?? new HttpClient(); |
| 35 | - $this->config = $this->initConfiguration($config) ?? app()->make('config')->get('broadcasting.connections.centrifugo');; |
|
| 35 | + $this->config = $this->initConfiguration($config) ?? app()->make('config')->get('broadcasting.connections.centrifugo'); ; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -192,12 +192,12 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function generateConnectionToken(string $userId = '', $exp = 0, array $info = []): string |
| 194 | 194 | { |
| 195 | - if(gettype($exp) !== 'integer'){ |
|
| 195 | + if (gettype($exp) !== 'integer') { |
|
| 196 | 196 | $exp = $exp->unix(); |
| 197 | 197 | } |
| 198 | 198 | $header = ['typ' => 'JWT', 'alg' => 'HS256']; |
| 199 | 199 | $payload = ['sub' => $userId]; |
| 200 | - if (! empty($info)) { |
|
| 200 | + if (!empty($info)) { |
|
| 201 | 201 | $payload['info'] = $info; |
| 202 | 202 | } |
| 203 | 203 | if ($exp) { |
@@ -224,12 +224,12 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public function generatePrivateChannelToken(string $client, string $channel, $exp = 0, array $info = []): string |
| 226 | 226 | { |
| 227 | - if(gettype($exp) !== 'integer'){ |
|
| 227 | + if (gettype($exp) !== 'integer') { |
|
| 228 | 228 | $exp = $exp->unix(); |
| 229 | 229 | } |
| 230 | 230 | $header = ['typ' => 'JWT', 'alg' => 'HS256']; |
| 231 | 231 | $payload = ['channel' => $channel, 'client' => $client]; |
| 232 | - if (! empty($info)) { |
|
| 232 | + if (!empty($info)) { |
|
| 233 | 233 | $payload['info'] = $info; |
| 234 | 234 | } |
| 235 | 235 | if ($exp) { |
@@ -347,6 +347,6 @@ discard block |
||
| 347 | 347 | */ |
| 348 | 348 | public function showNodeInfo(): bool |
| 349 | 349 | { |
| 350 | - return (bool)$this->config['show_info']; |
|
| 350 | + return (bool) $this->config['show_info']; |
|
| 351 | 351 | } |
| 352 | 352 | } |