From d2f55e620c1c00c8973ea2178895dc5f8dde980c Mon Sep 17 00:00:00 2001 From: lukinovec Date: Wed, 6 Aug 2025 14:32:23 +0200 Subject: [PATCH] Add docblock to command, improve description and output messages --- src/Commands/ClearExpiredImpersonationTokens.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Commands/ClearExpiredImpersonationTokens.php b/src/Commands/ClearExpiredImpersonationTokens.php index 3b28bafc..8c86c61a 100644 --- a/src/Commands/ClearExpiredImpersonationTokens.php +++ b/src/Commands/ClearExpiredImpersonationTokens.php @@ -8,6 +8,11 @@ use Illuminate\Console\Command; use Stancl\Tenancy\Features\UserImpersonation; /** + * This command clears expired impersonation tokens. + * By default, all tokens older than UserImpersonation::$ttl (60 seconds by default) + * are deleted. To override this, you can use the --ttl option, for example + * --ttl=120, all tokens older than 120 seconds will be deleted, ignoring the default. + * * @see Stancl\Tenancy\Features\UserImpersonation */ class ClearExpiredImpersonationTokens extends Command @@ -15,11 +20,11 @@ class ClearExpiredImpersonationTokens extends Command protected $signature = 'tenants:clear-expired-impersonation-tokens {--ttl= : TTL in seconds for impersonation tokens (default is UserImpersonation::$ttl)}'; - protected $description = 'Remove expired impersonation tokens.'; + protected $description = 'Clear expired impersonation tokens.'; public function handle(): int { - $this->components->info('Removing expired impersonation tokens.'); + $this->components->info('Deleting expired impersonation tokens.'); $ttl = (int) $this->option('ttl') ?: UserImpersonation::$ttl; $expirationDate = now()->subSeconds($ttl);