@@ -10,7 +10,6 @@ |
||
10 | 10 | * Constructor. |
11 | 11 | * @param string $message Dummy. |
12 | 12 | * @param int $code Dummy. |
13 | - * @param mixed $value Value to be retrived. |
|
14 | 13 | */ |
15 | 14 | public function __construct($message, $code, $reasons) |
16 | 15 | { |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * If no yieldables found, AllFailedException is thrown. |
280 | 280 | * |
281 | 281 | * @param mixed $value |
282 | - * @return mixed Resolved value. |
|
282 | + * @return \Generator Resolved value. |
|
283 | 283 | * @throws AllFailedException |
284 | 284 | */ |
285 | 285 | public static function any($value) |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * If no yieldables found, AllFailedException is thrown. |
299 | 299 | * |
300 | 300 | * @param mixed $value |
301 | - * @return mixed Resolved value. |
|
301 | + * @return \Generator Resolved value. |
|
302 | 302 | * @throws \RuntimeException|AllFailedException |
303 | 303 | */ |
304 | 304 | public static function race($value) |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * You should use only with Co::race() or Co::any(). |
319 | 319 | * |
320 | 320 | * @param mixed $value |
321 | - * @return mixed Resolved value. |
|
321 | + * @return \Generator Resolved value. |
|
322 | 322 | * @throws \RuntimeException |
323 | 323 | */ |
324 | 324 | public static function all($value) |
@@ -7,8 +7,6 @@ |
||
7 | 7 | use mpyw\Co\Internal\CoOption; |
8 | 8 | use mpyw\Co\Internal\GeneratorContainer; |
9 | 9 | use mpyw\Co\Internal\Pool; |
10 | -use mpyw\Co\Internal\ControlException; |
|
11 | - |
|
12 | 10 | use mpyw\RuntimePromise\Deferred; |
13 | 11 | use mpyw\RuntimePromise\PromiseInterface; |
14 | 12 |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | YieldableUtils::getApplier($returned, $yieldables, [$deferred, 'resolve']), |
167 | 167 | [$deferred, 'reject'] |
168 | 168 | ) |
169 | - ->always(function () use ($yieldables) { |
|
169 | + ->always(function() use ($yieldables) { |
|
170 | 170 | $this->runners = array_diff_key($this->runners, $yieldables); |
171 | 171 | }); |
172 | 172 | return; |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | $this->pool->addDelay($gc->current(), $dfd); |
190 | 190 | $dfd |
191 | 191 | ->promise() |
192 | - ->then(function () use ($gc) { |
|
192 | + ->then(function() use ($gc) { |
|
193 | 193 | $gc->send(null); |
194 | 194 | }) |
195 | - ->always(function () use ($gc, $deferred) { |
|
195 | + ->always(function() use ($gc, $deferred) { |
|
196 | 196 | $this->processGeneratorContainer($gc, $deferred); |
197 | 197 | }); |
198 | 198 | return; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | ->then( |
216 | 216 | YieldableUtils::getApplier($yielded, $yieldables, [$gc, 'send']), |
217 | 217 | [$gc, 'throw_'] |
218 | - )->always(function () use ($gc, $deferred, $yieldables) { |
|
218 | + )->always(function() use ($gc, $deferred, $yieldables) { |
|
219 | 219 | // Continue |
220 | 220 | $this->runners = array_diff_key($this->runners, $yieldables); |
221 | 221 | $this->processGeneratorContainer($gc, $deferred); |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | namespace mpyw\Co\Internal; |
4 | -use mpyw\RuntimePromise\Deferred; |
|
5 | 4 | use mpyw\Co\AllFailedException; |
6 | 5 | use mpyw\Co\CoInterface; |
7 | 6 |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public static function getApplier($yielded, array $yieldables, callable $next = null) |
75 | 75 | { |
76 | - return function (array $results) use ($yielded, $yieldables, $next) { |
|
76 | + return function(array $results) use ($yielded, $yieldables, $next) { |
|
77 | 77 | foreach ($results as $hash => $resolved) { |
78 | 78 | $current = &$yielded; |
79 | 79 | foreach ($yieldables[$hash]['keylist'] as $key) { |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public static function safeDeferred(Deferred $original_dfd) |
95 | 95 | { |
96 | 96 | $dfd = new Deferred; |
97 | - $absorber = function ($any) use ($original_dfd) { |
|
97 | + $absorber = function($any) use ($original_dfd) { |
|
98 | 98 | $original_dfd->resolve($any); |
99 | 99 | }; |
100 | 100 | $dfd->promise()->then($absorber, $absorber); |