mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-16 13:04:02 +00:00
get down to 21 phpstan errors
This commit is contained in:
parent
a94227a19c
commit
f98a901aeb
16 changed files with 85 additions and 26 deletions
|
|
@ -6,11 +6,14 @@ namespace Stancl\Tenancy\Commands;
|
|||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use Stancl\Tenancy\Concerns\HasATenantsOption;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
|
||||
class Run extends Command
|
||||
{
|
||||
use HasATenantsOption;
|
||||
|
||||
protected $description = 'Run a command for tenant(s)';
|
||||
|
||||
protected $signature = 'tenants:run {commandname : The artisan command.}
|
||||
|
|
@ -19,7 +22,8 @@ class Run extends Command
|
|||
public function handle(): void
|
||||
{
|
||||
$argvInput = $this->argvInput();
|
||||
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) use ($argvInput) {
|
||||
|
||||
tenancy()->runForMultiple($this->getTenants(), function ($tenant) use ($argvInput) {
|
||||
$this->line("Tenant: {$tenant->getTenantKey()}");
|
||||
|
||||
$this->getLaravel()
|
||||
|
|
@ -30,12 +34,15 @@ class Run extends Command
|
|||
|
||||
protected function argvInput(): ArgvInput
|
||||
{
|
||||
/** @var string $commandname */
|
||||
$commandname = $this->argument('commandname');
|
||||
|
||||
// Convert string command to array
|
||||
$subCommand = explode(' ', $this->argument('commandname'));
|
||||
$subcommand = explode(' ', $commandname);
|
||||
|
||||
// Add "artisan" as first parameter because ArgvInput expects "artisan" as first parameter and later removes it
|
||||
array_unshift($subCommand, 'artisan');
|
||||
array_unshift($subcommand, 'artisan');
|
||||
|
||||
return new ArgvInput($subCommand);
|
||||
return new ArgvInput($subcommand);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue