Skip to content

Commit b8773c8

Browse files
authored
Update ShipTo.php
1 parent 8e609be commit b8773c8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Entity/ShipTo.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
class ShipTo
66
{
77
private ?string $name;
8-
private ?string $attentionName;
8+
private string $attentionName = "";
99
private Phone $phone;
1010
private Address $address;
11-
private ?string $residential;
11+
private string $residential = "";
1212

13+
public function __construct()
14+
{
15+
$this->phone = new Phone();
16+
}
17+
1318
public function setName(string $name): self
1419
{
1520
$this->name = $name;
@@ -49,7 +54,7 @@ public function setAddress(Address $address): self
4954
return $this;
5055
}
5156

52-
public function getAddress(): Address | null
57+
public function getAddress(): Address
5358
{
5459
return $this->address;
5560
}
@@ -76,7 +81,7 @@ public function toArray(): array
7681
$shipTo["AttentionName"] = $this->attentionName;
7782
}
7883

79-
if ($this->phone) {
84+
if ($this->phone->exists()) {
8085
$shipTo["Phone"] = $this->phone->toArray();
8186
}
8287

0 commit comments

Comments
 (0)