I don't think you need to check $user and !empty($providerName), the strict type and mapper should handle it.