Passed
Pull Request — master (#544)
by Kauan
10:59
created
src/HotReload/FSProcess.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function make(?callable $callback = null)
64 64
     {
65
-        $mcb = function ($type, $buffer) use ($callback) {
66
-            if (! $this->locked && AppProcess::OUT === $type && $event = FSEventParser::toEvent($buffer)) {
65
+        $mcb = function($type, $buffer) use ($callback) {
66
+            if (!$this->locked && AppProcess::OUT === $type && $event = FSEventParser::toEvent($buffer)) {
67 67
                 $this->locked = true;
68 68
                 ($callback) ? $callback($event) : null;
69 69
                 $this->locked = false;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             }
72 72
         };
73 73
 
74
-        return new SwooleProcess(function () use ($mcb) {
74
+        return new SwooleProcess(function() use ($mcb) {
75 75
             (new AppProcess($this->configure()))->setTimeout(0)->run($mcb);
76 76
         }, false, false);
77 77
     }
Please login to merge, or discard this patch.
src/Concerns/InteractsWithSwooleQueue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      */
15 15
     protected function isSwooleQueuePacket($packet)
16 16
     {
17
-        if (! is_string($packet)) {
17
+        if (!is_string($packet)) {
18 18
             return false;
19 19
         }
20 20
 
Please login to merge, or discard this patch.
src/Websocket/Rooms/RedisRoom.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function setRedis(?RedisClient $redis = null)
59 59
     {
60
-        if (! $redis) {
60
+        if (!$redis) {
61 61
             $server = Arr::get($this->config, 'server', []);
62 62
             $options = Arr::get($this->config, 'options', []);
63 63
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         $this->checkTable($table);
140 140
         $redisKey = $this->getKey($key, $table);
141 141
 
142
-        $this->redis->pipeline(function (Pipeline $pipe) use ($redisKey, $values) {
142
+        $this->redis->pipeline(function(Pipeline $pipe) use ($redisKey, $values) {
143 143
             foreach ($values as $value) {
144 144
                 $pipe->sadd($redisKey, $value);
145 145
             }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $this->checkTable($table);
163 163
         $redisKey = $this->getKey($key, $table);
164 164
 
165
-        $this->redis->pipeline(function (Pipeline $pipe) use ($redisKey, $values) {
165
+        $this->redis->pipeline(function(Pipeline $pipe) use ($redisKey, $values) {
166 166
             foreach ($values as $value) {
167 167
                 $pipe->srem($redisKey, $value);
168 168
             }
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
      */
203 203
     protected function checkTable(string $table)
204 204
     {
205
-        if (! in_array($table, [RoomContract::ROOMS_KEY, RoomContract::DESCRIPTORS_KEY])) {
205
+        if (!in_array($table, [RoomContract::ROOMS_KEY, RoomContract::DESCRIPTORS_KEY])) {
206 206
             throw new \InvalidArgumentException("Invalid table name: `{$table}`.");
207 207
         }
208 208
     }
Please login to merge, or discard this patch.
src/Websocket/Rooms/TableRoom.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         foreach ($rooms as $room) {
88 88
             $fds = $this->getClients($room);
89 89
 
90
-            if (! in_array($fd, $fds)) {
90
+            if (!in_array($fd, $fds)) {
91 91
                 continue;
92 92
             }
93 93
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
      */
207 207
     protected function checkTable(string $table)
208 208
     {
209
-        if (! property_exists($this, $table) || ! $this->$table instanceof Table) {
209
+        if (!property_exists($this, $table) || !$this->$table instanceof Table) {
210 210
             throw new \InvalidArgumentException("Invalid table name: `{$table}`.");
211 211
         }
212 212
     }
Please login to merge, or discard this patch.
copy_versioned_files.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require __DIR__.'/vendor/autoload.php';
3
+require __DIR__ . '/vendor/autoload.php';
4 4
 
5 5
 use SwooleTW\Http\Helpers\FW;
6 6
 use SwooleTW\Http\Task\QueueFactory;
Please login to merge, or discard this patch.
src/Helpers/Dumper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
     public static function dump(...$args)
14 14
     {
15
-        if (! static::$cloner instanceOf VarCloner) {
15
+        if (!static::$cloner instanceOf VarCloner) {
16 16
             static::$cloner = new VarCloner;
17 17
         }
18 18
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     public static function getDumper()
31 31
     {
32
-        $dumper = defined('IN_PHPUNIT') || ! config('swoole_http.ob_output')
32
+        $dumper = defined('IN_PHPUNIT') || !config('swoole_http.ob_output')
33 33
             ? CliDumper::class
34 34
             : HtmlDumper::class;
35 35
 
Please login to merge, or discard this patch.
src/LumenServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      */
18 18
     protected function registerManager()
19 19
     {
20
-        $this->app->singleton(Manager::class, function ($app) {
20
+        $this->app->singleton(Manager::class, function($app) {
21 21
             return new Manager($app, 'lumen');
22 22
         });
23 23
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     protected function bootWebsocketRoutes()
33 33
     {
34 34
         $this->app->router
35
-            ->group(['namespace' => 'SwooleTW\Http\Controllers'], function ($router) {
35
+            ->group(['namespace' => 'SwooleTW\Http\Controllers'], function($router) {
36 36
                 require __DIR__ . '/../routes/lumen_routes.php';
37 37
             });
38 38
     }
Please login to merge, or discard this patch.
src/Websocket/Pusher.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      */
210 210
     public function shouldBroadcast(): bool
211 211
     {
212
-        return $this->broadcast && empty($this->descriptors) && ! $this->assigned;
212
+        return $this->broadcast && empty($this->descriptors) && !$this->assigned;
213 213
     }
214 214
 
215 215
     /**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
      */
222 222
     protected function getWebsocketConnections(): array
223 223
     {
224
-        return array_filter(iterator_to_array($this->server->connections), function ($fd) {
224
+        return array_filter(iterator_to_array($this->server->connections), function($fd) {
225 225
             return $this->server->isEstablished($fd);
226 226
         });
227 227
     }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     public function shouldPushToDescriptor(int $fd): bool
235 235
     {
236
-        if (! $this->server->isEstablished($fd)) {
236
+        if (!$this->server->isEstablished($fd)) {
237 237
             return false;
238 238
         }
239 239
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
     public function push($payload): void
251 251
     {
252 252
         // attach sender if not broadcast
253
-        if (! $this->broadcast && $this->sender && ! $this->hasDescriptor($this->sender)) {
253
+        if (!$this->broadcast && $this->sender && !$this->hasDescriptor($this->sender)) {
254 254
             $this->addDescriptor($this->sender);
255 255
         }
256 256
 
Please login to merge, or discard this patch.
src/Server/PidManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@
 block discarded – undo
30 30
      */
31 31
     public function write(int $masterPid, int $managerPid): void
32 32
     {
33
-        if (! is_writable($this->pidFile)
34
-            && ! is_writable(dirname($this->pidFile))
33
+        if (!is_writable($this->pidFile)
34
+            && !is_writable(dirname($this->pidFile))
35 35
         ) {
36 36
             throw new \RuntimeException(
37 37
                 sprintf('Pid file "%s" is not writable', $this->pidFile)
Please login to merge, or discard this patch.