File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 55class 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
You can’t perform that action at this time.
0 commit comments