mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 15:54:03 +00:00
Fix code style (php-cs-fixer)
This commit is contained in:
parent
b0b44e902f
commit
18a16e6a74
1 changed files with 5 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ trait ParallelCommand
|
||||||
|
|
||||||
if ($pid === -1) {
|
if ($pid === -1) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if ($pid) {
|
} elseif ($pid) {
|
||||||
// Parent
|
// Parent
|
||||||
return $pid;
|
return $pid;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -42,12 +42,12 @@ trait ParallelCommand
|
||||||
$processes = (int) $this->input->getOption('processes');
|
$processes = (int) $this->input->getOption('processes');
|
||||||
|
|
||||||
if (($processes < 0) || ($processes > static::MAX_PROCESSES)) {
|
if (($processes < 0) || ($processes > static::MAX_PROCESSES)) {
|
||||||
$this->components->error("Maximum value for processes is " . static::MAX_PROCESSES);
|
$this->components->error('Maximum value for processes is ' . static::MAX_PROCESSES);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($processes > 1 && ! function_exists('pcntl_fork')) {
|
if ($processes > 1 && ! function_exists('pcntl_fork')) {
|
||||||
$this->components->error("The pcntl extension is required for parallel migrations to work.");
|
$this->components->error('The pcntl extension is required for parallel migrations to work.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $processes;
|
return $processes;
|
||||||
|
|
@ -57,10 +57,11 @@ trait ParallelCommand
|
||||||
{
|
{
|
||||||
$idCol = tenancy()->model()->getTenantKeyName();
|
$idCol = tenancy()->model()->getTenantKeyName();
|
||||||
$tenants = tenancy()->model()->orderBy($idCol, 'asc')->pluck($idCol);
|
$tenants = tenancy()->model()->orderBy($idCol, 'asc')->pluck($idCol);
|
||||||
|
|
||||||
return $tenants->chunk(ceil($tenants->count() / $this->getProcesses()));
|
return $tenants->chunk(ceil($tenants->count() / $this->getProcesses()));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function runConcurrently(array|ArrayAccess $args = null): int
|
protected function runConcurrently(array|ArrayAccess|null $args = null): int
|
||||||
{
|
{
|
||||||
$processes = $this->getProcesses();
|
$processes = $this->getProcesses();
|
||||||
$success = true;
|
$success = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue