| @@ -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; | 
| @@ -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 | } | 
| @@ -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) | 
| @@ -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); | 
| @@ -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); |