upgraded FosUserBundle and Symfony 4.3 (#1005)

This commit is contained in:
Kevin Papst
2019-08-02 16:52:30 +02:00
committed by GitHub
parent 614a50ce0b
commit e11a2a6089
57 changed files with 1577 additions and 1184 deletions

View File

@@ -106,9 +106,6 @@ class CreateUserCommand extends Command
->setRoles(explode(',', $role))
;
$pwd = $this->encoder->encodePassword($user, $user->getPlainPassword());
$user->setPassword($pwd);
$errors = $this->validator->validate($user, null, ['Registration']);
if ($errors->count() > 0) {
/** @var \Symfony\Component\Validator\ConstraintViolation $error */
@@ -126,6 +123,9 @@ class CreateUserCommand extends Command
}
try {
$pwd = $this->encoder->encodePassword($user, $user->getPlainPassword());
$user->setPassword($pwd);
$entityManager = $this->doctrine->getManager();
$entityManager->persist($user);
$entityManager->flush();