Skip to content

Commit f6adee4

Browse files
committed
refactor: run rector and phpstan again
1 parent 53ab409 commit f6adee4

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/CXml/Model/Request/ConfirmationHeader.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(
3636
#[Serializer\XmlAttribute]
3737
private readonly string $type,
3838
#[Serializer\XmlAttribute]
39-
private ?\DateTimeInterface $noticeDate = null,
39+
private readonly \DateTimeInterface $noticeDate = new \DateTime(),
4040
) {
4141
Assertion::inArray($type, [
4242
self::TYPE_ACCEPT,
@@ -48,11 +48,9 @@ public function __construct(
4848
self::TYPE_REQUESTTOPAY,
4949
self::TYPE_REPLACE,
5050
]);
51-
52-
$this->noticeDate = $noticeDate ?? new \DateTime();
5351
}
5452

55-
public static function create(string $type, \DateTimeInterface $noticeDate = null): self
53+
public static function create(string $type, \DateTimeInterface $noticeDate = new \DateTime()): self
5654
{
5755
return new self(
5856
$type,
@@ -65,7 +63,7 @@ public function getType(): string
6563
return $this->type;
6664
}
6765

68-
public function getNoticeDate(): ?\DateTimeInterface
66+
public function getNoticeDate(): \DateTimeInterface
6967
{
7068
return $this->noticeDate;
7169
}

src/CXml/Model/Request/OrderRequestHeader.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,15 @@ protected function __construct(
5959
#[Serializer\XmlList(entry: 'Contact', inline: true)]
6060
private ?array $contacts = null,
6161
) {
62-
if (null !== $contacts && [] !== $contacts) {
63-
Assertion::allIsInstanceOf($contacts, Contact::class);
62+
if (null === $contacts) {
63+
return;
6464
}
65+
66+
if ([] === $contacts) {
67+
return;
68+
}
69+
70+
Assertion::allIsInstanceOf($contacts, Contact::class);
6571
}
6672

6773
public static function create(

0 commit comments

Comments
 (0)