ldc-cocotte/app/Queries/Employees/GetEmployeeImportColumnsQuery.php

36 lines
778 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace App\Queries\Employees;
use App\Contracts\Query;
use App\Contracts\QueryInput;
use App\Contracts\QueryInputEmpty;
use Domain\Services\EmployeeImportService;
use Webmozart\Assert\Assert;
/**
* @implements \App\Contracts\Query<\App\Contracts\QueryInputEmpty, list<string>>
*/
final readonly class GetEmployeeImportColumnsQuery implements Query
{
public function __construct(
private EmployeeImportService $employeeService,
) {
}
/**
* @return list<string>
*/
public function __invoke(QueryInput $input): array
{
Assert::isInstanceOf(
$input,
QueryInputEmpty::class,
);
return array_values($this->employeeService->getImportColumns());
}
}