From 371b3836b6221621af6a55540b17d90509f41e25 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Mon, 25 Jul 2022 15:35:08 +0200 Subject: [PATCH] Correct comments --- src/Commands/ClearPendingTenants.php | 4 ++-- src/Commands/CreatePendingTenants.php | 4 ++-- src/Database/Concerns/HasPending.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Commands/ClearPendingTenants.php b/src/Commands/ClearPendingTenants.php index 6d28b77c..8e801754 100644 --- a/src/Commands/ClearPendingTenants.php +++ b/src/Commands/ClearPendingTenants.php @@ -34,10 +34,10 @@ class ClearPendingTenants extends Command $this->info('Cleaning pending tenants.'); $expirationDate = now(); - // We compare the original and the new expiration date to check if the new one is different later + // We compare the original expiration date to the new one to check if the new one is different later $originalExpirationDate = $expirationDate->copy()->toImmutable(); - // If the all option is given, skip the expiry date configuration + // If the 'all' option is given, skip the expiry date configuration if (! $this->option('all')) { if ($olderThanDays = $this->option('older-days') ?? config('tenancy.pending.older_than_days')) { $expirationDate->subDays($olderThanDays); diff --git a/src/Commands/CreatePendingTenants.php b/src/Commands/CreatePendingTenants.php index 18b53806..24c7b100 100644 --- a/src/Commands/CreatePendingTenants.php +++ b/src/Commands/CreatePendingTenants.php @@ -36,8 +36,8 @@ class CreatePendingTenants extends Command while ($pendingTenantCount < $maxPendingTenantCount) { tenancy()->model()::createPending(); - // Fetch the count each time to prevent creating too many tenants if pending tenants - // Are being created somewhere else while running this command + // Fetch the count each time to prevent creating too many tenants + // If pending tenants are being created somewhere else while running this command $pendingTenantCount = $this->getPendingTenantCount(); $createdCount++; diff --git a/src/Database/Concerns/HasPending.php b/src/Database/Concerns/HasPending.php index 28e9b944..f6b61881 100644 --- a/src/Database/Concerns/HasPending.php +++ b/src/Database/Concerns/HasPending.php @@ -55,8 +55,8 @@ trait HasPending event(new CreatingPendingTenant($tenant)); - // Update the pending_since value only after the model is created to ensure that - // It's not marked as pending until finishing running the migrations, seeders, etc. + // Update the pending_since value only after the tenant is created so it's + // Not marked as pending until finishing running the migrations, seeders, etc. $tenant->update([ 'pending_since' => now()->timestamp, ]); @@ -73,7 +73,7 @@ trait HasPending static::createPending(); } - // At this point, we can guarantee a pending tenant is available + // A pending tenant is surely available at this point $tenant = static::onlyPending()->first(); event(new PullingPendingTenant($tenant));