@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | // push message to designated fds |
168 | 168 | foreach ($push->getDescriptors() as $descriptor) { |
169 | - if ($server->exist($descriptor) || !$push->isBroadcastToDescriptor((int)$descriptor)) { |
|
169 | + if ($server->exist($descriptor) || !$push->isBroadcastToDescriptor((int) $descriptor)) { |
|
170 | 170 | $server->push($descriptor, $payload, $push->getOpcode()); |
171 | 171 | } |
172 | 172 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | protected function filterWebsocket(array $descriptors): array |
234 | 234 | { |
235 | - $callback = function ($descriptor) { |
|
235 | + $callback = function($descriptor) { |
|
236 | 236 | return $this->isWebsocket($descriptor); |
237 | 237 | }; |
238 | 238 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | */ |
296 | 296 | protected function bindRoom(): void |
297 | 297 | { |
298 | - $this->app->singleton(RoomContract::class, function (Container $container) { |
|
298 | + $this->app->singleton(RoomContract::class, function(Container $container) { |
|
299 | 299 | $driver = $container->make('config')->get('swoole_websocket.default'); |
300 | 300 | $settings = $container->make('config')->get("swoole_websocket.settings.{$driver}"); |
301 | 301 | $className = $container->make('config')->get("swoole_websocket.drivers.{$driver}"); |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | protected function bindWebsocket() |
313 | 313 | { |
314 | - $this->app->singleton(Websocket::class, function (Container $app) { |
|
314 | + $this->app->singleton(Websocket::class, function(Container $app) { |
|
315 | 315 | return new Websocket($app->make('swoole.room'), new Pipeline($app)); |
316 | 316 | }); |
317 | 317 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | protected function bindSwooleTable() |
59 | 59 | { |
60 | 60 | if (!$this->app instanceof ConsoleApp) { |
61 | - $this->app->singleton(SwooleTable::class, function () { |
|
61 | + $this->app->singleton(SwooleTable::class, function() { |
|
62 | 62 | return $this->table; |
63 | 63 | }); |
64 | 64 |
@@ -289,7 +289,7 @@ |
||
289 | 289 | $path = $this->getPidPath(); |
290 | 290 | |
291 | 291 | return $this->pid = file_exists($path) |
292 | - ? (int)file_get_contents($path) ?? $this->removePidFile() |
|
292 | + ? (int) file_get_contents($path) ?? $this->removePidFile() |
|
293 | 293 | : null; |
294 | 294 | } |
295 | 295 |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if (!method_exists($variable, '__toString')) { |
110 | 110 | return false; |
111 | 111 | } else { |
112 | - $variable = (string)$variable; |
|
112 | + $variable = (string) $variable; |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | break; |
207 | 207 | case PDO::FETCH_OBJ: |
208 | 208 | foreach ($rawData as $row) { |
209 | - $resultSet[] = (object)$row; |
|
209 | + $resultSet[] = (object) $row; |
|
210 | 210 | } |
211 | 211 | break; |
212 | 212 | case PDO::FETCH_NUM: |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $this->__executeWhenStringQueryEmpty(); |
228 | 228 | |
229 | 229 | $cursorOrientation = \is_null($cursorOrientation) ? PDO::FETCH_ORI_NEXT : $cursorOrientation; |
230 | - $cursorOffset = \is_null($cursorOffset) ? 0 : (int)$cursorOffset; |
|
230 | + $cursorOffset = \is_null($cursorOffset) ? 0 : (int) $cursorOffset; |
|
231 | 231 | |
232 | 232 | switch ($cursorOrientation) { |
233 | 233 | case PDO::FETCH_ORI_ABS: |
@@ -253,7 +253,7 @@ |
||
253 | 253 | if (strpos($statement, ':') !== false) { |
254 | 254 | $i = 0; |
255 | 255 | $bindKeyMap = []; |
256 | - $statement = preg_replace_callback('/:(\w+)\b/', function ($matches) use (&$i, &$bindKeyMap) { |
|
256 | + $statement = preg_replace_callback('/:(\w+)\b/', function($matches) use (&$i, &$bindKeyMap) { |
|
257 | 257 | $bindKeyMap[$matches[1]] = $i++; |
258 | 258 | |
259 | 259 | return '?'; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | protected function registerManager() |
19 | 19 | { |
20 | - $this->app->singleton('swoole.manager', function ($app) { |
|
20 | + $this->app->singleton('swoole.manager', function($app) { |
|
21 | 21 | return new Manager($app, 'laravel'); |
22 | 22 | }); |
23 | 23 | } |
@@ -229,7 +229,7 @@ |
||
229 | 229 | } else if ($response instanceof SymfonyResponse) { |
230 | 230 | $content = $response->getContent(); |
231 | 231 | } else if (!$isFile = $response instanceof BinaryFileResponse) { |
232 | - $content = (string)$response; |
|
232 | + $content = (string) $response; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | // process terminating logics |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | foreach ($this->events as $event) { |
106 | 106 | $listener = Str::camel("on_$event"); |
107 | - $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) { |
|
107 | + $callback = method_exists($this, $listener) ? [$this, $listener] : function() use ($event) { |
|
108 | 108 | $this->container->make('events')->fire("swoole.$event", func_get_args()); |
109 | 109 | }; |
110 | 110 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | */ |
300 | 300 | protected function bindSandbox() |
301 | 301 | { |
302 | - $this->app->singleton(Sandbox::class, function ($app) { |
|
302 | + $this->app->singleton(Sandbox::class, function($app) { |
|
303 | 303 | return new Sandbox($app, $this->framework); |
304 | 304 | }); |
305 | 305 |