private static function hasUserChanged(UserInterface
$originalUser, TokenInterface
$refreshedToken): bool
{ $refreshedUser =
$refreshedToken->
getUser();
if ($originalUser instanceof EquatableInterface
) { return !
(bool) $originalUser->
isEqualTo($refreshedUser);
} 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;
} }