ini_set('unserialize_callback_func',
$prevUnserializeHandler);
} return $token;
} 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;
}