From d24c3bb1cbea6b961635ea78a8577e85f83b6458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 23 Apr 2023 20:14:46 +0200 Subject: [PATCH] RVRNEXT-5 move private methods to the end of CommunityController --- src/Controller/CommunityController.php | 36 +++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Controller/CommunityController.php b/src/Controller/CommunityController.php index baa182d..fb5eeca 100644 --- a/src/Controller/CommunityController.php +++ b/src/Controller/CommunityController.php @@ -85,15 +85,6 @@ class CommunityController implements IAuthenticationRequired ]); } - private function getMembers(Community $community): array - { - $members = iterator_to_array($this->communityMemberRepository->getAllByCommunity($community, true)); - usort($members, function($a, $b) { - return strnatcmp($a->getUser()->getDisplayName(), $b->getUser()->getDisplayName()); - }); - return $members; - } - public function newMember(): ?IContent { if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) { @@ -160,15 +151,6 @@ class CommunityController implements IAuthenticationRequired ]); } - private function getCurrencies(Community $community): array - { - $currencies = iterator_to_array($this->currencyRepository->getAllByCommunity($community)); - usort($currencies, function($a, $b) { - return strnatcmp($a->getCode(), $b->getCode()); - }); - return $currencies; - } - public function newCurrency(): ?IContent { if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) { @@ -269,6 +251,24 @@ class CommunityController implements IAuthenticationRequired ]); } + private function getMembers(Community $community): array + { + $members = iterator_to_array($this->communityMemberRepository->getAllByCommunity($community, true)); + usort($members, function($a, $b) { + return strnatcmp($a->getUser()->getDisplayName(), $b->getUser()->getDisplayName()); + }); + return $members; + } + + private function getCurrencies(Community $community): array + { + $currencies = iterator_to_array($this->currencyRepository->getAllByCommunity($community)); + usort($currencies, function($a, $b) { + return strnatcmp($a->getCode(), $b->getCode()); + }); + return $currencies; + } + private function checkPermission( int $communityId, bool $needToBeOwner,