From 006dbcf4cec84b98a60432ed2913a8be515b7898 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 25 Sep 2022 21:16:56 +0200 Subject: [PATCH] some code-beautification --- src/Module/Api/Mastodon/PushSubscription.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Module/Api/Mastodon/PushSubscription.php b/src/Module/Api/Mastodon/PushSubscription.php index 225d61b68..4facfe191 100644 --- a/src/Module/Api/Mastodon/PushSubscription.php +++ b/src/Module/Api/Mastodon/PushSubscription.php @@ -24,6 +24,7 @@ namespace Friendica\Module\Api\Mastodon; use Friendica\App; use Friendica\Core\L10n; use Friendica\Factory\Api\Mastodon\Error; +use Friendica\Factory\Api\Mastodon\Subscription as SubscriptionFactory; use Friendica\Model\Subscription; use Friendica\Module\Api\ApiResponse; use Friendica\Module\BaseApi; @@ -36,12 +37,12 @@ use Psr\Log\LoggerInterface; */ class PushSubscription extends BaseApi { - /** @var \Friendica\Factory\Api\Mastodon\Subscription */ + /** @var SubscriptionFactory */ protected $subscriptionFac; /** @var Error */ protected $errorFac; - public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, \Friendica\Factory\Api\Mastodon\Subscription $subscriptionFac, Error $errorFac, array $server, array $parameters = []) + public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, SubscriptionFactory $subscriptionFac, Error $errorFac, array $server, array $parameters = []) { parent::__construct($app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); @@ -111,8 +112,10 @@ class PushSubscription extends BaseApi $ret = Subscription::update($application['id'], $uid, $fields); - $this->logger->info('Subscription updated', ['result' => $ret, 'application-id' => $application['id'], - 'uid' => $uid, 'fields' => $fields]); + $this->logger->info('Subscription updated', [ + 'result' => $ret, 'application-id' => $application['id'], + 'uid' => $uid, 'fields' => $fields + ]); $subscriptionObj = $this->subscriptionFac->createForApplicationIdAndUserId($application['id'], $uid); $this->response->exitWithJson($subscriptionObj->toArray()); @@ -126,8 +129,10 @@ class PushSubscription extends BaseApi $ret = Subscription::delete($application['id'], $uid); - $this->logger->info('Subscription deleted', ['result' => $ret, 'application-id' => $application['id'], - 'uid' => $uid]); + $this->logger->info('Subscription deleted', [ + 'result' => $ret, 'application-id' => $application['id'], + 'uid' => $uid + ]); $this->response->exitWithJson([]); }