@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $options += $this->getDefaultOptions(); |
| 97 | 97 | |
| 98 | - $this->connectTimeout = (double) $options[ 'connectTimeout' ]; |
|
| 99 | - $this->ioTimeout = (double) $options[ 'ioTimeout' ]; |
|
| 100 | - $this->preferredEngines = (array) $options[ 'preferredEngines' ]; |
|
| 98 | + $this->connectTimeout = (double) $options['connectTimeout']; |
|
| 99 | + $this->ioTimeout = (double) $options['ioTimeout']; |
|
| 100 | + $this->preferredEngines = (array) $options['preferredEngines']; |
|
| 101 | 101 | |
| 102 | - $this->streamContext = new StreamContext($options[ 'streamContext' ]); |
|
| 102 | + $this->streamContext = new StreamContext($options['streamContext']); |
|
| 103 | 103 | foreach (['minReceiveSpeed', 'minReceiveSpeedDuration', 'minSendSpeed', 'minSendSpeedDuration'] as $k) { |
| 104 | 104 | $this->{$k} = $options[$k] !== null ? (int) $options[$k] : null; |
| 105 | 105 | } |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | $result = []; |
| 196 | 196 | $socketTimeout = (double) ini_get('default_socket_timeout'); |
| 197 | 197 | |
| 198 | - $result[ 'connectTimeout' ] = $socketTimeout; |
|
| 199 | - $result[ 'ioTimeout' ] = $socketTimeout; |
|
| 200 | - $result[ 'preferredEngines' ] = [ 'libevent', 'native' ]; |
|
| 201 | - $result[ 'streamContext' ] = null; |
|
| 202 | - $result[ 'minReceiveSpeed' ] = null; |
|
| 203 | - $result[ 'minReceiveSpeedDuration' ] = null; |
|
| 204 | - $result[ 'minSendSpeed' ] = null; |
|
| 205 | - $result[ 'minSendSpeedDuration' ] = null; |
|
| 198 | + $result['connectTimeout'] = $socketTimeout; |
|
| 199 | + $result['ioTimeout'] = $socketTimeout; |
|
| 200 | + $result['preferredEngines'] = ['libevent', 'native']; |
|
| 201 | + $result['streamContext'] = null; |
|
| 202 | + $result['minReceiveSpeed'] = null; |
|
| 203 | + $result['minReceiveSpeedDuration'] = null; |
|
| 204 | + $result['minSendSpeed'] = null; |
|
| 205 | + $result['minSendSpeedDuration'] = null; |
|
| 206 | 206 | |
| 207 | 207 | return $result; |
| 208 | 208 | } |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | return $settings; |
| 60 | 60 | } elseif (is_array($settings)) { |
| 61 | 61 | return stream_context_create( |
| 62 | - isset($settings[ 'options' ]) ? $settings[ 'options' ] : [ ], |
|
| 63 | - isset($settings[ 'params' ]) ? $settings[ 'params' ] : [ ] |
|
| 62 | + isset($settings['options']) ? $settings['options'] : [], |
|
| 63 | + isset($settings['params']) ? $settings['params'] : [] |
|
| 64 | 64 | ); |
| 65 | 65 | } elseif ($settings === null) { |
| 66 | 66 | return stream_context_get_default(); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } elseif ($decision === LimitationSolverInterface::DECISION_SKIP_CURRENT) { |
| 57 | 57 | continue; |
| 58 | 58 | } elseif ($decision !== LimitationSolverInterface::DECISION_OK) { |
| 59 | - throw new \LogicException('Unknown decision ' . $decision . ' received.'); |
|
| 59 | + throw new \LogicException('Unknown decision '.$decision.' received.'); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | if ($this->connectSocket($descriptor)) { |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $meta = $descriptor->getMetadata(); |
| 118 | 118 | |
| 119 | 119 | $socket->open( |
| 120 | - $meta[ RequestExecutorInterface::META_ADDRESS ], |
|
| 121 | - $meta[ RequestExecutorInterface::META_SOCKET_STREAM_CONTEXT] |
|
| 120 | + $meta[RequestExecutorInterface::META_ADDRESS], |
|
| 121 | + $meta[RequestExecutorInterface::META_SOCKET_STREAM_CONTEXT] |
|
| 122 | 122 | ); |
| 123 | 123 | |
| 124 | 124 | $descriptor->setRunning(true); |
@@ -178,7 +178,7 @@ |
||
| 178 | 178 | ]; |
| 179 | 179 | |
| 180 | 180 | if (!is_array($key)) { |
| 181 | - $key = [ $key => $value ]; |
|
| 181 | + $key = [$key => $value]; |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | $key = array_intersect_key($key, $writableKeys); |