Added more type-hints and imported App.

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2018-05-10 23:11:54 +02:00
parent 3a9a5fcde8
commit ed59c29484
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78

View file

@ -5,6 +5,8 @@
* Version: 0.1 * Version: 0.1
* Author: Michael Vogel <https://pirati.ca/profile/heluecht> * Author: Michael Vogel <https://pirati.ca/profile/heluecht>
*/ */
use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
@ -24,7 +26,7 @@ function geocoordinates_uninstall()
Addon::unregisterHook('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); Addon::unregisterHook('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
} }
function geocoordinates_resolve_item(&$item) function geocoordinates_resolve_item(array &$item)
{ {
if (!isset($item['coord']) || isset($item['location'])) { if (!isset($item['coord']) || isset($item['location'])) {
return; return;
@ -85,12 +87,12 @@ function geocoordinates_resolve_item(&$item)
Cache::set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]); Cache::set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]);
} }
function geocoordinates_post_hook($a, &$item) function geocoordinates_post_hook(App $a, array &$item)
{ {
geocoordinates_resolve_item($item); geocoordinates_resolve_item($item);
} }
function geocoordinates_addon_admin(&$a, &$o) function geocoordinates_addon_admin(App $a, &$o)
{ {
$t = get_markup_template("admin.tpl", "addon/geocoordinates/"); $t = get_markup_template("admin.tpl", "addon/geocoordinates/");
@ -102,7 +104,7 @@ function geocoordinates_addon_admin(&$a, &$o)
]); ]);
} }
function geocoordinates_addon_admin_post(&$a) function geocoordinates_addon_admin_post(App $a)
{ {
$api_key = ((x($_POST, 'api_key')) ? notags(trim($_POST['api_key'])) : ''); $api_key = ((x($_POST, 'api_key')) ? notags(trim($_POST['api_key'])) : '');
Config::set('geocoordinates', 'api_key', $api_key); Config::set('geocoordinates', 'api_key', $api_key);