@@ -5,7 +5,6 @@ |
||
5 | 5 | use mpyw\Co\Internal\CoOption; |
6 | 6 | use mpyw\Co\Internal\GeneratorContainer; |
7 | 7 | use mpyw\Co\Internal\CURLPool; |
8 | - |
|
9 | 8 | use React\Promise\Deferred; |
10 | 9 | use React\Promise\PromiseInterface; |
11 | 10 | use function React\Promise\all; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | self::getApplier($returned, $yieldables, [$deferred, 'resolve']), |
164 | 164 | [$deferred, 'reject'] |
165 | 165 | ) |
166 | - ->always(function () use ($yieldables) { |
|
166 | + ->always(function() use ($yieldables) { |
|
167 | 167 | $this->runners = array_diff_key($this->runners, $yieldables); |
168 | 168 | }); |
169 | 169 | return; |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | $this->pool->addDelay($gc->current(), $dfd); |
187 | 187 | $dfd |
188 | 188 | ->promise() |
189 | - ->then(function () use ($gc) { |
|
189 | + ->then(function() use ($gc) { |
|
190 | 190 | $gc->send(null); |
191 | 191 | }) |
192 | - ->always(function () use ($gc, $deferred) { |
|
192 | + ->always(function() use ($gc, $deferred) { |
|
193 | 193 | $this->processGeneratorContainer($gc, $deferred); |
194 | 194 | }); |
195 | 195 | return; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | ->then( |
213 | 213 | self::getApplier($yielded, $yieldables, [$gc, 'send']), |
214 | 214 | [$gc, 'throw_'] |
215 | - )->always(function () use ($gc, $deferred, $yieldables) { |
|
215 | + )->always(function() use ($gc, $deferred, $yieldables) { |
|
216 | 216 | // Continue |
217 | 217 | $this->runners = array_diff_key($this->runners, $yieldables); |
218 | 218 | $this->processGeneratorContainer($gc, $deferred); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | private static function getApplier($yielded, $yieldables, callable $next) |
249 | 249 | { |
250 | - return function (array $results) use ($yielded, $yieldables, $next) { |
|
250 | + return function(array $results) use ($yielded, $yieldables, $next) { |
|
251 | 251 | foreach ($results as $hash => $resolved) { |
252 | 252 | $current = &$yielded; |
253 | 253 | foreach ($yieldables[$hash]['keylist'] as $key) { |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | private static function deferredSafe($original_dfd) |
300 | 300 | { |
301 | 301 | $dfd = new Deferred; |
302 | - $absorber = function ($any) use ($original_dfd) { |
|
302 | + $absorber = function($any) use ($original_dfd) { |
|
303 | 303 | $original_dfd->resolve($any); |
304 | 304 | }; |
305 | 305 | $dfd->promise()->then($absorber, $absorber); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function offsetGet($offset) |
89 | 89 | { |
90 | 90 | if (!isset($this->options[$offset])) { |
91 | - throw new \DomainException('Undefined field: ' + $offset); |
|
91 | + throw new \DomainException('Undefined field: ' +$offset); |
|
92 | 92 | } |
93 | 93 | return $this->options[$offset]; |
94 | 94 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | if (!isset(self::$types[$key])) { |
126 | 126 | throw new \InvalidArgumentException("Unknown option: $key"); |
127 | 127 | } |
128 | - $validator = [__CLASS__, 'validate' . self::$types[$key]]; |
|
128 | + $validator = [__CLASS__, 'validate'.self::$types[$key]]; |
|
129 | 129 | $options[$key] = $validator($key, $value); |
130 | 130 | } |
131 | 131 | return $options; |
@@ -3,7 +3,6 @@ |
||
3 | 3 | require __DIR__ . '/../vendor/autoload.php'; |
4 | 4 | |
5 | 5 | use mpyw\Co\Co; |
6 | -use mpyw\Co\CURLException; |
|
7 | 6 | |
8 | 7 | function curl_init_with($url, array $options = [CURLOPT_RETURNTRANSFER => true]) { |
9 | 8 | $ch = curl_init($url); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | } |
69 | 69 | $errno = curl_multi_add_handle($this->mh, $ch); |
70 | 70 | if ($errno !== CURLM_OK) { |
71 | - $msg = curl_multi_strerror($errno) . ": $ch"; |
|
71 | + $msg = curl_multi_strerror($errno).": $ch"; |
|
72 | 72 | $deferred->reject(new \RuntimeException($msg)); |
73 | 73 | return; |
74 | 74 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | } |
69 | 69 | $errno = curl_multi_add_handle($this->mh, $ch); |
70 | 70 | if ($errno !== CURLM_OK) { |
71 | - $msg = curl_multi_strerror($errno) . ": $ch"; |
|
71 | + $msg = curl_multi_strerror($errno).": $ch"; |
|
72 | 72 | $deferred->reject(new \RuntimeException($msg)); |
73 | 73 | return; |
74 | 74 | } |