php code style fix

This commit is contained in:
nobohan 2022-04-20 08:52:15 +02:00
parent 7a6aa6edcb
commit f2c60cfd20
5 changed files with 9 additions and 10 deletions

View File

@ -20,6 +20,7 @@ use Chill\PersonBundle\Form\PersonType;
use Chill\PersonBundle\Privacy\PrivacyEvent; use Chill\PersonBundle\Privacy\PrivacyEvent;
use Chill\PersonBundle\Repository\PersonRepository; use Chill\PersonBundle\Repository\PersonRepository;
use Chill\PersonBundle\Search\SimilarPersonMatcher; use Chill\PersonBundle\Search\SimilarPersonMatcher;
use DateTimeImmutable;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
@ -33,8 +34,8 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function count; use function count;
use function hash; use function hash;
use function implode; use function implode;
@ -265,13 +266,12 @@ final class PersonController extends AbstractController
$address = $form->get('address')->getData(); $address = $form->get('address')->getData();
$addressForm = $form->get('addressForm')->getData(); $addressForm = $form->get('addressForm')->getData();
if(null !== $address and $addressForm){ if (null !== $address && $addressForm) {
$household = new Household(); $household = new Household();
$member = new HouseholdMember(); $member = new HouseholdMember();
$member->setPerson($person); $member->setPerson($person);
$member->setStartDate(new \DateTimeImmutable()); $member->setStartDate(new DateTimeImmutable());
$household->addMember($member); $household->addMember($member);
$household->setForceAddress($address); $household->setForceAddress($address);

View File

@ -208,7 +208,8 @@ class HouseholdMember
} }
$this->position = $position; $this->position = $position;
if (null !== $position){
if (null !== $position) {
$this->shareHousehold = $position->getShareHousehold(); $this->shareHousehold = $position->getShareHousehold();
} }

View File

@ -28,7 +28,6 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\EmailType; use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@ -84,11 +83,11 @@ final class CreationPersonType extends AbstractType
->add('addressForm', CheckboxType::class, [ ->add('addressForm', CheckboxType::class, [
'label' => 'Create a household and add an address', 'label' => 'Create a household and add an address',
'required' => false, 'required' => false,
'mapped' => false 'mapped' => false,
]) ])
->add('address', PickAddressType::class, [ ->add('address', PickAddressType::class, [
'required' => false, 'required' => false,
'mapped' => false 'mapped' => false,
]); ]);
if ($this->askCenters) { if ($this->askCenters) {

View File

@ -137,7 +137,6 @@ class MembersEditor
} }
} }
$this->membershipsAffected[] = $membership; $this->membershipsAffected[] = $membership;
$this->persistables[] = $membership; $this->persistables[] = $membership;

View File

@ -117,7 +117,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
$context $context
); );
if (\array_key_exists('position', $concerned)) { if (array_key_exists('position', $concerned)) {
$position = $this->denormalizer->denormalize( $position = $this->denormalizer->denormalize(
$concerned['position'] ?? null, $concerned['position'] ?? null,
Position::class, Position::class,