*/ final class TotalResponseItem { private $time; private $accepted; private $delivered; private $failed; private $complained; public static function create(array $data): self { $model = new self(); $model->time = isset($data['time']) ? new \DateTimeImmutable($data['time']) : null; $model->accepted = $data['accepted'] ?? []; $model->delivered = $data['delivered'] ?? []; $model->failed = $data['failed'] ?? []; $model->complained = $data['complained'] ?? []; return $model; } private function __construct() { } public function getTime(): ?\DateTimeImmutable { return $this->time; } public function getAccepted(): array { return $this->accepted; } public function getDelivered(): array { return $this->delivered; } public function getFailed(): array { return $this->failed; } public function getComplained(): array { return $this->complained; } }