getAccessChecker()->canManageAccesses()) { throw new Forbidden(); } $moderateCategory = $this->getModerateCategoryRepository()->getByUserIdAndCategoryId($userId, $categoryId); $moderateCategory->delete(); $this->response->redirect('/access/users/' . $userId . '/moderate-categories'); } private function getModerateCategoryRepository(): ModerateCategoryRepository { return new ModerateCategoryRepository(); } private function getUserRepository(): UserRepository { return new UserRepository(); } private function getAccessChecker(): AccessChecker { return new AccessChecker(); } }