tin = (string) ($data['tin'] ?? ''); $this->msicCode = (string) ($data['msic_code'] ?? ''); $this->districtId = (int) ($data['district_id'] ?? 0); $this->stateId = (int) ($data['state_id'] ?? 0); $this->companyId = (int) ($data['company_id'] ?? 0); $this->streetOne = (string) ($data['street_one'] ?? ''); $this->streetTwo = (string) ($data['street_two'] ?? ''); $this->postCode = (string) ($data['post_code'] ?? 0); } public function toArray(): array { return [ 'tin' => $this->tin, 'msic_code' => $this->msicCode, 'district_id' => $this->districtId, 'state_id' => $this->stateId, 'company_id' => $this->companyId, 'street_one' => $this->streetOne, 'street_two' => $this->streetTwo, 'post_code' => $this->postCode, ]; } }