Skip to content

Commit 46c67f4

Browse files
committed
Avoid CVR city containing postal code if city is found
1 parent 2b86bf6 commit 46c67f4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Plugin/os2web/DataLookup/DatafordelerCVR.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,8 @@ public function lookup(string $param): CompanyLookupResult {
9494
$cvrResult->setFloor($address->CVRAdresse_etagebetegnelse ?? '');
9595
$cvrResult->setApartmentNr($address->CVRAdresse_doerbetegnelse ?? '');
9696
$cvrResult->setPostalCode($address->CVRAdresse_postnummer ?? '');
97-
$city = implode(' ', array_filter([
98-
$address->CVRAdresse_postdistrikt ?? NULL,
99-
$cvrResult->getPostalCode() ?? NULL,
100-
]));
101-
$cvrResult->setCity($city);
97+
$city = $address->CVRAdresse_postdistrikt ?? $cvrResult->getPostalCode();
98+
$cvrResult->setCity($city);
10299
$cvrResult->setMunicipalityCode($address->CVRAdresse_kommunekode ?? '');
103100

104101
// Composing full address in one line.

0 commit comments

Comments
 (0)