Skip to content

Commit d5ea90a

Browse files
committed
Fixing array offset issues
1 parent 12f5666 commit d5ea90a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/DTO/SearchResultCompany.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public static function hydrate(array $item): self
7575
{
7676
return new self(
7777
type: $item['company_type'] ?? null,
78-
dateOfCreation: Carbon::parse($item['date_of_creation']),
78+
dateOfCreation: isset($item['date_of_creation'])
79+
? Carbon::parse($item['date_of_creation'])
80+
: null,
7981
title: $item['title'] ?? null,
8082
status: $item['company_status'] ?? null,
8183
kind: $item['kind'] ?? null,
@@ -84,9 +86,10 @@ public static function hydrate(array $item): self
8486
companyNumber: $item['company_number'] ?? null,
8587
description: $item['description'] ?? null,
8688
descriptionIdentifiers: $item['description_identifier'][0],
87-
address: Address::hydrate(
88-
item: $item['address'],
89-
),
89+
address: isset($item['address'])
90+
? Address::hydrate(
91+
item: $item['address'],
92+
) : null,
9093
);
9194
}
9295
}

0 commit comments

Comments
 (0)