Skip to content

Commit

Permalink
Merge pull request #200 from sprain/country-codes
Browse files Browse the repository at this point in the history
Re-introduce output of country code for Liechtenstein
  • Loading branch information
sprain authored Oct 3, 2022
2 parents d12c885 + bc7a489 commit a1a4910
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/DataGroup/Element/CombinedAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getFullAddress(bool $forReceipt = false): string
$lines[2] = $this->getAddressLine1();
}

if (in_array($this->getCountry(), ['CH', 'LI'])) {
if ('CH' === $this->getCountry()) {
$lines[3] = $this->getAddressLine2();
} else {
$lines[3] = sprintf("%s-%s", $this->getCountry(), $this->getAddressLine2());
Expand Down
2 changes: 1 addition & 1 deletion src/DataGroup/Element/StructuredAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function getFullAddress(bool $forReceipt = false): string
}
}

if (in_array($this->getCountry(), ['CH', 'LI'])) {
if ('CH' === $this->getCountry()) {
$lines[3] = sprintf("%s %s", $this->getPostalCode(), $this->getCity());
} else {
$lines[3] = sprintf("%s-%s %s", $this->getCountry(), $this->getPostalCode(), $this->getCity());
Expand Down
4 changes: 2 additions & 2 deletions tests/DataGroup/Element/CombinedAddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function addressProvider(): array
'9490 Vaduz',
'LI'
),
"Thomas Mustermann\nMusterweg 22a\n9490 Vaduz"
"Thomas Mustermann\nMusterweg 22a\nLI-9490 Vaduz"
],
[
CombinedAddress::create(
Expand Down Expand Up @@ -256,7 +256,7 @@ public function addressProviderReceipt(): array
'9490 Vaduz',
'LI'
),
"Thomas Mustermann\nMusterweg 22a\n9490 Vaduz"
"Thomas Mustermann\nMusterweg 22a\nLI-9490 Vaduz"
],
[
CombinedAddress::create(
Expand Down
4 changes: 2 additions & 2 deletions tests/DataGroup/Element/StructuredAddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public function addressProvider(): array
'Vaduz',
'LI'
),
"Thomas Mustermann\n9490 Vaduz"
"Thomas Mustermann\nLI-9490 Vaduz"
],
[
StructuredAddress::createWithoutStreet(
Expand Down Expand Up @@ -351,7 +351,7 @@ public function addressProviderReceipt(): array
'Vaduz',
'LI'
),
"Thomas Mustermann\n9490 Vaduz"
"Thomas Mustermann\nLI-9490 Vaduz"
],
[
StructuredAddress::createWithoutStreet(
Expand Down

0 comments on commit a1a4910

Please sign in to comment.