From 00d957dfdc0a5099e8286c7be76d81f7832772c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Wed, 25 Jul 2018 01:57:49 +0200 Subject: [PATCH] [curweather] CR request: - added/removed extra spaces - removed trailing spaces - nicely indented code block with `'$foo' => 'bar'` --- curweather/curweather.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/curweather/curweather.php b/curweather/curweather.php index 47bff71f..c632904d 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -49,6 +49,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti return $cached; } } + try { $res = new SimpleXMLElement(Network::fetchUrl($url)); } catch (Exception $e) { @@ -98,7 +99,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti function curweather_network_mod_init(App $a, &$b) { - if (! intval(PConfig::get(local_user(), 'curweather','curweather_enable'))) { + if (!intval(PConfig::get(local_user(), 'curweather', 'curweather_enable'))) { return; } @@ -215,7 +216,7 @@ function curweather_addon_settings(App $a, &$s) // for accessing the API of openweathermap function curweather_addon_admin_post(App $a) { - if (! is_site_admin()) { + if (!is_site_admin()) { return; } @@ -241,15 +242,15 @@ function curweather_addon_admin(App $a, &$o) $o = replace_macros ($t, [ '$submit' => L10n::t('Save Settings'), '$cachetime' => [ - 'cachetime', - L10n::t('Caching Interval'), - $cachetime, + 'cachetime', + L10n::t('Caching Interval'), + $cachetime, L10n::t('For how long should the weather data be cached? Choose according your OpenWeatherMap account type.'), [ - '0'=>L10n::t('no cache'), - '300'=>'5 '.L10n::t('minutes'), - '900'=>'15 '.L10n::t('minutes'), - '1800'=>'30 '.L10n::t('minutes'), - '3600'=>'60 '.L10n::t('minutes') + '0' => L10n::t('no cache'), + '300' => '5 ' . L10n::t('minutes'), + '900' => '15 ' . L10n::t('minutes'), + '1800' => '30 ' . L10n::t('minutes'), + '3600' => '60 ' . L10n::t('minutes') ] ], '$appid' => ['appid', L10n::t('Your APPID'), $appid, L10n::t('Your API key provided by OpenWeatherMap')]