Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2022-05-19 23:53:52 +0300
committerdartcafe <github@dartcafe.de>2022-05-19 23:53:52 +0300
commit5fda6e2a724f2bbde01b3c211b912efc10d09d0f (patch)
tree516d22beb6a7c4b4b3d55196910b12025fc8e1da /lib/Controller/SubscriptionController.php
parentcb574cdb0fb72987562947ef1114d6395629f340 (diff)
code maintenance
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'lib/Controller/SubscriptionController.php')
-rw-r--r--lib/Controller/SubscriptionController.php12
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, '')]);
}
}