forked from friendica/friendica-addons
[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:
parent
aaab504eb2
commit
c7764068cc
|
@ -6,6 +6,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Addon;
|
||||
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()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$bl_post = PConfig::get(local_user(), 'blogger', 'post');
|
||||
|
||||
if (intval($bl_post) == 1) {
|
||||
$bl_defpost = PConfig::get(local_user(), 'blogger', 'post_by_default');
|
||||
$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()) {
|
||||
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_by_default', intval($_POST['bl_bydefault']));
|
||||
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
|
||||
|
||||
|
@ -161,10 +163,7 @@ function blogger_post_local(&$a, &$b)
|
|||
$b['postopts'] .= 'blogger';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function blogger_send(&$a, &$b)
|
||||
function blogger_send(App $a, array &$b)
|
||||
{
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue