From 50d82f400429914b1ee298b5bd93cbb74b24632e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Fri, 6 Jul 2018 22:32:37 +0200 Subject: [PATCH] Continued: - removed optional "null", was not in original code - added spaces into SQL query - added space - added back & (call-by-reference) - removed no longer used parameter - added type-hint App MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- blockem/blockem.php | 3 ++- dwpost/dwpost.php | 4 ++-- fromgplus/fromgplus.php | 2 +- geocoordinates/geocoordinates.php | 2 +- geonames/geonames.php | 2 +- group_text/group_text.php | 2 +- ijpost/ijpost.php | 2 +- irc/irc.php | 2 +- krynn/krynn.php | 2 +- libertree/libertree.php | 2 +- pageheader/pageheader.php | 2 +- statusnet/statusnet.php | 2 +- testdrive/testdrive.php | 9 +++++---- tumblr/tumblr.php | 2 +- twitter/twitter.php | 4 ++-- 15 files changed, 22 insertions(+), 20 deletions(-) diff --git a/blockem/blockem.php b/blockem/blockem.php index a4b3c49e..ce6baf13 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -139,7 +139,8 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data) } } -function blockem_display_item(App $a, array &$b = null) { +function blockem_display_item(App $a, array &$b) +{ if (strstr($b['output']['body'],'id="blockem-wrap-')) { $b['output']['thumb'] = $a->get_baseurl() . "/images/person-80.jpg"; } diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index b0d68e84..25d5dfc6 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -50,7 +50,7 @@ function dwpost_jot_nets(App $a, &$b) { } -function dwpost_settings(App $a, $s) { +function dwpost_settings(App $a, &$s) { if(! local_user()) return; @@ -171,7 +171,7 @@ function dwpost_send(App $a, array &$b) { $tz = 'UTC'; - $x = q("SELECT `timezone` FROM `user` WHERE `uid`=%d LIMIT 1", + $x = q("SELECT `timezone` FROM `user` WHERE `uid` = %d LIMIT 1", intval($b['uid']) ); diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 4ee7c085..119d6721 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -39,7 +39,7 @@ function fromgplus_uninstall() { Addon::unregisterHook('addon_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); } -function fromgplus_addon_settings(App $a, $s) { +function fromgplus_addon_settings(App $a, &$s) { if(! local_user()) return; diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index d6037481..03f5dd50 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -40,7 +40,7 @@ function geocoordinates_resolve_item(array &$item) $language = Config::get("geocoordinates", "language", "de"); - $coords = explode(' ',$item["coord"]); + $coords = explode(' ', $item["coord"]); if (count($coords) < 2) { return; diff --git a/geonames/geonames.php b/geonames/geonames.php index 754e59e7..786bc553 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -168,7 +168,7 @@ function geonames_addon_admin_post($a,$post) { -function geonames_addon_admin(App $a, $s) { +function geonames_addon_admin(App $a, &$s) { if(! local_user()) return; diff --git a/group_text/group_text.php b/group_text/group_text.php index e7ef92fa..5c571e7e 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -58,7 +58,7 @@ function group_text_settings_post($a,$post) { -function group_text_settings(App $a, $s) { +function group_text_settings(App $a, &$s) { if(! local_user()) return; diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index e6eff3d8..de3fd38e 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -169,7 +169,7 @@ function ijpost_send(App $a, array &$b) { $tz = 'UTC'; - $x = q("SELECT `timezone` FROM `user` WHERE `uid`=%d LIMIT 1", + $x = q("SELECT `timezone` FROM `user` WHERE `uid` = %d LIMIT 1", intval($b['uid']) ); diff --git a/irc/irc.php b/irc/irc.php index 41f857ea..3a76fa88 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -26,7 +26,7 @@ function irc_uninstall() { } -function irc_addon_settings(App $a, $s) { +function irc_addon_settings(App $a, &$s) { if(! local_user()) return; diff --git a/krynn/krynn.php b/krynn/krynn.php index 34b3f762..87c406d4 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -136,7 +136,7 @@ function krynn_settings_post($a,$post) { -function krynn_settings(App $a, $s) { +function krynn_settings(App $a, &$s) { if(! local_user()) return; diff --git a/libertree/libertree.php b/libertree/libertree.php index e45e9694..f143c78a 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -45,7 +45,7 @@ function libertree_jot_nets(App $a, &$b) { } -function libertree_settings(App $a,&$s) { +function libertree_settings(App $a, &$s) { if(! local_user()) return; diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php index a3665d75..19bd7b32 100644 --- a/pageheader/pageheader.php +++ b/pageheader/pageheader.php @@ -35,7 +35,7 @@ function pageheader_uninstall() { -function pageheader_addon_settings(App $a, $s) { +function pageheader_addon_settings(App $a, &$s) { if(! is_site_admin()) diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 79bfe59e..1645541e 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -712,7 +712,7 @@ function statusnet_prepare_body(App $a, array &$b) } } -function statusnet_cron(App $a, array &$b = null) +function statusnet_cron(App $a) { $last = Config::get('statusnet', 'last_poll'); diff --git a/testdrive/testdrive.php b/testdrive/testdrive.php index 16c21554..c2d107ab 100644 --- a/testdrive/testdrive.php +++ b/testdrive/testdrive.php @@ -35,16 +35,17 @@ function testdrive_uninstall() { } -function testdrive_load_config(\Friendica\App $a) +function testdrive_load_config(App $a) { $a->loadConfigFile(__DIR__. '/config/testdrive.ini.php'); } -function testdrive_globaldir_update($a,&$b) { +function testdrive_globaldir_update(App $a, &$b) +{ $b['url'] = ''; } -function testdrive_register_account($a,$b) { +function testdrive_register_account(App $a, $b) { $uid = $b; @@ -60,7 +61,7 @@ function testdrive_register_account($a,$b) { }; -function testdrive_cron($a,$b) { +function testdrive_cron(App $a) { require_once('include/enotify.php'); $r = q("SELECT * FROM `user` WHERE `account_expires_on` < UTC_TIMESTAMP() + INTERVAL 5 DAY AND diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 4f3676b5..aa625ba7 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -188,7 +188,7 @@ function tumblr_jot_nets(App $a, &$b) { } -function tumblr_settings(App $a, $s) { +function tumblr_settings(App $a, &$s) { if (! local_user()) { return; diff --git a/twitter/twitter.php b/twitter/twitter.php index da0abf90..7db67a1c 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -658,7 +658,7 @@ function twitter_addon_admin(App $a, &$o) ]); } -function twitter_cron(App $a, array &$b) +function twitter_cron(App $a) { $last = Config::get('twitter', 'last_poll'); @@ -726,7 +726,7 @@ function twitter_cron(App $a, array &$b) Config::set('twitter', 'last_poll', time()); } -function twitter_expire(App $a, array &$b) +function twitter_expire(App $a) { $days = Config::get('twitter', 'expire');