@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | protected function registerManager() |
| 21 | 21 | { |
| 22 | - $this->app->singleton(Manager::class, function ($app) { |
|
| 22 | + $this->app->singleton(Manager::class, function($app) { |
|
| 23 | 23 | return new Manager($app, 'laravel', base_path(), $this->app[PidManager::class]); |
| 24 | 24 | }); |
| 25 | 25 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | protected function registerManager() |
| 20 | 20 | { |
| 21 | - $this->app->singleton(Manager::class, function ($app) { |
|
| 21 | + $this->app->singleton(Manager::class, function($app) { |
|
| 22 | 22 | return new Manager($app, 'lumen', base_path(), $this->app[PidManager::class]); |
| 23 | 23 | }); |
| 24 | 24 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | protected function bootWebsocketRoutes() |
| 34 | 34 | { |
| 35 | 35 | $this->app->router |
| 36 | - ->group(['namespace' => 'SwooleTW\Http\Controllers'], function ($router) { |
|
| 36 | + ->group(['namespace' => 'SwooleTW\Http\Controllers'], function($router) { |
|
| 37 | 37 | require __DIR__ . '/../routes/lumen_routes.php'; |
| 38 | 38 | }); |
| 39 | 39 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | protected function stop() |
| 154 | 154 | { |
| 155 | - if (! $this->isRunning()) { |
|
| 155 | + if (!$this->isRunning()) { |
|
| 156 | 156 | $this->error("Failed! There is no swoole_http_server process running."); |
| 157 | 157 | |
| 158 | 158 | return; |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | protected function reload() |
| 194 | 194 | { |
| 195 | - if (! $this->isRunning()) { |
|
| 195 | + if (!$this->isRunning()) { |
|
| 196 | 196 | $this->error("Failed! There is no swoole_http_server process running."); |
| 197 | 197 | |
| 198 | 198 | return; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | $this->info('Reloading swoole_http_server...'); |
| 202 | 202 | |
| 203 | - if (! $this->killProcess(SIGUSR1)) { |
|
| 203 | + if (!$this->killProcess(SIGUSR1)) { |
|
| 204 | 204 | $this->error('> failure'); |
| 205 | 205 | |
| 206 | 206 | return; |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | { |
| 257 | 257 | $this->action = $this->argument('action'); |
| 258 | 258 | |
| 259 | - if (! in_array($this->action, ['start', 'stop', 'restart', 'reload', 'infos'], true)) { |
|
| 259 | + if (!in_array($this->action, ['start', 'stop', 'restart', 'reload', 'infos'], true)) { |
|
| 260 | 260 | $this->error( |
| 261 | 261 | "Invalid argument '{$this->action}'. Expected 'start', 'stop', 'restart', 'reload' or 'infos'." |
| 262 | 262 | ); |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $filter = Arr::get($this->config, 'hot_reload.filter'); |
| 278 | 278 | $log = Arr::get($this->config, 'hot_reload.log'); |
| 279 | 279 | |
| 280 | - $cb = function (FSEvent $event) use ($server, $log) { |
|
| 280 | + $cb = function(FSEvent $event) use ($server, $log) { |
|
| 281 | 281 | $log ? $this->info(FSOutput::format($event)) : null; |
| 282 | 282 | $server->reload(); |
| 283 | 283 | }; |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | $start = time(); |
| 331 | 331 | |
| 332 | 332 | do { |
| 333 | - if (! $this->isRunning()) { |
|
| 333 | + if (!$this->isRunning()) { |
|
| 334 | 334 | break; |
| 335 | 335 | } |
| 336 | 336 | |
@@ -360,13 +360,13 @@ discard block |
||
| 360 | 360 | exit(1); |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - if (! extension_loaded('swoole')) { |
|
| 363 | + if (!extension_loaded('swoole')) { |
|
| 364 | 364 | $this->error('Can\'t detect Swoole extension installed.'); |
| 365 | 365 | |
| 366 | 366 | exit(1); |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - if (! version_compare(swoole_version(), '4.3.1', 'ge')) { |
|
| 369 | + if (!version_compare(swoole_version(), '4.3.1', 'ge')) { |
|
| 370 | 370 | $this->error('Your Swoole version must be higher than `4.3.1`.'); |
| 371 | 371 | |
| 372 | 372 | exit(1); |
@@ -378,15 +378,15 @@ discard block |
||
| 378 | 378 | */ |
| 379 | 379 | protected function registerAccessLog() |
| 380 | 380 | { |
| 381 | - $this->laravel->singleton(OutputStyle::class, function () { |
|
| 381 | + $this->laravel->singleton(OutputStyle::class, function() { |
|
| 382 | 382 | return new OutputStyle($this->input, $this->output); |
| 383 | 383 | }); |
| 384 | 384 | |
| 385 | - $this->laravel->singleton(AccessOutput::class, function () { |
|
| 385 | + $this->laravel->singleton(AccessOutput::class, function() { |
|
| 386 | 386 | return new AccessOutput(new ConsoleOutput); |
| 387 | 387 | }); |
| 388 | 388 | |
| 389 | - $this->laravel->singleton(AccessLog::class, function (Container $container) { |
|
| 389 | + $this->laravel->singleton(AccessLog::class, function(Container $container) { |
|
| 390 | 390 | return new AccessLog($container->make(AccessOutput::class)); |
| 391 | 391 | }); |
| 392 | 392 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function write(int $masterPid, int $managerPid): void |
| 23 | 23 | { |
| 24 | - if (! is_writable($this->pidFile) && ! is_writable(dirname($this->pidFile))) { |
|
| 24 | + if (!is_writable($this->pidFile) && !is_writable(dirname($this->pidFile))) { |
|
| 25 | 25 | throw new \RuntimeException(sprintf('Pid file "%s" is not writable', $this->pidFile)); |
| 26 | 26 | } |
| 27 | 27 | |