Completed
Branch master (45ae24)
by Shiyu
02:53
created
Category
src/Server.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         return new NVServer(
51 51
             $serviced,
52 52
             $listen,
53
-            (new Events)->attach(Events\HTTP::REQUESTING, function (Connection $conn) use ($processor) {
53
+            (new Events)->attach(Events\HTTP::REQUESTING, function(Connection $conn) use ($processor) {
54 54
                 try {
55 55
                     $processor($conn);
56 56
                 } catch (Throwable $e) {
Please login to merge, or discard this patch.
src/Client.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
     public function perform(Request $request, Promised $canceller = null) : Promised
90 90
     {
91 91
         if ($this->options->pooled()) {
92
-            return async(function () use ($request, $canceller) {
92
+            return async(function() use ($request, $canceller) {
93 93
                 if ($canceller) {
94 94
                     $interrupt = Promise::deferred();
95
-                    $canceller->then(static function () use ($interrupt) {
96
-                        $interrupt->then(static function (SWClient $client) {
95
+                    $canceller->then(static function() use ($interrupt) {
96
+                        $interrupt->then(static function(SWClient $client) {
97 97
                             return $client->close();
98 98
                         });
99 99
                         $interrupt->resolve();
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
             });
110 110
         }
111 111
 
112
-        return async(function () use ($request, $canceller) {
112
+        return async(function() use ($request, $canceller) {
113 113
             /**
114 114
              * @var SWClient $client
115 115
              */
116 116
             $this->session = $client = yield $this->http($this->remote($request->getUri()), false);
117 117
 
118
-            $canceller && $canceller->then(static function () use ($client) {
118
+            $canceller && $canceller->then(static function() use ($client) {
119 119
                 return $client->close();
120 120
             });
121 121
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function keepalived(Closure $initialize) : void
156 156
     {
157
-        ($this->ka ?? $this->ka = Promise::deferred())->then(function () use ($initialize) {
157
+        ($this->ka ?? $this->ka = Promise::deferred())->then(function() use ($initialize) {
158 158
             $initialize($this->pool);
159 159
         });
160 160
     }
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
             return $this->pool;
170 170
         }
171 171
 
172
-        $this->pool = new Pool($this->options->pooling(), function () use ($remote) {
172
+        $this->pool = new Pool($this->options->pooling(), function() use ($remote) {
173 173
             return $this->http($remote, true);
174 174
         }, $this->options->identify());
175 175
 
176
-        $this->pool->closed()->then(function () {
176
+        $this->pool->closed()->then(function() {
177 177
             $this->pool = null;
178 178
         });
179 179
 
Please login to merge, or discard this patch.
src/Powered/Native/Server.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function serve() : void
85 85
     {
86
-        swoole_event_add($this->listener, function ($server) {
86
+        swoole_event_add($this->listener, function($server) {
87 87
             $this->incoming($server);
88 88
         });
89 89
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     private function incoming($server) : void
135 135
     {
136 136
         $idx = $this->idx += 1;
137
-        swoole_event_add($this->fds[$idx] = stream_socket_accept($server), function () use ($idx) {
137
+        swoole_event_add($this->fds[$idx] = stream_socket_accept($server), function() use ($idx) {
138 138
             $this->receiving($idx);
139 139
         });
140 140
     }
Please login to merge, or discard this patch.
src/Powered/Swoole/Client.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
             $this->http->set($pxc);
91 91
         }
92 92
 
93
-        $this->http->on('connect', function () {
93
+        $this->http->on('connect', function() {
94 94
             $this->http->on('error', [$this, 'failure']);
95 95
             $this->http->on('close', [$this, 'closing']);
96 96
         });
Please login to merge, or discard this patch.
src/Powered/Swoole/Chips/Throws.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     private function throwing(Request $request, SWHClient $c) : void
32 32
     {
33
-        $url = (string) $request->getUri();
33
+        $url = (string)$request->getUri();
34 34
 
35 35
         switch ($c->statusCode) {
36 36
             case -1:
Please login to merge, or discard this patch.
src/Powered/Swoole/Chips/Http.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
         // -- net sender
35 35
 
36
-        $executor = function ($fn) use ($http, $request) {
36
+        $executor = function($fn) use ($http, $request) {
37 37
             $uri = $this->getUriPath($request->getUri());
38 38
 
39 39
             $stream = $request->getBody();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         // -- net receiver
57 57
 
58
-        $receiver = function (SWHClient $c) use ($request) {
58
+        $receiver = function(SWHClient $c) use ($request) {
59 59
             $code = $c->statusCode;
60 60
             $headers = (array)$c->headers;
61 61
             $response = $c->body;
Please login to merge, or discard this patch.
src/Powered/Swoole/Chips/Socket.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
         // -- message event
90 90
 
91
-        $http->on('message', static function (SWHClient $c, SWSFrame $f) use ($framing, $socket) {
91
+        $http->on('message', static function(SWHClient $c, SWSFrame $f) use ($framing, $socket) {
92 92
             switch ($f->opcode) {
93 93
                 case WSOpcode::CLOSING:
94 94
                     $socket->sv(false);
@@ -99,20 +99,20 @@  discard block
 block discarded – undo
99 99
             }
100 100
         });
101 101
 
102
-        $http->on('close', static function (SWHClient $c) use ($framing, $socket) {
102
+        $http->on('close', static function(SWHClient $c) use ($framing, $socket) {
103 103
             $socket->sv(false);
104 104
             $framing->message()->close();
105 105
         });
106 106
 
107 107
         // -- socket dial
108 108
 
109
-        $connector = function ($fn) use ($http, $request) {
109
+        $connector = function($fn) use ($http, $request) {
110 110
             $http->upgrade($this->getUriPath($request->getUri()), $fn);
111 111
         };
112 112
 
113 113
         // -- socket resp
114 114
 
115
-        $response = function (SWHClient $c) use ($request, $framing, $socket) {
115
+        $response = function(SWHClient $c) use ($request, $framing, $socket) {
116 116
             $code = $c->statusCode;
117 117
 
118 118
             if ($code === 101) {
Please login to merge, or discard this patch.
src/Client/Options/Proxy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      */
23 23
     public function hasProxy() : bool
24 24
     {
25
-        return ! empty($this->proxy);
25
+        return !empty($this->proxy);
26 26
     }
27 27
 
28 28
     /**
Please login to merge, or discard this patch.
src/Client/Persistent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@
 block discarded – undo
48 48
                 new Address($host, $port)
49 49
             );
50 50
 
51
-            $cli->keepalived(static function (Pool $pool) use ($pk) {
52
-                $pool->closed()->then(function () use ($pk) {
51
+            $cli->keepalived(static function(Pool $pool) use ($pk) {
52
+                $pool->closed()->then(function() use ($pk) {
53 53
                     unset(self::$keeps[$pk]);
54 54
                 });
55 55
             });
Please login to merge, or discard this patch.