@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $this->client->connect($options); |
58 | 58 | |
59 | - if (! $this->client->connected) { |
|
59 | + if (!$this->client->connected) { |
|
60 | 60 | $message = $this->client->connect_error ?: $this->client->error; |
61 | 61 | $errorCode = $this->client->connect_errno ?: $this->client->errno; |
62 | 62 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | public static function checkDriver(string $driver) |
103 | 103 | { |
104 | - if (! in_array($driver, static::getAvailableDrivers())) { |
|
104 | + if (!in_array($driver, static::getAvailableDrivers())) { |
|
105 | 105 | throw new \InvalidArgumentException("{$driver} driver is not supported yet."); |
106 | 106 | } |
107 | 107 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | public function commit() |
127 | 127 | { |
128 | 128 | $this->client->commit(); |
129 | - $this->inTransaction = false;//TODO I think it's sample to rollback, please confirm it |
|
129 | + $this->inTransaction = false; //TODO I think it's sample to rollback, please confirm it |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | public function inTransaction() |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $bindKeyMap = []; |
186 | 186 | $statement = preg_replace_callback( |
187 | 187 | '/:(\w+)\b/', |
188 | - function ($matches) use (&$i, &$bindKeyMap) { |
|
188 | + function($matches) use (&$i, &$bindKeyMap) { |
|
189 | 189 | $bindKeyMap[$matches[1]] = $i++; |
190 | 190 | |
191 | 191 | return '?'; |
@@ -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(); |
@@ -163,15 +163,15 @@ discard block |
||
163 | 163 | */ |
164 | 164 | protected function registerDatabaseDriver() |
165 | 165 | { |
166 | - $this->app->extend('db', function ($db) { |
|
167 | - $db->extend('mysql-coroutine', function ($config, $name) { |
|
166 | + $this->app->extend('db', function($db) { |
|
167 | + $db->extend('mysql-coroutine', function($config, $name) { |
|
168 | 168 | $config['name'] = $name; |
169 | 169 | |
170 | 170 | if (isset($config['read'])) { |
171 | 171 | $config = array_merge($config, $config['read']); |
172 | 172 | } |
173 | 173 | |
174 | - $connectionRead = function () use ($config) { |
|
174 | + $connectionRead = function() use ($config) { |
|
175 | 175 | return (new MySqlConnector())->connect($config); |
176 | 176 | }; |
177 | 177 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $config = array_merge($config, $config['write']); |
180 | 180 | } |
181 | 181 | |
182 | - $connection = function () use ($config) { |
|
182 | + $connection = function() use ($config) { |
|
183 | 183 | return (new MySqlConnector())->connect($config); |
184 | 184 | }; |
185 | 185 | |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | */ |
201 | 201 | protected function registerSwooleQueueDriver() |
202 | 202 | { |
203 | - $this->app->afterResolving('queue', function ($manager) { |
|
204 | - $manager->addConnector('swoole', function () { |
|
203 | + $this->app->afterResolving('queue', function($manager) { |
|
204 | + $manager->addConnector('swoole', function() { |
|
205 | 205 | return new SwooleTaskConnector($this->app->make(Server::class)); |
206 | 206 | }); |
207 | 207 | }); |