Passed
Push — master ( 6d21e0...1f4c02 )
by Morris
14:24 queued 10s
created
apps/weather_status/lib/AppInfo/Application.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 		parent::__construct(self::APP_ID, $urlParams);
55 55
 
56 56
 		$dispatcher = $this->getContainer()->query(IEventDispatcher::class);
57
-		$dispatcher->addListener(RegisterWidgetEvent::class, function (Event $e) {
57
+		$dispatcher->addListener(RegisterWidgetEvent::class, function(Event $e) {
58 58
 			Util::addScript(self::APP_ID, 'weather-status');
59 59
 		});
60 60
 	}
Please login to merge, or discard this patch.
apps/weather_status/lib/Service/WeatherStatusService.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 */
211 211
 	private function getAltitude(float $lat, float $lon): float {
212 212
 		$params = [
213
-			'locations' => $lat . ',' . $lon,
213
+			'locations' => $lat.','.$lon,
214 214
 		];
215 215
 		$url = 'https://api.opentopodata.org/v1/srtm30m';
216 216
 		$result = $this->requestJSON($url, $params);
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
 			}
244 244
 			// post code
245 245
 			if (isset($jsonAddr['postcode'])) {
246
-				$cityAddress .= ', ' . $jsonAddr['postcode'];
246
+				$cityAddress .= ', '.$jsonAddr['postcode'];
247 247
 			}
248 248
 			// country
249 249
 			if (isset($jsonAddr['country'])) {
250
-				$cityAddress .= ', ' . $jsonAddr['country'];
250
+				$cityAddress .= ', '.$jsonAddr['country'];
251 251
 				return $cityAddress;
252 252
 			} else {
253 253
 				return $json['display_name'];
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 			'namedetails' => '1',
301 301
 			'limit' => '1',
302 302
 		];
303
-		$url = 'https://nominatim.openstreetmap.org/search/' . $address;
303
+		$url = 'https://nominatim.openstreetmap.org/search/'.$address;
304 304
 		$results = $this->requestJSON($url, $params);
305 305
 		if (count($results) > 0) {
306 306
 			return $results[0];
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 	 */
379 379
 	private function requestJSON(string $url, array $params = []): array {
380 380
 		if (isset($this->cache)) {
381
-			$cacheKey = $url . '|' . implode(',', $params) . '|' . implode(',', array_keys($params));
381
+			$cacheKey = $url.'|'.implode(',', $params).'|'.implode(',', array_keys($params));
382 382
 			if ($this->cache->hasKey($cacheKey)) {
383 383
 				return $this->cache->get($cacheKey);
384 384
 			}
@@ -386,14 +386,14 @@  discard block
 block discarded – undo
386 386
 		try {
387 387
 			$options = [
388 388
 				'headers' => [
389
-					'User-Agent' => 'NextcloudWeatherStatus/' . $this->version . ' nextcloud.com'
389
+					'User-Agent' => 'NextcloudWeatherStatus/'.$this->version.' nextcloud.com'
390 390
 				],
391 391
 			];
392 392
 
393 393
 			$reqUrl = $url;
394 394
 			if (count($params) > 0) {
395 395
 				$paramsContent = http_build_query($params);
396
-				$reqUrl = $url . '?' . $paramsContent;
396
+				$reqUrl = $url.'?'.$paramsContent;
397 397
 			}
398 398
 
399 399
 			$response = $this->client->get($reqUrl, $options);
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 				return $json;
423 423
 			}
424 424
 		} catch (\Exception $e) {
425
-			$this->logger->warning($url . 'API error : ' . $e, ['app' => Application::APP_ID]);
425
+			$this->logger->warning($url.'API error : '.$e, ['app' => Application::APP_ID]);
426 426
 			return ['error' => $e->getMessage()];
427 427
 		}
428 428
 	}
Please login to merge, or discard this patch.