base commit
This commit is contained in:
33
app/DTOs/Import/ImportResultDto.php
Normal file
33
app/DTOs/Import/ImportResultDto.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\DTOs\Import;
|
||||
|
||||
readonly class ImportResultDto
|
||||
{
|
||||
/**
|
||||
* @param array<int, string> $errors
|
||||
*/
|
||||
public function __construct(
|
||||
public int $total,
|
||||
public int $imported,
|
||||
public int $skipped,
|
||||
public int $failed,
|
||||
public array $errors = [],
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'total' => $this->total,
|
||||
'imported' => $this->imported,
|
||||
'skipped' => $this->skipped,
|
||||
'failed' => $this->failed,
|
||||
'errors' => $this->errors,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user