@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $map = [ |
59 | - 'null' => [ $this, 'createFromNull' ], |
|
60 | - 'resource' => [ $this, 'createFromResource' ], |
|
61 | - 'array' => [ $this, 'createFromArray' ], |
|
59 | + 'null' => [$this, 'createFromNull'], |
|
60 | + 'resource' => [$this, 'createFromResource'], |
|
61 | + 'array' => [$this, 'createFromArray'], |
|
62 | 62 | ]; |
63 | 63 | |
64 | 64 | $type = strtolower(gettype($settings)); |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | private function createFromArray(array $settings) |
108 | 108 | { |
109 | 109 | return stream_context_create( |
110 | - isset($settings[ 'options' ]) ? $settings[ 'options' ] : [], |
|
111 | - isset($settings[ 'params' ]) ? $settings[ 'params' ] : [] |
|
110 | + isset($settings['options']) ? $settings['options'] : [], |
|
111 | + isset($settings['params']) ? $settings['params'] : [] |
|
112 | 112 | ); |
113 | 113 | } |
114 | 114 | } |
@@ -163,8 +163,7 @@ |
||
163 | 163 | $this->popLastPushedBackItem(); |
164 | 164 | |
165 | 165 | $result .= $this->hasUnreadItem() ? |
166 | - array_shift($this->unreadItems) : |
|
167 | - (string) $this->nestedIterator->current(); |
|
166 | + array_shift($this->unreadItems) : (string) $this->nestedIterator->current(); |
|
168 | 167 | |
169 | 168 | while ($this->hasUnreadItem() && strlen($result) < $this->chunkSize) { |
170 | 169 | $result .= array_shift($this->unreadItems); |
@@ -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) |
@@ -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 |