@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $providers = $this->config->get('swoole_http.providers', []); |
| 49 | 49 | |
| 50 | 50 | foreach ($providers as $provider) { |
| 51 | - if (class_exists($provider) && ! in_array($provider, $this->providers)) { |
|
| 51 | + if (class_exists($provider) && !in_array($provider, $this->providers)) { |
|
| 52 | 52 | $providerClass = new $provider($app); |
| 53 | 53 | $this->providers[$provider] = $providerClass; |
| 54 | 54 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | foreach ($resetters as $resetter) { |
| 75 | 75 | $resetterClass = $app->make($resetter); |
| 76 | - if (! $resetterClass instanceof ResetterContract) { |
|
| 76 | + if (!$resetterClass instanceof ResetterContract) { |
|
| 77 | 77 | throw new SandboxException("{$resetter} must implement " . ResetterContract::class); |
| 78 | 78 | } |
| 79 | 79 | $this->resetters[$resetter] = $resetterClass; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $options = $config->get('swoole_http.server.options'); |
| 131 | 131 | |
| 132 | 132 | // only enable task worker in websocket mode and for queue driver |
| 133 | - if ($config->get('queue.default') !== 'swoole' && ! $this->isWebsocket) { |
|
| 133 | + if ($config->get('queue.default') !== 'swoole' && !$this->isWebsocket) { |
|
| 134 | 134 | unset($config['task_worker_num']); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | protected function registerServer() |
| 146 | 146 | { |
| 147 | - $this->app->singleton(Server::class, function () { |
|
| 147 | + $this->app->singleton(Server::class, function() { |
|
| 148 | 148 | if (is_null(static::$server)) { |
| 149 | 149 | $this->createSwooleServer(); |
| 150 | 150 | $this->configureSwooleServer(); |
@@ -159,10 +159,10 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | protected function registerDatabaseDriver() |
| 161 | 161 | { |
| 162 | - $this->app->resolving('db', function ($db) { |
|
| 163 | - $db->extend('mysql-coroutine', function ($config, $name) { |
|
| 162 | + $this->app->resolving('db', function($db) { |
|
| 163 | + $db->extend('mysql-coroutine', function($config, $name) { |
|
| 164 | 164 | $config['name'] = $name; |
| 165 | - $connection = function () use ($config) { |
|
| 165 | + $connection = function() use ($config) { |
|
| 166 | 166 | return (new MySqlConnector())->connect($config); |
| 167 | 167 | }; |
| 168 | 168 | |
@@ -181,8 +181,8 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | protected function registerSwooleQueueDriver() |
| 183 | 183 | { |
| 184 | - $this->app->afterResolving('queue', function ($manager) { |
|
| 185 | - $manager->addConnector('swoole', function () { |
|
| 184 | + $this->app->afterResolving('queue', function($manager) { |
|
| 185 | + $manager->addConnector('swoole', function() { |
|
| 186 | 186 | return new SwooleTaskConnector($this->app->make(Server::class)); |
| 187 | 187 | }); |
| 188 | 188 | }); |