Passed
Push — master ( 83432a...b15770 )
by Sam
04:56 queued 01:16
created
src/Header.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     protected function getAddresses()
133 133
     {
134
-        return $this->encodeAddress($this->sourceAddress, $this->protocol) . ($this->version == 1 ? " " : "") .$this->encodeAddress($this->targetAddress, $this->protocol);
134
+        return $this->encodeAddress($this->sourceAddress, $this->protocol) . ($this->version == 1 ? " " : "") . $this->encodeAddress($this->targetAddress, $this->protocol);
135 135
     }
136 136
 
137 137
     protected function encodePort($port, $protocol) {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
      */
221 221
     public static function parseHeader(&$data)
222 222
     {
223
-        foreach(self::$signatures as $version => $signature) {
223
+        foreach (self::$signatures as $version => $signature) {
224 224
             // Match.
225 225
             if (strncmp($data, $signature, strlen($signature)) === 0) {
226 226
                 if ($version === 1) {
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
         $protocol = substr($data, 13, 1);
264 264
 
265 265
         $pos = 16;
266
-        $sourceAddress = self::decodeAddress($version, substr($data, $pos, self::$lengths[$protocol] / 2  - 2), $protocol);
267
-        $pos += self::$lengths[$protocol] / 2  - 2;
268
-        $targetAddress = self::decodeAddress($version, substr($data, $pos, self::$lengths[$protocol] / 2  - 2), $protocol);
269
-        $pos += self::$lengths[$protocol] / 2  - 2;
266
+        $sourceAddress = self::decodeAddress($version, substr($data, $pos, self::$lengths[$protocol] / 2 - 2), $protocol);
267
+        $pos += self::$lengths[$protocol] / 2 - 2;
268
+        $targetAddress = self::decodeAddress($version, substr($data, $pos, self::$lengths[$protocol] / 2 - 2), $protocol);
269
+        $pos += self::$lengths[$protocol] / 2 - 2;
270 270
         $sourcePort = unpack('n', substr($data, $pos, 2))[1];
271 271
         $targetPort = unpack('n', substr($data, $pos + 2, 2))[1];
272 272
 
Please login to merge, or discard this patch.
src/Server.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,6 @@
 block discarded – undo
4 4
 namespace SamIT\Proxy;
5 5
 
6 6
 
7
-use React\Dns\Resolver\Factory;
8
-use React\Dns\Resolver\Resolver;
9 7
 use React\EventLoop\LoopInterface;
10 8
 use React\Socket\Connection;
11 9
 
Please login to merge, or discard this patch.
src/Forwarder.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     public function forwardAll(ServerInterface $server, $forwardAddress, $forwardPort)
57 57
     {
58 58
         $server->on('connection', function(ConnectionInterface $connection) use ($forwardAddress, $forwardPort) {
59
-           $this->forward($connection, $forwardAddress, $forwardPort);
59
+            $this->forward($connection, $forwardAddress, $forwardPort);
60 60
         });
61 61
     }
62 62
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace SamIT\Proxy;
4 4
 
5 5
 use React\Promise\Promise;
6
-use React\Socket\Connection;
7 6
 use React\Socket\ConnectionInterface;
8 7
 use React\Socket\ServerInterface;
9 8
 use React\SocketClient\TcpConnector;
Please login to merge, or discard this patch.