@@ -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(); |
@@ -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 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } elseif ($decision === LimitationSolverInterface::DECISION_SKIP_CURRENT) { |
60 | 60 | continue; |
61 | 61 | } elseif ($decision !== LimitationSolverInterface::DECISION_OK) { |
62 | - throw new \LogicException('Unknown decision ' . $decision . ' received.'); |
|
62 | + throw new \LogicException('Unknown decision '.$decision.' received.'); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | if ($this->connectSocket($descriptor)) { |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | if (!$socket->isConnected()) { |
126 | 126 | $meta = $descriptor->getMetadata(); |
127 | 127 | $socket->open( |
128 | - $meta[ RequestExecutorInterface::META_ADDRESS ], |
|
129 | - $meta[ RequestExecutorInterface::META_SOCKET_STREAM_CONTEXT] |
|
128 | + $meta[RequestExecutorInterface::META_ADDRESS], |
|
129 | + $meta[RequestExecutorInterface::META_SOCKET_STREAM_CONTEXT] |
|
130 | 130 | ); |
131 | 131 | } else { |
132 | 132 | $this->setSocketOperationTime($descriptor, RequestExecutorInterface::META_CONNECTION_FINISH_TIME); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function processStage(array $requestDescriptors) |
24 | 24 | { |
25 | 25 | /** @var RequestDescriptor[] $requestDescriptors */ |
26 | - $result = [ ]; |
|
26 | + $result = []; |
|
27 | 27 | $microTime = microtime(true); |
28 | 28 | foreach ($requestDescriptors as $key => $descriptor) { |
29 | 29 | $isTimeout = $this->isSingleSocketTimeout($descriptor, $microTime) && |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | $meta[RequestExecutorInterface::META_USER_CONTEXT], |
53 | 53 | $meta[RequestExecutorInterface::META_CONNECTION_FINISH_TIME] !== null && |
54 | 54 | !$descriptor->getSocket()->isServer() ? |
55 | - TimeoutEvent::DURING_IO : |
|
56 | - TimeoutEvent::DURING_CONNECTION |
|
55 | + TimeoutEvent::DURING_IO : TimeoutEvent::DURING_CONNECTION |
|
57 | 56 | ); |
58 | 57 | try { |
59 | 58 | $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->isForgotten(); |
59 | 59 | } |
@@ -85,9 +85,8 @@ |
||
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 | |
93 | 92 | /** |