Completed
Branch feature/coroutine_feature (d624ea)
by Albert
02:17
created
src/Server/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 /**
4 4
  * This is only for `function not exists` in config/swoole_http.php.
5 5
  */
6
-if (! function_exists('swoole_cpu_num')) {
6
+if (!function_exists('swoole_cpu_num')) {
7 7
     function swoole_cpu_num()
8 8
     {
9 9
         return;
Please login to merge, or discard this patch.
src/Controllers/SocketIOController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
     public function upgrade(Request $request)
12 12
     {
13
-        if (! in_array($request->input('transport'), $this->transports)) {
13
+        if (!in_array($request->input('transport'), $this->transports)) {
14 14
             return response()->json([
15 15
                 'code' => 0,
16 16
                 'message' => 'Transport unknown'
Please login to merge, or discard this patch.
src/Websocket/Rooms/RedisRoom.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $this->checkTable($table);
92 92
         $redisKey = $this->getKey($key, $table);
93 93
 
94
-        $this->redis->pipeline(function ($pipe) use ($redisKey, $values) {
94
+        $this->redis->pipeline(function($pipe) use ($redisKey, $values) {
95 95
             foreach ($values as $value) {
96 96
                 $pipe->sadd($redisKey, $value);
97 97
             }
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $this->checkTable($table);
106 106
         $redisKey = $this->getKey($key, $table);
107 107
 
108
-        $this->redis->pipeline(function ($pipe) use ($redisKey, $values) {
108
+        $this->redis->pipeline(function($pipe) use ($redisKey, $values) {
109 109
             foreach ($values as $value) {
110 110
                 $pipe->srem($redisKey, $value);
111 111
             }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
     protected function checkTable(string $table)
128 128
     {
129
-        if (! in_array($table, ['rooms', 'fds'])) {
129
+        if (!in_array($table, ['rooms', 'fds'])) {
130 130
             throw new \InvalidArgumentException('invalid table name.');
131 131
         }
132 132
     }
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
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         foreach ($rooms as $room) {
56 56
             $fds = $this->getClients($room);
57 57
 
58
-            if (! in_array($fd, $fds)) {
58
+            if (!in_array($fd, $fds)) {
59 59
                 continue;
60 60
             }
61 61
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
     protected function checkTable(string $table)
124 124
     {
125
-        if (! property_exists($this, $table) || ! $this->$table instanceof Table) {
125
+        if (!property_exists($this, $table) || !$this->$table instanceof Table) {
126 126
             throw new \InvalidArgumentException('invalid table name.');
127 127
         }
128 128
     }
Please login to merge, or discard this patch.
src/Websocket/SocketIO/Packet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
     {
108 108
         $type = $packet[0] ?? null;
109 109
 
110
-        if (! array_key_exists($type, static::$socketTypes)) {
110
+        if (!array_key_exists($type, static::$socketTypes)) {
111 111
             return null;
112 112
         }
113 113
 
Please login to merge, or discard this patch.
src/Websocket/SocketIO/WebsocketHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     public function onOpen($fd, Request $request)
20 20
     {
21
-        if (! $request->input('sid')) {
21
+        if (!$request->input('sid')) {
22 22
             $payload = json_encode([
23 23
                 'sid' => base64_encode(uniqid()),
24 24
                 'upgrades' => [],
Please login to merge, or discard this patch.
src/Websocket/Authenticatable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $users = is_object($users) ? func_get_args() : $users;
46 46
 
47
-        $userIds = array_map(function ($user) {
47
+        $userIds = array_map(function($user) {
48 48
             $this->checkUser($user);
49 49
             return $user->getAuthIdentifier();
50 50
         }, $users);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function getUserId()
74 74
     {
75
-        if (! is_null($this->userId)) {
75
+        if (!is_null($this->userId)) {
76 76
             return $this->userId;
77 77
         }
78 78
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function isUserIdOnline($userId)
94 94
     {
95
-        return ! empty($this->room->getClients(static::USER_PREFIX . $userId));
95
+        return !empty($this->room->getClients(static::USER_PREFIX . $userId));
96 96
     }
97 97
 
98 98
     /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      */
101 101
     protected function checkUser($user)
102 102
     {
103
-        if (! $user instanceOf AuthenticatableContract) {
103
+        if (!$user instanceOf AuthenticatableContract) {
104 104
             throw new InvalidArgumentException('user object must implement ' . AuthenticatableContract::class);
105 105
         }
106 106
     }
Please login to merge, or discard this patch.
src/Websocket/Middleware/StartSession.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     protected function startSession(Request $request)
55 55
     {
56
-        return tap($this->getSession($request), function ($session) use ($request) {
56
+        return tap($this->getSession($request), function($session) use ($request) {
57 57
             $session->setRequestOnHandler($request);
58 58
 
59 59
             $session->start();
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     public function getSession(Request $request)
70 70
     {
71
-        return tap($this->manager->driver(), function ($session) use ($request) {
71
+        return tap($this->manager->driver(), function($session) use ($request) {
72 72
             $session->setId($request->cookies->get($session->getName()));
73 73
         });
74 74
     }
@@ -80,6 +80,6 @@  discard block
 block discarded – undo
80 80
      */
81 81
     protected function sessionConfigured()
82 82
     {
83
-        return ! is_null($this->manager->getSessionConfig()['driver'] ?? null);
83
+        return !is_null($this->manager->getSessionConfig()['driver'] ?? null);
84 84
     }
85 85
 }
Please login to merge, or discard this patch.
src/Websocket/Middleware/Authenticate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     {
40 40
         try {
41 41
             if ($user = $this->auth->authenticate()) {
42
-                $request->setUserResolver(function () use ($user) {
42
+                $request->setUserResolver(function() use ($user) {
43 43
                     return $user;
44 44
                 });
45 45
             }
Please login to merge, or discard this patch.