Completed
Branch 0.4-dev (54e67b)
by Evgenij
02:52
created
src/Socket/AsyncSocketFactory.php 1 patch
Spacing   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -74,19 +74,17 @@
 block discarded – undo
74 74
     {
75 75
         switch ($type) {
76 76
             case self::SOCKET_CLIENT:
77
-                $isPersistent  = isset($options[ self::SOCKET_OPTION_IS_PERSISTENT ]) &&
78
-                                 $options[ self::SOCKET_OPTION_IS_PERSISTENT ];
79
-                $persistentKey = isset($options[ self::SOCKET_OPTION_PERSISTENT_KEY ]) ?
80
-                    $options[ self::SOCKET_OPTION_PERSISTENT_KEY ] :
81
-                    null;
77
+                $isPersistent  = isset($options[self::SOCKET_OPTION_IS_PERSISTENT]) &&
78
+                                 $options[self::SOCKET_OPTION_IS_PERSISTENT];
79
+                $persistentKey = isset($options[self::SOCKET_OPTION_PERSISTENT_KEY]) ?
80
+                    $options[self::SOCKET_OPTION_PERSISTENT_KEY] : null;
82 81
 
83 82
                 return $isPersistent ?
84
-                    new PersistentClientSocket($persistentKey) :
85
-                    new ClientSocket();
83
+                    new PersistentClientSocket($persistentKey) : new ClientSocket();
86 84
             case self::SOCKET_SERVER:
87 85
                 return new ServerSocket();
88 86
             default:
89
-                throw new \InvalidArgumentException("Unexpected type {$type} used in " . __FUNCTION__);
87
+                throw new \InvalidArgumentException("Unexpected type {$type} used in ".__FUNCTION__);
90 88
         }
91 89
     }
92 90
 
Please login to merge, or discard this patch.
src/Socket/PersistentClientSocket.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     protected function createSocketResource($address, $context)
41 41
     {
42 42
         $resource = stream_socket_client(
43
-            $address . ($this->persistentKey ? '/' . $this->persistentKey : ''),
43
+            $address.($this->persistentKey ? '/'.$this->persistentKey : ''),
44 44
             $errno,
45 45
             $errstr,
46 46
             null,
Please login to merge, or discard this patch.
src/Socket/Io/AbstractIo.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
             $lastError = $includeLastError ? error_get_last() : null;
61 61
             if ($lastError) {
62 62
                 $phpMessage = explode(':', $lastError['message'], 2);
63
-                $phpMessage = trim(trim(end($phpMessage)), '.') . '.';
64
-                $message   .= ' ' . $phpMessage;
63
+                $phpMessage = trim(trim(end($phpMessage)), '.').'.';
64
+                $message   .= ' '.$phpMessage;
65 65
             }
66 66
             throw new NetworkSocketException($this->socket, $message);
67 67
         }
Please login to merge, or discard this patch.
src/Socket/Io/DatagramClientIo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         parent::__construct($socket, 0);
36 36
         if ($remoteAddress) {
37 37
             $components = parse_url($remoteAddress);
38
-            $this->remoteAddress = $components['host'] . ':' . $components['port'];
38
+            $this->remoteAddress = $components['host'].':'.$components['port'];
39 39
         }
40 40
     }
41 41
 
Please login to merge, or discard this patch.
src/Socket/Io/StreamedClientIo.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,9 +71,8 @@  discard block
 block discarded – undo
71 71
     private function resolveReadAttempts(array $context, $currentAttempts)
72 72
     {
73 73
         return ($context['countCycles'] === 1 && empty($context['dataBeforeIo'])) ||
74
-               ($context['countCycles'] > 1   && $context['isStreamDataEmpty']) ?
75
-            $currentAttempts - 1 :
76
-            self::READ_ATTEMPTS;
74
+               ($context['countCycles'] > 1 && $context['isStreamDataEmpty']) ?
75
+            $currentAttempts - 1 : self::READ_ATTEMPTS;
77 76
 
78 77
     }
79 78
 
@@ -85,8 +84,7 @@  discard block
 block discarded – undo
85 84
         $this->throwNetworkSocketExceptionIf($test !== 0, 'Failed to send data.', true);
86 85
 
87 86
         $written = $isOutOfBand ?
88
-            $this->writeOobData($resource, $data) :
89
-            fwrite($resource, $data, strlen($data));
87
+            $this->writeOobData($resource, $data) : fwrite($resource, $data, strlen($data));
90 88
 
91 89
         $this->throwNetworkSocketExceptionIf($written === false, 'Failed to send data.', true);
92 90
 
Please login to merge, or discard this patch.
src/Socket/AbstractSocket.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@
 block discarded – undo
182 182
             'unix' => self::SOCKET_TYPE_UNIX,
183 183
         ];
184 184
 
185
-        $regexp = '#^('. implode('|', array_keys($map)) . ')_socket$#';
185
+        $regexp = '#^('.implode('|', array_keys($map)).')_socket$#';
186 186
         foreach ($parts as $part) {
187 187
             if (preg_match($regexp, $part, $pockets)) {
188 188
                 return $map[$pockets[1]];
Please login to merge, or discard this patch.
src/RequestExecutor/LibEvent/LeBase.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -211,9 +211,9 @@
 block discarded – undo
211 211
     private function onEvent(LeEvent $event, $eventFlags)
212 212
     {
213 213
         $map = [
214
-            LeCallbackInterface::EVENT_READ    => [ EV_READ, RequestDescriptor::RDS_READ ],
215
-            LeCallbackInterface::EVENT_WRITE   => [ EV_WRITE, RequestDescriptor::RDS_WRITE ],
216
-            LeCallbackInterface::EVENT_TIMEOUT => [ EV_TIMEOUT, 0 ],
214
+            LeCallbackInterface::EVENT_READ    => [EV_READ, RequestDescriptor::RDS_READ],
215
+            LeCallbackInterface::EVENT_WRITE   => [EV_WRITE, RequestDescriptor::RDS_WRITE],
216
+            LeCallbackInterface::EVENT_TIMEOUT => [EV_TIMEOUT, 0],
217 217
         ];
218 218
 
219 219
         $descriptor = $event->getRequestDescriptor();
Please login to merge, or discard this patch.
src/RequestExecutor/Pipeline/AbstractOobHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
         return new Event(
105 105
             $this->executor,
106 106
             $operation->getSocket(),
107
-            $meta[ RequestExecutorInterface::META_USER_CONTEXT ],
107
+            $meta[RequestExecutorInterface::META_USER_CONTEXT],
108 108
             $eventName
109 109
         );
110 110
     }
Please login to merge, or discard this patch.