@@ -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 | } |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | namespace mpyw\Co\Internal; |
4 | -use React\Promise\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) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public static function safePromise(PromiseInterface $promise) |
95 | 95 | { |
96 | - return $promise->then(null, function ($value) { |
|
96 | + return $promise->then(null, function($value) { |
|
97 | 97 | if (TypeUtils::isFatalThrowable($value)) { |
98 | 98 | throw $value; |
99 | 99 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | YieldableUtils::getApplier($returned, $yieldables, [$deferred, 'resolve']), |
165 | 165 | [$deferred, 'reject'] |
166 | 166 | ) |
167 | - ->then(function () use ($yieldables, $deferred) { |
|
167 | + ->then(function() use ($yieldables, $deferred) { |
|
168 | 168 | $this->runners = array_diff_key($this->runners, $yieldables); |
169 | 169 | return $deferred->promise(); |
170 | 170 | }); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | // Check delay request yields |
185 | 185 | if ($gc->key() === CoInterface::DELAY) { |
186 | 186 | return $this->pool->addDelay($gc->current()) |
187 | - ->then(function () use ($gc) { |
|
187 | + ->then(function() use ($gc) { |
|
188 | 188 | $gc->send(null); |
189 | 189 | return $this->processGeneratorContainer($gc); |
190 | 190 | }); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | ->then( |
206 | 206 | YieldableUtils::getApplier($yielded, $yieldables, [$gc, 'send']), |
207 | 207 | [$gc, 'throw_'] |
208 | - )->then(function () use ($gc, $yieldables) { |
|
208 | + )->then(function() use ($gc, $yieldables) { |
|
209 | 209 | // Continue |
210 | 210 | $this->runners = array_diff_key($this->runners, $yieldables); |
211 | 211 | return $this->processGeneratorContainer($gc); |