Passed
Push — master ( b794fa...797527 )
by Christoph
82:28 queued 66:03
created
apps/weather_status/lib/Service/WeatherStatusService.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	private function getAltitude(float $lat, float $lon): float {
227 227
 		$params = [
228
-			'locations' => $lat . ',' . $lon,
228
+			'locations' => $lat.','.$lon,
229 229
 		];
230 230
 		$url = 'https://api.opentopodata.org/v1/srtm30m';
231 231
 		$result = $this->requestJSON($url, $params);
@@ -258,11 +258,11 @@  discard block
 block discarded – undo
258 258
 			}
259 259
 			// post code
260 260
 			if (isset($jsonAddr['postcode'])) {
261
-				$cityAddress .= ', ' . $jsonAddr['postcode'];
261
+				$cityAddress .= ', '.$jsonAddr['postcode'];
262 262
 			}
263 263
 			// country
264 264
 			if (isset($jsonAddr['country'])) {
265
-				$cityAddress .= ', ' . $jsonAddr['country'];
265
+				$cityAddress .= ', '.$jsonAddr['country'];
266 266
 				return $cityAddress;
267 267
 			} else {
268 268
 				return $json['display_name'];
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 			'namedetails' => '1',
316 316
 			'limit' => '1',
317 317
 		];
318
-		$url = 'https://nominatim.openstreetmap.org/search/' . $address;
318
+		$url = 'https://nominatim.openstreetmap.org/search/'.$address;
319 319
 		$results = $this->requestJSON($url, $params);
320 320
 		if (count($results) > 0) {
321 321
 			return $results[0];
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 * @return array which contains the error message or the parsed JSON result
393 393
 	 */
394 394
 	private function requestJSON(string $url, array $params = []): array {
395
-		$cacheKey = $url . '|' . implode(',', $params) . '|' . implode(',', array_keys($params));
395
+		$cacheKey = $url.'|'.implode(',', $params).'|'.implode(',', array_keys($params));
396 396
 		$cacheValue = $this->cache->get($cacheKey);
397 397
 		if ($cacheValue !== null) {
398 398
 			return $cacheValue;
@@ -401,14 +401,14 @@  discard block
 block discarded – undo
401 401
 		try {
402 402
 			$options = [
403 403
 				'headers' => [
404
-					'User-Agent' => 'NextcloudWeatherStatus/' . $this->version . ' nextcloud.com'
404
+					'User-Agent' => 'NextcloudWeatherStatus/'.$this->version.' nextcloud.com'
405 405
 				],
406 406
 			];
407 407
 
408 408
 			$reqUrl = $url;
409 409
 			if (count($params) > 0) {
410 410
 				$paramsContent = http_build_query($params);
411
-				$reqUrl = $url . '?' . $paramsContent;
411
+				$reqUrl = $url.'?'.$paramsContent;
412 412
 			}
413 413
 
414 414
 			$response = $this->client->get($reqUrl, $options);
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 				return $json;
438 438
 			}
439 439
 		} catch (\Exception $e) {
440
-			$this->logger->warning($url . 'API error : ' . $e, ['app' => Application::APP_ID]);
440
+			$this->logger->warning($url.'API error : '.$e, ['app' => Application::APP_ID]);
441 441
 			return ['error' => $e->getMessage()];
442 442
 		}
443 443
 	}
Please login to merge, or discard this patch.