diff options
author | dartcafe <github@dartcafe.de> | 2022-05-19 23:53:52 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2022-05-19 23:53:52 +0300 |
commit | 5fda6e2a724f2bbde01b3c211b912efc10d09d0f (patch) | |
tree | 516d22beb6a7c4b4b3d55196910b12025fc8e1da /lib/Controller/SubscriptionController.php | |
parent | cb574cdb0fb72987562947ef1114d6395629f340 (diff) |
code maintenance
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'lib/Controller/SubscriptionController.php')
-rw-r--r-- | lib/Controller/SubscriptionController.php | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Controller/SubscriptionController.php b/lib/Controller/SubscriptionController.php index b6289c46..e2a26a9f 100644 --- a/lib/Controller/SubscriptionController.php +++ b/lib/Controller/SubscriptionController.php @@ -50,9 +50,7 @@ class SubscriptionController extends Controller { * @NoAdminRequired */ public function get(int $pollId = 0): DataResponse { - return $this->response(function () use ($pollId) { - return ['subscribed' => $this->subscriptionService->get($pollId)]; - }); + return $this->response(fn () => ['subscribed' => $this->subscriptionService->get($pollId)]); } /** @@ -60,9 +58,7 @@ class SubscriptionController extends Controller { * @NoAdminRequired */ public function subscribe(int $pollId): DataResponse { - return $this->response(function () use ($pollId) { - return ['subscribed' => $this->subscriptionService->set(true, $pollId, '')]; - }); + return $this->response(fn () => ['subscribed' => $this->subscriptionService->set(true, $pollId, '')]); } /** @@ -70,8 +66,6 @@ class SubscriptionController extends Controller { * @NoAdminRequired */ public function unsubscribe(int $pollId): DataResponse { - return $this->response(function () use ($pollId) { - return ['subscribed' => $this->subscriptionService->set(false, $pollId, '')]; - }); + return $this->response(fn () => ['subscribed' => $this->subscriptionService->set(false, $pollId, '')]); } } |