[blogger] Cleanups: (#656)

* [blogger] Cleanups:
- used `use Friendica\App;`
- added type-hints for `App` and `array` where applyable
- removed extra space
- added other spaces

* [blogger]:
- ops, curly brace in new line in function/method declaration
- proper way for x() replacement
This commit is contained in:
Roland Häder 2018-07-21 04:21:06 +02:00 committed by Hypolite Petovan
parent aaab504eb2
commit c7764068cc

View file

@ -6,6 +6,7 @@
* *
*/ */
use Friendica\App;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -36,13 +37,14 @@ function blogger_uninstall()
} }
function blogger_jot_nets(&$a, &$b) function blogger_jot_nets(App $a, &$b)
{ {
if (!local_user()) { if (!local_user()) {
return; return;
} }
$bl_post = PConfig::get(local_user(), 'blogger', 'post'); $bl_post = PConfig::get(local_user(), 'blogger', 'post');
if (intval($bl_post) == 1) { if (intval($bl_post) == 1) {
$bl_defpost = PConfig::get(local_user(), 'blogger', 'post_by_default'); $bl_defpost = PConfig::get(local_user(), 'blogger', 'post_by_default');
$selected = ((intval($bl_defpost) == 1) ? ' checked="checked" ' : ''); $selected = ((intval($bl_defpost) == 1) ? ' checked="checked" ' : '');
@ -52,7 +54,7 @@ function blogger_jot_nets(&$a, &$b)
} }
function blogger_settings(&$a, &$s) function blogger_settings(App $a, &$s)
{ {
if (! local_user()) { if (! local_user()) {
return; return;
@ -115,9 +117,9 @@ function blogger_settings(&$a, &$s)
} }
function blogger_settings_post(&$a, &$b) function blogger_settings_post(App $a, array &$b)
{ {
if (x($_POST, 'blogger-submit')) { if (!empty($_POST['blogger-submit'])) {
PConfig::set(local_user(), 'blogger', 'post', intval($_POST['blogger'])); PConfig::set(local_user(), 'blogger', 'post', intval($_POST['blogger']));
PConfig::set(local_user(), 'blogger', 'post_by_default', intval($_POST['bl_bydefault'])); PConfig::set(local_user(), 'blogger', 'post_by_default', intval($_POST['bl_bydefault']));
PConfig::set(local_user(), 'blogger', 'bl_username', trim($_POST['bl_username'])); PConfig::set(local_user(), 'blogger', 'bl_username', trim($_POST['bl_username']));
@ -126,7 +128,7 @@ function blogger_settings_post(&$a, &$b)
} }
} }
function blogger_post_local(&$a, &$b) function blogger_post_local(App $a, array &$b)
{ {
// This can probably be changed to allow editing by pointing to a different API endpoint // This can probably be changed to allow editing by pointing to a different API endpoint
@ -161,10 +163,7 @@ function blogger_post_local(&$a, &$b)
$b['postopts'] .= 'blogger'; $b['postopts'] .= 'blogger';
} }
function blogger_send(App $a, array &$b)
function blogger_send(&$a, &$b)
{ {
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
return; return;