Skip to content

Commit

Permalink
bug #343 Fixing phpcs and making the registration controller more exp…
Browse files Browse the repository at this point in the history
…licit (weaverryan)

This PR was merged into the 1.0-dev branch.

Discussion
----------

Fixing phpcs and making the registration controller more explicit

Fixes #339 and #333 (comment)

Commits
-------

4e4fe06 Fixing phpcs and making the registration controller more explicit
  • Loading branch information
weaverryan committed Dec 24, 2018
2 parents 2ba2b56 + 4e4fe06 commit bc20c9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Resources/skeleton/form/Type.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('<?= $form_field ?>', <?= $typeOptions['type'] ?>::class)
<?php else: ?>
->add('<?= $form_field ?>', <?= $typeOptions['type'] ? ($typeOptions['type'].'::class') : 'null' ?>, [
<?= $typeOptions['options_code'] ?>
<?= $typeOptions['options_code']."\n" ?>
])
<?php endif; ?>
<?php endforeach; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ class <?= $class_name; ?> extends <?= $parent_class_name; ?><?= "\n" ?>
*/
public function register(Request $request, UserPasswordEncoderInterface $passwordEncoder<?= $authenticator_full_class_name ? sprintf(', GuardAuthenticatorHandler $guardHandler, %s $authenticator', $authenticator_class_name) : '' ?>): Response
{
$form = $this->createForm(<?= $form_class_name ?>::class);
$user = new <?= $user_class_name ?>();
$form = $this->createForm(<?= $form_class_name ?>::class, $user);
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
/** @var <?= $user_class_name ?> */
$user = $form->getData();

// encode the plain password
$user->set<?= ucfirst($password_field) ?>(
$passwordEncoder->encodePassword(
Expand Down

0 comments on commit bc20c9e

Please sign in to comment.