throw $e;
} return $user;
} public function refreshUser(UserInterface
$user): UserInterface
{ $class =
$this->
getClass();
if (!
$user instanceof
$class) { throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.',
get_debug_type($user)));
} $repository =
$this->
getRepository();
if ($repository instanceof UserProviderInterface
) { $refreshedUser =
$repository->
refreshUser($user);
} else { // The user must be reloaded via the primary key as all other data
// might have changed without proper persistence in the database.
// That's the case when the user has been changed by a form with
// validation errors.
if (!
$id =
$this->
getClassMetadata()->
getIdentifierValues($user)) {