1
0
mirror of https://github.com/bitwarden/server synced 2025-12-23 19:53:40 +00:00

Changed all C# control flow block statements to include space between keyword and open paren

This commit is contained in:
Chad Scharf
2020-03-27 14:36:37 -04:00
parent 943aea9a12
commit 9800b752c0
243 changed files with 2258 additions and 2258 deletions

View File

@@ -11,39 +11,39 @@ namespace Bit.Core.Utilities
internal static async Task<string> AdjustStorageAsync(IPaymentService paymentService, IStorableSubscriber storableSubscriber,
short storageAdjustmentGb, string storagePlanId)
{
if(storableSubscriber == null)
if (storableSubscriber == null)
{
throw new ArgumentNullException(nameof(storableSubscriber));
}
if(string.IsNullOrWhiteSpace(storableSubscriber.GatewayCustomerId))
if (string.IsNullOrWhiteSpace(storableSubscriber.GatewayCustomerId))
{
throw new BadRequestException("No payment method found.");
}
if(string.IsNullOrWhiteSpace(storableSubscriber.GatewaySubscriptionId))
if (string.IsNullOrWhiteSpace(storableSubscriber.GatewaySubscriptionId))
{
throw new BadRequestException("No subscription found.");
}
if(!storableSubscriber.MaxStorageGb.HasValue)
if (!storableSubscriber.MaxStorageGb.HasValue)
{
throw new BadRequestException("No access to storage.");
}
var newStorageGb = (short)(storableSubscriber.MaxStorageGb.Value + storageAdjustmentGb);
if(newStorageGb < 1)
if (newStorageGb < 1)
{
newStorageGb = 1;
}
if(newStorageGb > 100)
if (newStorageGb > 100)
{
throw new BadRequestException("Maximum storage is 100 GB.");
}
var remainingStorage = storableSubscriber.StorageBytesRemaining(newStorageGb);
if(remainingStorage < 0)
if (remainingStorage < 0)
{
throw new BadRequestException("You are currently using " +
$"{CoreHelpers.ReadableBytesSize(storableSubscriber.Storage.GetValueOrDefault(0))} of storage. " +