Skip to content

Commit

Permalink
refactor: use named arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Mar 25, 2024
1 parent 083230c commit 0fae792
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
18 changes: 9 additions & 9 deletions src/Console/Command/Io/IndexerProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public function start(int $total): void
$this->progressBar = new ProgressBar($this->output, $total);
$this->formatProgressBar('green');
$this->status = new IndexerStatus(
IndexerStatusState::RUNNING,
new DateTime(),
null,
$total,
0,
0,
new DateTime(),
0,
0
state: IndexerStatusState::RUNNING,
startTime: new DateTime(),
endTime: null,
total: $total,
processed: 0,
skipped: 0,
lastUpdate: new DateTime(),
updated: 0,
errors: 0
);
}

Expand Down
18 changes: 9 additions & 9 deletions src/Dto/Indexer/IndexerStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public static function empty(): IndexerStatus
{
$now = new DateTime();
return new IndexerStatus(
IndexerStatusState::UNKNOWN,
$now,
$now,
0,
0,
0,
$now,
0,
0
state: IndexerStatusState::UNKNOWN,
startTime: $now,
endTime: $now,
total:0,
processed: 0,
skipped: 0,
lastUpdate: $now,
updated: 0,
errors: 0
);
}

Expand Down
36 changes: 18 additions & 18 deletions src/Service/Indexer/BackgroundIndexerProgressState.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public function __construct(
public function start(int $total): void
{
$this->status = new IndexerStatus(
IndexerStatusState::RUNNING,
new DateTime(),
null,
$total,
0,
0,
new DateTime(),
0,
0
state:IndexerStatusState::RUNNING,
startTime: new DateTime(),
endTime: null,
total: $total,
processed: 0,
skipped: 0,
lastUpdate: new DateTime(),
updated: 0,
errors: 0
);
}

Expand All @@ -49,15 +49,15 @@ public function startUpdate(int $total): void
$this->isUpdate = true;
$storedStatus = $this->statusStore->load($this->index);
$this->status = new IndexerStatus(
IndexerStatusState::RUNNING,
$storedStatus->startTime,
$storedStatus->endTime,
$storedStatus->total + $total,
$storedStatus->processed,
$storedStatus->skipped,
new DateTime(),
$storedStatus->updated,
$storedStatus->errors,
state: IndexerStatusState::RUNNING,
startTime: $storedStatus->startTime,
endTime: $storedStatus->endTime,
total: $storedStatus->total + $total,
processed: $storedStatus->processed,
skipped: $storedStatus->skipped,
lastUpdate: new DateTime(),
updated: $storedStatus->updated,
errors: $storedStatus->errors,
);
}

Expand Down

0 comments on commit 0fae792

Please sign in to comment.