@@ -179,7 +179,7 @@ |
||
179 | 179 | * @param RequestDescriptor $operation Operation object |
180 | 180 | * @param double $microTime Current time with microseconds |
181 | 181 | * |
182 | - * @return double|null |
|
182 | + * @return double |
|
183 | 183 | */ |
184 | 184 | private function getSingleSocketTimeout(RequestDescriptor $operation, $microTime) |
185 | 185 | { |
@@ -97,7 +97,7 @@ |
||
97 | 97 | $descriptor->setMetadata(RequestExecutorInterface::META_REQUEST_COMPLETE, true); |
98 | 98 | try { |
99 | 99 | $socket->close(); |
100 | - if ($meta[ RequestExecutorInterface::META_CONNECTION_FINISH_TIME ] !== null) { |
|
100 | + if ($meta[RequestExecutorInterface::META_CONNECTION_FINISH_TIME] !== null) { |
|
101 | 101 | $this->callSocketSubscribers( |
102 | 102 | $descriptor, |
103 | 103 | $this->createEvent($descriptor, EventType::DISCONNECTED) |
@@ -41,8 +41,7 @@ discard block |
||
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 |
||
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 | /** |
@@ -74,7 +72,7 @@ discard block |
||
74 | 72 | $meta = $requestDescriptor->getMetadata(); |
75 | 73 | $table = [ |
76 | 74 | RequestExecutorInterface::META_CONNECTION_START_TIME => |
77 | - $meta[ RequestExecutorInterface::META_CONNECTION_START_TIME ] === null, |
|
75 | + $meta[RequestExecutorInterface::META_CONNECTION_START_TIME] === null, |
|
78 | 76 | |
79 | 77 | RequestExecutorInterface::META_CONNECTION_FINISH_TIME => |
80 | 78 | $meta[RequestExecutorInterface::META_CONNECTION_FINISH_TIME] === null, |
@@ -50,7 +50,7 @@ |
||
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, $executor, $descriptor->getSocket(), $executionContext); |
56 | 56 | $nextOperation = $event->getNextOperation(); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function processStage(array $requestDescriptors) |
25 | 25 | { |
26 | 26 | /** @var RequestDescriptor[] $requestDescriptors */ |
27 | - $result = [ ]; |
|
27 | + $result = []; |
|
28 | 28 | $microTime = microtime(true); |
29 | 29 | foreach ($requestDescriptors as $key => $descriptor) { |
30 | 30 | $isTimeout = $this->isSingleSocketTimeout($descriptor, $microTime) && |
@@ -53,8 +53,7 @@ discard block |
||
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); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | private function isDescriptorActive(RequestDescriptor $descriptor) |
54 | 54 | { |
55 | 55 | $meta = $descriptor->getMetadata(); |
56 | - return !$meta[ RequestExecutorInterface::META_REQUEST_COMPLETE ] && |
|
56 | + return !$meta[RequestExecutorInterface::META_REQUEST_COMPLETE] && |
|
57 | 57 | $descriptor->isRunning() && |
58 | 58 | !$descriptor->isPostponed(); |
59 | 59 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | parent::initializeRequest($eventCaller, $executionContext); |
107 | 107 | $this->base = new LeBase(); |
108 | 108 | |
109 | - $this->connectStage = $this->stageFactory->createConnectStage( |
|
109 | + $this->connectStage = $this->stageFactory->createConnectStage( |
|
110 | 110 | $this, |
111 | 111 | $executionContext, |
112 | 112 | $eventCaller, |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | case LeCallbackInterface::EVENT_READ: |
187 | 187 | // fall down |
188 | 188 | case LeCallbackInterface::EVENT_WRITE: |
189 | - $result = $this->ioStage->processStage([ $requestDescriptor ]); |
|
189 | + $result = $this->ioStage->processStage([$requestDescriptor]); |
|
190 | 190 | $doResetEvent = empty($result); |
191 | 191 | |
192 | 192 | break; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $lastError = error_get_last(); |
49 | 49 | if (!empty($lastError)) { |
50 | 50 | $phpMessage = explode(':', $lastError['message'], 2); |
51 | - $phpMessage = trim(trim(end($phpMessage)), '.') . '.'; |
|
51 | + $phpMessage = trim(trim(end($phpMessage)), '.').'.'; |
|
52 | 52 | return $phpMessage; |
53 | 53 | } |
54 | 54 |
@@ -85,8 +85,7 @@ |
||
85 | 85 | 'udg' => 1, |
86 | 86 | ]; |
87 | 87 | |
88 | - return isset($connectionLessMap[ $scheme ]) ? |
|
89 | - STREAM_SERVER_BIND : |
|
90 | - STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; |
|
88 | + return isset($connectionLessMap[$scheme]) ? |
|
89 | + STREAM_SERVER_BIND : STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; |
|
91 | 90 | } |
92 | 91 | } |