From 4e4fe062dacb583a0762b074b9269aee914e8f10 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 21 Dec 2018 21:05:42 -0500 Subject: [PATCH] Fixing phpcs and making the registration controller more explicit --- src/Resources/skeleton/form/Type.tpl.php | 2 +- .../skeleton/registration/RegistrationController.tpl.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Resources/skeleton/form/Type.tpl.php b/src/Resources/skeleton/form/Type.tpl.php index 546c817b5..8d2e03399 100644 --- a/src/Resources/skeleton/form/Type.tpl.php +++ b/src/Resources/skeleton/form/Type.tpl.php @@ -27,7 +27,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) ->add('', ::class) ->add('', , [ - + ]) diff --git a/src/Resources/skeleton/registration/RegistrationController.tpl.php b/src/Resources/skeleton/registration/RegistrationController.tpl.php index 6d8e30706..2d48ea81d 100644 --- a/src/Resources/skeleton/registration/RegistrationController.tpl.php +++ b/src/Resources/skeleton/registration/RegistrationController.tpl.php @@ -23,13 +23,11 @@ class extends */ public function register(Request $request, UserPasswordEncoderInterface $passwordEncoder): Response { - $form = $this->createForm(::class); + $user = new (); + $form = $this->createForm(::class, $user); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { - /** @var */ - $user = $form->getData(); - // encode the plain password $user->set( $passwordEncoder->encodePassword(