@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | protected function getEurekaUri() |
21 | 21 | { |
22 | - return $this->host . ':' . $this->port . '/' . $this->context; |
|
22 | + return $this->host.':'.$this->port.'/'.$this->context; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function register($appId, array $data) |
33 | 33 | { |
34 | - return $this->client->request('POST', $this->getEurekaUri() . '/apps/' . $appId, [ |
|
34 | + return $this->client->request('POST', $this->getEurekaUri().'/apps/'.$appId, [ |
|
35 | 35 | 'json' => [ |
36 | 36 | 'instance' => $data, |
37 | 37 | ], |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function deRegister($appId, $instanceId) |
52 | 52 | { |
53 | - return $this->client->request('DELETE', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId); |
|
53 | + return $this->client->request('DELETE', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function heartBeat($appId, $instanceId) |
67 | 67 | { |
68 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId); |
|
68 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getAllApps() |
79 | 79 | { |
80 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/apps', [ |
|
80 | + $response = $this->client->request('GET', $this->getEurekaUri().'/apps', [ |
|
81 | 81 | 'headers' => [ |
82 | 82 | 'Accept' => 'application/json', |
83 | 83 | ], |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function getApp($appId) |
99 | 99 | { |
100 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/apps/' . $appId, [ |
|
100 | + $response = $this->client->request('GET', $this->getEurekaUri().'/apps/'.$appId, [ |
|
101 | 101 | 'headers' => [ |
102 | 102 | 'Accept' => 'application/json', |
103 | 103 | ], |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public function getAppInstance($appId, $instanceId) |
120 | 120 | { |
121 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId, [ |
|
121 | + $response = $this->client->request('GET', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId, [ |
|
122 | 122 | 'headers' => [ |
123 | 123 | 'Accept' => 'application/json', |
124 | 124 | ], |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function getInstance($instanceId) |
140 | 140 | { |
141 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/instances/' . $instanceId, [ |
|
141 | + $response = $this->client->request('GET', $this->getEurekaUri().'/instances/'.$instanceId, [ |
|
142 | 142 | 'headers' => [ |
143 | 143 | 'Accept' => 'application/json', |
144 | 144 | ], |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function takeInstanceOut($appId, $instanceId) |
159 | 159 | { |
160 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/status', [ |
|
160 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/status', [ |
|
161 | 161 | 'query' => [ |
162 | 162 | 'value' => 'OUT_OF_SERVICE', |
163 | 163 | ], |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function putInstanceBack($appId, $instanceId) |
178 | 178 | { |
179 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/status', [ |
|
179 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/status', [ |
|
180 | 180 | 'query' => [ |
181 | 181 | 'value' => 'UP', |
182 | 182 | ], |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function updateAppInstanceMetadata($appId, $instanceId, array $metadata) |
198 | 198 | { |
199 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/metadata', [ |
|
199 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/metadata', [ |
|
200 | 200 | 'query' => $metadata, |
201 | 201 | ]); |
202 | 202 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function getInstancesByVipAddress($vipAddress) |
211 | 211 | { |
212 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/vips/' . $vipAddress, [ |
|
212 | + $response = $this->client->request('GET', $this->getEurekaUri().'/vips/'.$vipAddress, [ |
|
213 | 213 | 'headers' => [ |
214 | 214 | 'Accept' => 'application/json', |
215 | 215 | ], |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function getInstancesBySecureVipAddress($secureVipAddress) |
227 | 227 | { |
228 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/svips/' . $secureVipAddress, [ |
|
228 | + $response = $this->client->request('GET', $this->getEurekaUri().'/svips/'.$secureVipAddress, [ |
|
229 | 229 | 'headers' => [ |
230 | 230 | 'Accept' => 'application/json', |
231 | 231 | ], |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | public function up(string $appId, string $instanceId) |
238 | 238 | { |
239 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/status', [ |
|
239 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/status', [ |
|
240 | 240 | 'query' => [ |
241 | 241 | 'value' => 'UP', |
242 | 242 | ], |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | public function down($appId, $instanceId) |
247 | 247 | { |
248 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/status', [ |
|
248 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/status', [ |
|
249 | 249 | 'query' => [ |
250 | 250 | 'value' => 'DOWN', |
251 | 251 | ], |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | public function getUpInstances($appId) |
262 | 262 | { |
263 | 263 | $apps = $this->getApp($appId); |
264 | - return array_filter($apps['application']['instance'], function ($instance) { |
|
264 | + return array_filter($apps['application']['instance'], function($instance) { |
|
265 | 265 | return $instance['status'] === 'UP'; |
266 | 266 | }); |
267 | 267 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | } else { |
281 | 281 | $parts = parse_url($instance['homePageUrl']); |
282 | 282 | if (!isset($parts['host'])) { |
283 | - throw new \RuntimeException('Invalid homePageUrl: ' . $instance['homePageUrl']); |
|
283 | + throw new \RuntimeException('Invalid homePageUrl: '.$instance['homePageUrl']); |
|
284 | 284 | } |
285 | 285 | $url = sprintf('%s://%s:%d', isset($parts['scheme']) ? $parts['scheme'] : 'http', $parts['host'], isset($parts['port']) ? $parts['port'] : 80); |
286 | 286 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $server[$headerServerMapping[$key]] = $value; |
52 | 52 | } else { |
53 | 53 | $key = str_replace('-', '_', $key); |
54 | - $server['http_' . $key] = $value; |
|
54 | + $server['http_'.$key] = $value; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | $server = array_change_key_case($server, CASE_UPPER); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | && isset($_SERVER['QUERY_STRING']) |
66 | 66 | && $_SERVER['QUERY_STRING'] !== '' |
67 | 67 | ) { |
68 | - $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
68 | + $_SERVER['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | // Fix argv & argc |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | self::autoload($this->conf['root_path']); |
79 | 79 | |
80 | 80 | // Make kernel for Laravel |
81 | - $app = require $this->conf['root_path'] . '/bootstrap/app.php'; |
|
81 | + $app = require $this->conf['root_path'].'/bootstrap/app.php'; |
|
82 | 82 | $kernel = $this->conf['is_lumen'] ? null : $app->make(HttpKernel::class); |
83 | 83 | |
84 | 84 | // Boot |
@@ -98,14 +98,14 @@ discard block |
||
98 | 98 | { |
99 | 99 | $cfgPaths = [ |
100 | 100 | // Framework default configuration |
101 | - $this->conf['root_path'] . '/vendor/laravel/lumen-framework/config/', |
|
101 | + $this->conf['root_path'].'/vendor/laravel/lumen-framework/config/', |
|
102 | 102 | // App configuration |
103 | - $this->conf['root_path'] . '/config/', |
|
103 | + $this->conf['root_path'].'/config/', |
|
104 | 104 | ]; |
105 | 105 | |
106 | 106 | $keys = []; |
107 | 107 | foreach ($cfgPaths as $cfgPath) { |
108 | - $configs = (array)glob($cfgPath . '*.php'); |
|
108 | + $configs = (array) glob($cfgPath.'*.php'); |
|
109 | 109 | foreach ($configs as $config) { |
110 | 110 | $config = substr(basename($config), 0, -4); |
111 | 111 | $keys[$config] = $config; |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | |
120 | 120 | public static function autoload($rootPath) |
121 | 121 | { |
122 | - $autoload = $rootPath . '/bootstrap/autoload.php'; |
|
122 | + $autoload = $rootPath.'/bootstrap/autoload.php'; |
|
123 | 123 | if (file_exists($autoload)) { |
124 | 124 | require_once $autoload; |
125 | 125 | } else { |
126 | - require_once $rootPath . '/vendor/autoload.php'; |
|
126 | + require_once $rootPath.'/vendor/autoload.php'; |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | // prefer content in response, secondly ob |
155 | - if (!($response instanceof StreamedResponse) && (string)$content === '' && ob_get_length() > 0) { |
|
155 | + if (!($response instanceof StreamedResponse) && (string) $content === '' && ob_get_length() > 0) { |
|
156 | 156 | $response->setContent(ob_get_contents()); |
157 | 157 | } |
158 | 158 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $uri = urldecode($uri); |
171 | 171 | |
172 | 172 | $publicPath = $this->conf['static_path']; |
173 | - $requestFile = $publicPath . $uri; |
|
173 | + $requestFile = $publicPath.$uri; |
|
174 | 174 | if (is_file($requestFile)) { |
175 | 175 | return $this->createStaticResponse($requestFile, $request); |
176 | 176 | } |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | |
187 | 187 | protected function lookupIndex($folder) |
188 | 188 | { |
189 | - $folder = rtrim($folder, '/') . '/'; |
|
189 | + $folder = rtrim($folder, '/').'/'; |
|
190 | 190 | foreach (['index.html', 'index.htm'] as $index) { |
191 | - $tmpFile = $folder . $index; |
|
191 | + $tmpFile = $folder.$index; |
|
192 | 192 | if (is_file($tmpFile)) { |
193 | 193 | return $tmpFile; |
194 | 194 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | public function bindSwoole($swoole) |
231 | 231 | { |
232 | - $this->currentApp->singleton('swoole', function () use ($swoole) { |
|
232 | + $this->currentApp->singleton('swoole', function() use ($swoole) { |
|
233 | 233 | return $swoole; |
234 | 234 | }); |
235 | 235 | } |