@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $options = $config->get('swoole_http.server.options'); |
| 150 | 150 | |
| 151 | 151 | // only enable task worker in websocket mode and for queue driver |
| 152 | - if ($config->get('queue.default') !== 'swoole' && ! $this->isWebsocket) { |
|
| 152 | + if ($config->get('queue.default') !== 'swoole' && !$this->isWebsocket) { |
|
| 153 | 153 | unset($options['task_worker_num']); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | protected function registerServer() |
| 165 | 165 | { |
| 166 | - $this->app->singleton(Server::class, function () { |
|
| 166 | + $this->app->singleton(Server::class, function() { |
|
| 167 | 167 | if (is_null(static::$server)) { |
| 168 | 168 | $this->createSwooleServer(); |
| 169 | 169 | $this->configureSwooleServer(); |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | protected function registerDatabaseDriver() |
| 181 | 181 | { |
| 182 | - $this->app->extend(DatabaseManager::class, function (DatabaseManager $db) { |
|
| 183 | - $db->extend('mysql-coroutine', function ($config, $name) { |
|
| 182 | + $this->app->extend(DatabaseManager::class, function(DatabaseManager $db) { |
|
| 183 | + $db->extend('mysql-coroutine', function($config, $name) { |
|
| 184 | 184 | $config['name'] = $name; |
| 185 | 185 | |
| 186 | 186 | $connection = new MySqlConnection( |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | protected function registerSwooleQueueDriver() |
| 225 | 225 | { |
| 226 | - $this->app->afterResolving('queue', function (QueueManager $manager) { |
|
| 227 | - $manager->addConnector('swoole', function () { |
|
| 226 | + $this->app->afterResolving('queue', function(QueueManager $manager) { |
|
| 227 | + $manager->addConnector('swoole', function() { |
|
| 228 | 228 | return new SwooleTaskConnector($this->app->make(Server::class)); |
| 229 | 229 | }); |
| 230 | 230 | }); |