@@ -56,7 +56,7 @@ |
||
56 | 56 | */ |
57 | 57 | public function result() |
58 | 58 | { |
59 | - return $this->simpleHCodeResult()->then(function (Result $result) { |
|
59 | + return $this->simpleHCodeResult()->then(function(Result $result) { |
|
60 | 60 | return $this->service->registered($this->agent(), $this->assigned(), $result); |
61 | 61 | }); |
62 | 62 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | return Promise::resolved($this->assigned); |
113 | 113 | } |
114 | 114 | |
115 | - DNS::resolve($this->agent->host())->then(function (Result $result) { |
|
115 | + DNS::resolve($this->agent->host())->then(function(Result $result) { |
|
116 | 116 | return $this->assigned = new Agent($result->random(), $this->agent->port()); |
117 | 117 | })->sync($resolving = Promise::deferred()); |
118 | 118 | |
@@ -182,14 +182,14 @@ discard block |
||
182 | 182 | { |
183 | 183 | $this->assigning()->sync($resolved = Promise::deferred()); |
184 | 184 | |
185 | - return $resolved->then(function (Agent $agent) use ($canceller) { |
|
185 | + return $resolved->then(function(Agent $agent) use ($canceller) { |
|
186 | 186 | $request = new Request( |
187 | 187 | $this->method, |
188 | 188 | new Uri( |
189 | 189 | self::SCHEME, |
190 | 190 | $agent->host(), |
191 | 191 | $agent->port(), |
192 | - sprintf("/%s", self::VERSION) . $this->uri, |
|
192 | + sprintf("/%s", self::VERSION).$this->uri, |
|
193 | 193 | $this->query |
194 | 194 | ), |
195 | 195 | [ |
@@ -207,11 +207,11 @@ discard block |
||
207 | 207 | */ |
208 | 208 | final protected function simpleHCodeResult() |
209 | 209 | { |
210 | - return $this->perform()->then(static function (Response $response) { |
|
210 | + return $this->perform()->then(static function(Response $response) { |
|
211 | 211 | return |
212 | 212 | $response->getStatusCode() === 200 |
213 | 213 | ? new Success |
214 | - : new Failed((string)$response->getBody()) |
|
214 | + : new Failed((string) $response->getBody()) |
|
215 | 215 | ; |
216 | 216 | }); |
217 | 217 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | */ |
48 | 48 | public function result() |
49 | 49 | { |
50 | - return $this->simpleHCodeResult()->then(function (Result $result) { |
|
50 | + return $this->simpleHCodeResult()->then(function(Result $result) { |
|
51 | 51 | return $this->service->deregistered($result); |
52 | 52 | }); |
53 | 53 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function result() |
47 | 47 | { |
48 | - return $this->perform($this->getCanceller())->then(function (Response $response) { |
|
48 | + return $this->perform($this->getCanceller())->then(function(Response $response) { |
|
49 | 49 | if ($response->getStatusCode() !== 200) { |
50 | 50 | goto DO_WAIT; |
51 | 51 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->setVIndex($this->service->getVersion()); |
59 | 59 | |
60 | 60 | // new endpoints |
61 | - $endpoints = $this->decodeResponse((string)$response->getBody()); |
|
61 | + $endpoints = $this->decodeResponse((string) $response->getBody()); |
|
62 | 62 | foreach ($endpoints as $endpoint) { |
63 | 63 | list($id, $name, $host, $port, $tags) = $this->genInfo($endpoint); |
64 | 64 | $this->service->addEndpoint( |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | DO_WAIT: |
78 | 78 | |
79 | 79 | // make sleep if no versions |
80 | - return msleep(rand(...$this->emptyWait), function () { |
|
80 | + return msleep(rand(...$this->emptyWait), function() { |
|
81 | 81 | return $this->service; |
82 | 82 | }); |
83 | 83 | }); |
@@ -28,6 +28,6 @@ |
||
28 | 28 | */ |
29 | 29 | final public function failed() : bool |
30 | 30 | { |
31 | - return ! $this->success; |
|
31 | + return !$this->success; |
|
32 | 32 | } |
33 | 33 | } |