From 3278253c9260fb05263402c75b96e4c61f9f3e83 Mon Sep 17 00:00:00 2001 From: Wouter Date: Mon, 3 Jul 2023 12:56:41 +1200 Subject: [PATCH] Make address date nullable This does not happen often but it is possible that the AddressDate is not set --- src/Model/AbnResponse.php | 2 +- tests/Integration/AbnClientTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/AbnResponse.php b/src/Model/AbnResponse.php index 159f744..38601e8 100644 --- a/src/Model/AbnResponse.php +++ b/src/Model/AbnResponse.php @@ -27,7 +27,7 @@ final class AbnResponse extends AbstractResponse #[SerializedName('AddressDate')] #[NotBlank] - public \DateTimeImmutable $addressDate; + public ?\DateTimeImmutable $addressDate = null; #[SerializedName('AddressPostcode')] public string $addressPostcode; diff --git a/tests/Integration/AbnClientTest.php b/tests/Integration/AbnClientTest.php index cbb8d97..bb002da 100644 --- a/tests/Integration/AbnClientTest.php +++ b/tests/Integration/AbnClientTest.php @@ -125,7 +125,7 @@ public function testLookupAbnSuccess(): void 'AbnStatus' => $response->abnStatus, 'AbnStatusEffectiveFrom' => $response->abnStatusEffectiveFrom->format('Y-m-d'), 'Acn' => $response->acn, - 'AddressDate' => $response->addressDate->format('Y-m-d'), + 'AddressDate' => $response->addressDate?->format('Y-m-d'), 'AddressPostcode' => $response->addressPostcode, 'AddressState' => $response->addressState, 'BusinessName' => $response->businessNames,