1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-16 13:14:04 +00:00

phpstan, global_cache, resolver improvements, InitializationHelpers trait

This commit is contained in:
Samuel Štancl 2022-09-29 02:47:13 +02:00
parent fd65cf1754
commit 87212e5390
35 changed files with 170 additions and 231 deletions

View file

@ -11,27 +11,14 @@ use Symfony\Component\Console\Output\ConsoleOutput;
class Run extends Command
{
/**
* The console command description.
*
* @var string
*/
protected $description = 'Run a command for tenant(s)';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'tenants:run {commandname : The artisan command.}
{--tenants=* : The tenant(s) to run the command for. Default: all}';
/**
* Execute the console command.
*/
public function handle()
public function handle(): void
{
$argvInput = $this->ArgvInput();
$argvInput = $this->argvInput();
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) use ($argvInput) {
$this->line("Tenant: {$tenant->getTenantKey()}");
@ -41,10 +28,7 @@ class Run extends Command
});
}
/**
* Get command as ArgvInput instance.
*/
protected function ArgvInput(): ArgvInput
protected function argvInput(): ArgvInput
{
// Convert string command to array
$subCommand = explode(' ', $this->argument('commandname'));