diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php index 8cf0c3118..e62368efe 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php @@ -20,6 +20,7 @@ use Chill\PersonBundle\Form\PersonType; use Chill\PersonBundle\Privacy\PrivacyEvent; use Chill\PersonBundle\Repository\PersonRepository; use Chill\PersonBundle\Search\SimilarPersonMatcher; +use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use Psr\Log\LoggerInterface; 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\Security\Core\Security; use Symfony\Component\Validator\Validator\ValidatorInterface; -use Symfony\Contracts\Translation\TranslatorInterface; +use Symfony\Contracts\Translation\TranslatorInterface; use function count; use function hash; use function implode; @@ -265,13 +266,12 @@ final class PersonController extends AbstractController $address = $form->get('address')->getData(); $addressForm = $form->get('addressForm')->getData(); - if(null !== $address and $addressForm){ - + if (null !== $address && $addressForm) { $household = new Household(); $member = new HouseholdMember(); $member->setPerson($person); - $member->setStartDate(new \DateTimeImmutable()); + $member->setStartDate(new DateTimeImmutable()); $household->addMember($member); $household->setForceAddress($address); diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdMember.php b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdMember.php index 4b71ad560..e738528c9 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdMember.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdMember.php @@ -208,7 +208,8 @@ class HouseholdMember } $this->position = $position; - if (null !== $position){ + + if (null !== $position) { $this->shareHousehold = $position->getShareHousehold(); } diff --git a/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php b/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php index ef255628e..0d854b681 100644 --- a/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php @@ -28,7 +28,6 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\EmailType; -use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -84,11 +83,11 @@ final class CreationPersonType extends AbstractType ->add('addressForm', CheckboxType::class, [ 'label' => 'Create a household and add an address', 'required' => false, - 'mapped' => false + 'mapped' => false, ]) ->add('address', PickAddressType::class, [ 'required' => false, - 'mapped' => false + 'mapped' => false, ]); if ($this->askCenters) { diff --git a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php index 01d6d7e9c..8ae41a98b 100644 --- a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php +++ b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php @@ -137,7 +137,6 @@ class MembersEditor } } - $this->membershipsAffected[] = $membership; $this->persistables[] = $membership; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php index 6e1f9da6c..f77a8c669 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php @@ -117,7 +117,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize $context ); - if (\array_key_exists('position', $concerned)) { + if (array_key_exists('position', $concerned)) { $position = $this->denormalizer->denormalize( $concerned['position'] ?? null, Position::class,