getPrefix(), $address->getFirstname(), $address->getMiddlename(), $address->getLastname(), $address->getSuffix(), ], static fn ($part): bool => trim((string) $part) !== '')); } public function getStreetLines(AddressInterface $address): array { return array_values(array_filter( $address->getStreet() ?? [], static fn ($line): bool => trim((string) $line) !== '' )); } public function getLocalityLine(AddressInterface $address): string { $region = $address->getRegion(); return implode(', ', array_filter([ $address->getCity(), $region ? $region->getRegion() : null, $address->getPostcode(), ], static fn ($part): bool => trim((string) $part) !== '')); } public function getCountryName(AddressInterface $address): string { $countryId = (string) $address->getCountryId(); if ($countryId === '') { return ''; } try { $country = $this->countryInformationAcquirer->getCountryInfo($countryId); return (string) ($country->getFullNameLocale() ?: $country->getFullNameEnglish() ?: $countryId); } catch (NoSuchEntityException) { return $countryId; } } }