Passed
Branch master (a0c179)
by y
02:55
created
src/AbstractServer.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
     public function __toString () {
18 18
         try {
19 19
             return implode(':', $this->getSockName());
20
-        }
21
-        catch (\Exception $e) {
20
+        } catch (\Exception $e) {
22 21
             return ':';
23 22
         }
24 23
     }
Please login to merge, or discard this patch.
src/StreamClient.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
                 if ($chunk === '') {
53 53
                     return $data;
54 54
                 }
55
-            }
56
-            catch (Error $error) {
55
+            } catch (Error $error) {
57 56
                 $error->setExtra($data);
58 57
                 throw $error;
59 58
             }
Please login to merge, or discard this patch.
src/AbstractClient.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
     public function __toString () {
18 18
         try {
19 19
             return implode(':', $this->getPeerName());
20
-        }
21
-        catch (\Exception $exception) {
20
+        } catch (\Exception $exception) {
22 21
             return ':';
23 22
         }
24 23
     }
@@ -107,8 +106,7 @@  discard block
 block discarded – undo
107 106
             try {
108 107
                 $total += $count = $this->await(self::CH_WRITE)->send($data);
109 108
                 $data = substr($data, $count); // 0 bytes sent = unaltered buffer
110
-            }
111
-            catch (Error $error) {
109
+            } catch (Error $error) {
112 110
                 $error->setExtra($total);
113 111
                 throw $error;
114 112
             }
Please login to merge, or discard this patch.
src/AbstractSocket.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,11 +96,9 @@  discard block
 block discarded – undo
96 96
     public function __construct ($resource) {
97 97
         if (!is_resource($resource) or get_resource_type($resource) !== 'Socket') {
98 98
             throw new InvalidArgumentException('Expected an open socket resource.', SOCKET_EBADF);
99
-        }
100
-        elseif (socket_get_option($resource, SOL_SOCKET, SO_TYPE) !== static::getType()) {
99
+        } elseif (socket_get_option($resource, SOL_SOCKET, SO_TYPE) !== static::getType()) {
101 100
             throw new InvalidArgumentException('The given socket resource is of the wrong type for ' . get_class(), SOCKET_ESOCKTNOSUPPORT);
102
-        }
103
-        elseif ($errno = Error::getLast($resource)) {
101
+        } elseif ($errno = Error::getLast($resource)) {
104 102
             $error = new Error(SOCKET_EBADFD);
105 103
             $error->setExtra($errno);
106 104
             throw $error;
@@ -331,8 +329,7 @@  discard block
 block discarded – undo
331 329
     public function setBlocking ($blocking) {
332 330
         if ($blocking) {
333 331
             $success = @socket_set_block($this->resource);
334
-        }
335
-        else {
332
+        } else {
336 333
             $success = @socket_set_nonblock($this->resource);
337 334
         }
338 335
         if (!$success) {
Please login to merge, or discard this patch.
src/Error.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,14 +57,12 @@
 block discarded – undo
57 57
     public function __construct ($subject = null, $fallback = 0) {
58 58
         if (is_int($subject)) {
59 59
             $errno = $subject;
60
-        }
61
-        else {
60
+        } else {
62 61
             $errno = static::getLast($subject);
63 62
         }
64 63
         if ($errno) {
65 64
             $message = socket_strerror($errno);
66
-        }
67
-        else {
65
+        } else {
68 66
             $errno = $fallback;
69 67
             $message = error_get_last()['message'];
70 68
         }
Please login to merge, or discard this patch.