Completed
Push — master ( e2543c...e22f7e )
by Evgenij
03:34
created
src/Frame/MarkerFramePicker.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,6 @@
 block discarded – undo
126 126
     protected function findMarker($haystack, $needle, $offset = 0)
127 127
     {
128 128
         return $this->isCaseSensitive ?
129
-            strpos($haystack, $needle, $offset) :
130
-            stripos($haystack, $needle, $offset);
129
+            strpos($haystack, $needle, $offset) : stripos($haystack, $needle, $offset);
131 130
     }
132 131
 }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
      * @param string $needle What to find
122 122
      * @param int    $offset Start offset in $haystack
123 123
      *
124
-     * @return bool|int
124
+     * @return string
125 125
      */
126 126
     protected function findMarker($haystack, $needle, $offset = 0)
127 127
     {
Please login to merge, or discard this patch.
src/Socket/Io/AbstractClientIo.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,8 +143,7 @@
 block discarded – undo
143 143
         $resource = $this->socket->getStreamResource();
144 144
         if (!is_resource($resource)) {
145 145
             $message = $this->state === self::STATE_CONNECTED ?
146
-                'Connection was unexpectedly closed.' :
147
-                'Can not start io operation on uninitialized socket.';
146
+                'Connection was unexpectedly closed.' : 'Can not start io operation on uninitialized socket.';
148 147
             throw new ConnectionException($this->socket, $message);
149 148
         }
150 149
 
Please login to merge, or discard this patch.
src/Socket/ServerSocket.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,9 +68,8 @@
 block discarded – undo
68 68
             'udg' => 1,
69 69
         ];
70 70
 
71
-        return isset($connectionLessMap[ $scheme ]) ?
72
-            STREAM_SERVER_BIND :
73
-            STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
71
+        return isset($connectionLessMap[$scheme]) ?
72
+            STREAM_SERVER_BIND : STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
74 73
     }
75 74
 
76 75
     /** {@inheritdoc} */
Please login to merge, or discard this patch.
src/Configuration/Configuration.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $options = $options + $this->getDefaultOptions();
52 52
 
53
-        $this->connectTimeout   = (double) $options[ 'connectTimeout' ];
54
-        $this->ioTimeout        = (double) $options[ 'ioTimeout' ];
55
-        $this->preferredEngines = (array) $options[ 'preferredEngines' ];
53
+        $this->connectTimeout   = (double) $options['connectTimeout'];
54
+        $this->ioTimeout        = (double) $options['ioTimeout'];
55
+        $this->preferredEngines = (array) $options['preferredEngines'];
56 56
     }
57 57
 
58 58
     /**
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
         $result        = [];
96 96
         $socketTimeout = (double) ini_get('default_socket_timeout');
97 97
 
98
-        $result[ 'connectTimeout' ]   = $socketTimeout;
99
-        $result[ 'ioTimeout' ]        = $socketTimeout;
100
-        $result[ 'preferredEngines' ] = [ 'libevent', 'native' ];
98
+        $result['connectTimeout']   = $socketTimeout;
99
+        $result['ioTimeout']        = $socketTimeout;
100
+        $result['preferredEngines'] = ['libevent', 'native'];
101 101
 
102 102
         return $result;
103 103
     }
Please login to merge, or discard this patch.
src/RequestExecutor/Metadata/SocketBag.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     public function __construct(RequestExecutorInterface $executor, $connectTimeout, $ioTimeout)
59 59
     {
60 60
         $this->executor       = $executor;
61
-        $this->items          = [ ];
61
+        $this->items          = [];
62 62
         $this->connectTimeout = $connectTimeout;
63 63
         $this->ioTimeout      = $ioTimeout;
64 64
     }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         ];
157 157
 
158 158
         if (!is_array($key)) {
159
-            $key = [ $key => $value ];
159
+            $key = [$key => $value];
160 160
         }
161 161
 
162 162
         $key = array_intersect_key($key, $writableKeys);
Please login to merge, or discard this patch.
src/RequestExecutor/Pipeline/WriteIoHandler.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
                 $operation,
51 51
                 $executor,
52 52
                 $socket,
53
-                $meta[ RequestExecutorInterface::META_USER_CONTEXT ]
53
+                $meta[RequestExecutorInterface::META_USER_CONTEXT]
54 54
             );
55 55
             $eventHandler->invokeEvent($event);
56 56
             $nextOperation = $event->getNextOperation();
Please login to merge, or discard this patch.
src/RequestExecutor/Pipeline/DisconnectStage.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
 
76 76
         try {
77 77
             $socket->close();
78
-            if ($meta[ RequestExecutorInterface::META_CONNECTION_FINISH_TIME ] !== null) {
78
+            if ($meta[RequestExecutorInterface::META_CONNECTION_FINISH_TIME] !== null) {
79 79
                 $this->callSocketSubscribers($operation, $event);
80 80
             }
81 81
         } catch (SocketException $e) {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -136,13 +136,13 @@
 block discarded – undo
136 136
     private function isDisconnectRequired(SocketInterface $socket)
137 137
     {
138 138
         return (
139
-                   ($socket instanceof PersistentClientSocket) &&
139
+                    ($socket instanceof PersistentClientSocket) &&
140 140
                    (
141
-                       feof($socket->getStreamResource()) !== false ||
141
+                        feof($socket->getStreamResource()) !== false ||
142 142
                        !stream_socket_get_name($socket->getStreamResource(), true)
143
-                   )
144
-               ) || (
145
-                   !($socket instanceof PersistentClientSocket)
146
-               );
143
+                    )
144
+                ) || (
145
+                    !($socket instanceof PersistentClientSocket)
146
+                );
147 147
     }
148 148
 }
Please login to merge, or discard this patch.
src/RequestExecutor/Pipeline/AbstractStage.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.
src/RequestExecutor/Pipeline/TimeoutStage.php 2 patches
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     public function processStage(array $operations)
25 25
     {
26 26
         /** @var OperationMetadata[] $operations */
27
-        $result    = [ ];
27
+        $result    = [];
28 28
         $microTime = microtime(true);
29 29
         foreach ($operations as $key => $operation) {
30 30
             if ($this->isSingleSocketTimeout($operation, $microTime)) {
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
             $meta[RequestExecutorInterface::META_USER_CONTEXT],
54 54
             $meta[RequestExecutorInterface::META_CONNECTION_FINISH_TIME] !== null &&
55 55
             !($descriptor->getSocket() instanceof ServerSocket) ?
56
-                TimeoutEvent::DURING_IO :
57
-                TimeoutEvent::DURING_CONNECTION
56
+                TimeoutEvent::DURING_IO : TimeoutEvent::DURING_CONNECTION
58 57
         );
59 58
         try {
60 59
             $this->callSocketSubscribers($descriptor, $event);
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -114,10 +114,10 @@
 block discarded – undo
114 114
 
115 115
         return ($desiredTimeout !== RequestExecutorInterface::WAIT_FOREVER) &&
116 116
                (
117
-                   ($hasConnected && $lastOperationTime !== null) ||
117
+                    ($hasConnected && $lastOperationTime !== null) ||
118 118
                    !$hasConnected
119
-               ) &&
119
+                ) &&
120 120
                ($microTime - $lastOperationTime >= $desiredTimeout)
121
-               ;
121
+                ;
122 122
     }
123 123
 }
Please login to merge, or discard this patch.