File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public function __construct(
36
36
#[Serializer \XmlAttribute]
37
37
private readonly string $ type ,
38
38
#[Serializer \XmlAttribute]
39
- private ? \DateTimeInterface $ noticeDate = null ,
39
+ private readonly \DateTimeInterface $ noticeDate = new \ DateTime () ,
40
40
) {
41
41
Assertion::inArray ($ type , [
42
42
self ::TYPE_ACCEPT ,
@@ -48,11 +48,9 @@ public function __construct(
48
48
self ::TYPE_REQUESTTOPAY ,
49
49
self ::TYPE_REPLACE ,
50
50
]);
51
-
52
- $ this ->noticeDate = $ noticeDate ?? new \DateTime ();
53
51
}
54
52
55
- public static function create (string $ type , \DateTimeInterface $ noticeDate = null ): self
53
+ public static function create (string $ type , \DateTimeInterface $ noticeDate = new \ DateTime () ): self
56
54
{
57
55
return new self (
58
56
$ type ,
@@ -65,7 +63,7 @@ public function getType(): string
65
63
return $ this ->type ;
66
64
}
67
65
68
- public function getNoticeDate (): ? \DateTimeInterface
66
+ public function getNoticeDate (): \DateTimeInterface
69
67
{
70
68
return $ this ->noticeDate ;
71
69
}
Original file line number Diff line number Diff line change @@ -59,9 +59,15 @@ protected function __construct(
59
59
#[Serializer \XmlList(entry: 'Contact ' , inline: true )]
60
60
private ?array $ contacts = null ,
61
61
) {
62
- if (null !== $ contacts && [] ! == $ contacts ) {
63
- Assertion:: allIsInstanceOf ( $ contacts , Contact::class) ;
62
+ if (null = == $ contacts ) {
63
+ return ;
64
64
}
65
+
66
+ if ([] === $ contacts ) {
67
+ return ;
68
+ }
69
+
70
+ Assertion::allIsInstanceOf ($ contacts , Contact::class);
65
71
}
66
72
67
73
public static function create (
You can’t perform that action at this time.
0 commit comments