Completed
Branch feature-persistent-connect (647c46)
by Evgenij
03:19
created
src/RequestExecutor/Pipeline/IoStage.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@
 block discarded – undo
155 155
     private function setConnectionFinishTime(OperationMetadata $operationMetadata)
156 156
     {
157 157
         $meta         = $operationMetadata->getMetadata();
158
-        $wasConnected = $meta[ RequestExecutorInterface::META_CONNECTION_FINISH_TIME ] !== null;
158
+        $wasConnected = $meta[RequestExecutorInterface::META_CONNECTION_FINISH_TIME] !== null;
159 159
         $this->setSocketOperationTime($operationMetadata, RequestExecutorInterface::META_CONNECTION_FINISH_TIME);
160 160
         if (!$wasConnected) {
161 161
             $event = $this->createEvent($operationMetadata, EventType::CONNECTED);
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/RequestExecutor/Pipeline/ConnectStage.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
      */
106 106
     private function getStreamContextFromMetaData($meta)
107 107
     {
108
-        $metaStreamContext = $meta[ RequestExecutorInterface::META_SOCKET_STREAM_CONTEXT ];
108
+        $metaStreamContext = $meta[RequestExecutorInterface::META_SOCKET_STREAM_CONTEXT];
109 109
         if (is_resource($metaStreamContext)) {
110 110
             return $metaStreamContext;
111 111
         } elseif (is_array($metaStreamContext)) {
112 112
             return stream_context_create(
113
-                isset($metaStreamContext[ 'options' ]) ? $metaStreamContext[ 'options' ] : [ ],
114
-                isset($metaStreamContext[ 'params' ]) ? $metaStreamContext[ 'params' ] : [ ]
113
+                isset($metaStreamContext['options']) ? $metaStreamContext['options'] : [],
114
+                isset($metaStreamContext['params']) ? $metaStreamContext['params'] : []
115 115
             );
116 116
         }
117 117
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             $this->setSocketOperationTime($item, RequestExecutorInterface::META_CONNECTION_START_TIME);
139 139
 
140 140
             $socket->open(
141
-                $meta[ RequestExecutorInterface::META_ADDRESS ],
141
+                $meta[RequestExecutorInterface::META_ADDRESS],
142 142
                 $this->getStreamContextFromMetaData($meta)
143 143
             );
144 144
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/RequestExecutor/Pipeline/TimeoutStage.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\RequestExecutor\Pipeline;
11 11
 
12 12
 use AsyncSockets\Event\EventType;
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 
58 58
         return ($desiredTimeout !== RequestExecutorInterface::WAIT_FOREVER) &&
59 59
                (
60
-                   ($hasConnected && $lastOperationTime !== null) ||
60
+                    ($hasConnected && $lastOperationTime !== null) ||
61 61
                    !$hasConnected
62
-               ) &&
62
+                ) &&
63 63
                ($microTime - $lastOperationTime >= $desiredTimeout)
64
-               ;
64
+                ;
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
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.
src/Exception/AcceptException.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Event/EventType.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Event/AcceptEvent.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Event/WriteEvent.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Event/ReadEvent.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.
src/Event/AbstractEvent.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Async sockets
4
- *
5
- * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
- *
7
- * This source file is subject to the MIT license that is bundled
8
- * with this source code in the file LICENSE.
9
- */
3
+     * Async sockets
4
+     *
5
+     * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
+     *
7
+     * This source file is subject to the MIT license that is bundled
8
+     * with this source code in the file LICENSE.
9
+     */
10 10
 namespace AsyncSockets\Exception;
11 11
 
12 12
 /**
Please login to merge, or discard this patch.