Commit fbcc1f93 authored by Keval Pandya's avatar Keval Pandya

[Fix-code issues] Improved the code

parent d6d34169
Pipeline #6673 failed with stages
in 14 seconds
......@@ -48,13 +48,13 @@ class CommunityMembershipController extends ActionController
public function updateAction(\T3o\T3omy\Domain\Model\CommunityMembership $user)
{
$decide = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('decide');
if($user == 1){
if($decide){
if ($user == 1) {
if ($decide) {
$user->setCommunityMembership(1);
$user->setCommunityMembershipInformStatus(1);
$this->communityMembershipRepository->update($user);
$this->redirectToUri($this->settings['location']);
}else{
} else {
$user->setCommunityMembershipInformStatus(1);
$this->communityMembershipRepository->update($user);
$uri = $this->uriBuilder->reset()
......@@ -71,15 +71,16 @@ class CommunityMembershipController extends ActionController
*
* @return void
*/
public function determineMembershipAction(){
if(isset($GLOBALS['TSFE']->fe_user->user['uid'])){
public function determineMembershipAction()
{
if (isset($GLOBALS['TSFE']->fe_user->user['uid'])) {
$user = $this->communityMembershipRepository->findCommunityMembershipStatus(
$GLOBALS['TSFE']->fe_user->user['uid']
);
if(isset($user[0])){
if (isset($user[0])) {
$this->view->assign('communityMembershipStatus', true);
$this->view->assign('user', $user[0]);
}else{
} else {
$this->view->assign('communityMembershipStatus', false);
}
}
......
<?php
namespace T3o\T3omy\Domain\Model;
/***
......@@ -41,6 +42,16 @@ class CommunityMembership extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
return $this->communityMembership;
}
/**
* Returns the boolean state of communityMembership
*
* @return bool
*/
public function isCommunityMembership()
{
return $this->communityMembership;
}
/**
* Sets the communityMembership
*
......@@ -53,21 +64,21 @@ class CommunityMembership extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
}
/**
* Returns the boolean state of communityMembership
* Returns the communityMembershipInformStatus
*
* @return bool
* @return bool $communityMembershipInformStatus
*/
public function isCommunityMembership()
public function getCommunityMembershipInformStatus()
{
return $this->communityMembership;
return $this->communityMembershipInformStatus;
}
/**
* Returns the communityMembershipInformStatus
* Returns the boolean state of communityMembershipInformStatus
*
* @return bool $communityMembershipInformStatus
* @return bool
*/
public function getCommunityMembershipInformStatus()
public function isCommunityMembershipInformStatus()
{
return $this->communityMembershipInformStatus;
}
......@@ -82,14 +93,4 @@ class CommunityMembership extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
{
$this->communityMembershipInformStatus = $communityMembershipInformStatus;
}
/**
* Returns the boolean state of communityMembershipInformStatus
*
* @return bool
*/
public function isCommunityMembershipInformStatus()
{
return $this->communityMembershipInformStatus;
}
}
<?php
declare(strict_types=1);
declare(strict_types = 1);
namespace T3o\T3omy\Domain\Repository;
......
......@@ -71,9 +71,7 @@ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['password_changed'][] = \T3o\T
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'][] = \T3o\T3omy\Hooks\ReactivateUserHook::class;
call_user_func(
function()
{
function () {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'T3o.T3omy',
'Communitymembership',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment