From 911b0e3cbd271fdd3a5f492428d97e7b001a898d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 1 Jun 2022 15:21:55 +0200 Subject: [PATCH] remove docblocks, fix tenant() logic --- src/Commands/TenantDump.php | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/Commands/TenantDump.php b/src/Commands/TenantDump.php index c10a16ab..557c6975 100644 --- a/src/Commands/TenantDump.php +++ b/src/Commands/TenantDump.php @@ -13,9 +13,6 @@ use Symfony\Component\Console\Input\InputOption; class TenantDump extends DumpCommand { - /** - * Create a new command instance. - */ public function __construct() { parent::__construct(); @@ -24,15 +21,7 @@ class TenantDump extends DumpCommand $this->specifyParameters(); } - /** - * Execute the console command. - * - * @param \Illuminate\Database\ConnectionResolverInterface $connections - * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher - * @return int - * - * @throws \Throwable - */ + public function handle(ConnectionResolverInterface $connections, Dispatcher $dispatcher): int { $this->tenant()->run(fn() => parent::handle($connections, $dispatcher)); @@ -40,19 +29,12 @@ class TenantDump extends DumpCommand return Command::SUCCESS; } - /** - * Get tenant to use as a template for the schema dump. - * - * @return \Stancl\Tenancy\Contracts\Tenant - * - * @throws \Throwable - */ public function tenant(): Tenant { $tenant = $this->option('tenant') ?? tenant() - ?? tenancy()->query()->first() - ?? $this->ask('What tenant do you want to dump the schema for?'); + ?? $this->ask('What tenant do you want to dump the schema for?') + ?? tenancy()->query()->first(); if (! $tenant instanceof Tenant) { $tenant = tenancy()->find($tenant); @@ -63,11 +45,6 @@ class TenantDump extends DumpCommand return $tenant; } - /** - * Get the console command options. - * - * @return array - */ protected function getOptions(): array { return array_merge([