Completed
Push — master ( ed637b...a7af36 )
by Evgenij
02:56
created
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   +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/AbstractStage.php 2 patches
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.
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/AbstractTimeAwareStage.php 2 patches
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $meta = $operation->getMetadata();
43 43
         return !$this->hasConnected($operation) ?
44
-            $meta[ RequestExecutorInterface::META_CONNECTION_TIMEOUT ] :
45
-            $meta[ RequestExecutorInterface::META_IO_TIMEOUT ];
44
+            $meta[RequestExecutorInterface::META_CONNECTION_TIMEOUT] : $meta[RequestExecutorInterface::META_IO_TIMEOUT];
46 45
     }
47 46
 
48 47
     /**
@@ -56,8 +55,7 @@  discard block
 block discarded – undo
56 55
     {
57 56
         $meta = $operation->getMetadata();
58 57
         return !$this->hasConnected($operation) ?
59
-            $meta[ RequestExecutorInterface::META_CONNECTION_START_TIME ] :
60
-            $meta[ RequestExecutorInterface::META_LAST_IO_START_TIME ];
58
+            $meta[RequestExecutorInterface::META_CONNECTION_START_TIME] : $meta[RequestExecutorInterface::META_LAST_IO_START_TIME];
61 59
     }
62 60
 
63 61
     /**
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/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   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function processStage(array $operations)
24 24
     {
25 25
         /** @var OperationMetadata[] $operations */
26
-        $result    = [ ];
26
+        $result    = [];
27 27
         $microTime = microtime(true);
28 28
         foreach ($operations as $key => $operation) {
29 29
             if ($this->isSingleSocketTimeout($operation, $microTime)) {
Please login to merge, or discard this patch.
src/RequestExecutor/LibEventRequestExecutor.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@
 block discarded – undo
182 182
         $items = $this->socketBag->getItems();
183 183
         foreach ($this->connectStage->processStage($items) as $item) {
184 184
             $meta = $item->getMetadata();
185
-            $this->setupEvent($item, $meta[ self::META_CONNECTION_TIMEOUT ]);
185
+            $this->setupEvent($item, $meta[self::META_CONNECTION_TIMEOUT]);
186 186
         }
187 187
     }
188 188
 
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/LibEvent/LeBase.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
                 $event->getHandle(),
144 144
                 $event->getOperationMetadata()->getSocket()->getStreamResource(),
145 145
                 $flags | $this->getEventFlags($event),
146
-                function ($streamResource, $eventFlags, $eventKey) {
146
+                function($streamResource, $eventFlags, $eventKey) {
147 147
                     if (isset($this->events[$eventKey])) {
148 148
                         $event = $this->events[$eventKey];
149 149
                         $this->onEvent($event, $eventFlags);
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/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.