From 677fdb23b97639b748cec902af07fb2bddb3e32c Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 26 Jul 2022 08:16:44 +0200 Subject: [PATCH] Improve writing --- assets/config.php | 2 +- src/Commands/ClearPendingTenants.php | 6 +++--- src/Commands/CreatePendingTenants.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/config.php b/assets/config.php index 0c2df61d..39d5a5de 100644 --- a/assets/config.php +++ b/assets/config.php @@ -37,7 +37,7 @@ return [ /** - * Pending tenancy config. + * Pending tenants config. * This is useful if you're looking for a way to always have a tenant ready to be used. */ 'pending' => [ diff --git a/src/Commands/ClearPendingTenants.php b/src/Commands/ClearPendingTenants.php index 8e801754..a96eaf00 100644 --- a/src/Commands/ClearPendingTenants.php +++ b/src/Commands/ClearPendingTenants.php @@ -37,7 +37,7 @@ class ClearPendingTenants extends Command // 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 + // Skip the time constraints if the 'all' option is given if (! $this->option('all')) { if ($olderThanDays = $this->option('older-days') ?? config('tenancy.pending.older_than_days')) { $expirationDate->subDays($olderThanDays); @@ -48,7 +48,7 @@ class ClearPendingTenants extends Command } } - $deletedPendingCount = tenancy() + $deletedTenantCount = tenancy() ->query() ->onlyPending() ->when($originalExpirationDate->notEqualTo($expirationDate), function (Builder $query) use ($expirationDate) { @@ -59,6 +59,6 @@ class ClearPendingTenants extends Command ->delete() ->count(); - $this->info($deletedPendingCount . ' pending ' . str('tenant')->plural($deletedPendingCount) . ' deleted.'); + $this->info($deletedTenantCount . ' pending ' . str('tenant')->plural($deletedTenantCount) . ' deleted.'); } } diff --git a/src/Commands/CreatePendingTenants.php b/src/Commands/CreatePendingTenants.php index 24c7b100..88202093 100644 --- a/src/Commands/CreatePendingTenants.php +++ b/src/Commands/CreatePendingTenants.php @@ -13,14 +13,14 @@ class CreatePendingTenants extends Command * * @var string */ - protected $signature = 'tenants:pending {--count= : The number of tenants to be in a pending state}'; + protected $signature = 'tenants:pending-create {--count= : The number of pending tenants to be created}'; /** * The console command description. * * @var string */ - protected $description = 'Create tenants until the pending count is achieved.'; + protected $description = 'Create pending tenants.'; /** * Execute the console command. @@ -36,7 +36,7 @@ class CreatePendingTenants extends Command while ($pendingTenantCount < $maxPendingTenantCount) { tenancy()->model()::createPending(); - // Fetch the count each time to prevent creating too many tenants + // Fetching the pending tenant count in each iteration prevents creating too many tenants // If pending tenants are being created somewhere else while running this command $pendingTenantCount = $this->getPendingTenantCount();