class RegionCountDto
{
public function __construct(
public readonly array $counts // ['Asia' => 372, 'Europe' => 542, ...]
) {}
public function toArray(): array
{
return $this->counts;
}
}
class GetRegionCountUseCase
{
public function __construct(
private readonly WorldHeritageQueryServiceInterface $queryService
) {}
public function handle(): RegionCountDto
{
return new RegionCountDto(
counts: $this->queryService->getRegionCount()
);
}
}
Acceptance Criteria
Tasks