if ($originalUser instanceof PasswordAuthenticatedUserInterface ||
$refreshedUser instanceof PasswordAuthenticatedUserInterface
) { if (!
$originalUser instanceof PasswordAuthenticatedUserInterface || !
$refreshedUser instanceof PasswordAuthenticatedUserInterface ||
$originalUser->
getPassword() !==
$refreshedUser->
getPassword()) { return true;
} if ($originalUser instanceof LegacyPasswordAuthenticatedUserInterface
xor $refreshedUser instanceof LegacyPasswordAuthenticatedUserInterface
) { return true;
} if ($originalUser instanceof LegacyPasswordAuthenticatedUserInterface &&
$refreshedUser instanceof LegacyPasswordAuthenticatedUserInterface &&
$originalUser->
getSalt() !==
$refreshedUser->
getSalt()) { return true;
} } $userRoles =
array_map('strval',
(array) $refreshedUser->
getRoles());
if ($refreshedToken instanceof SwitchUserToken
) { $userRoles[] = 'ROLE_PREVIOUS_ADMIN';
} if (