Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need for country common name #112

Open
8ctopus opened this issue Oct 24, 2024 · 2 comments
Open

Need for country common name #112

8ctopus opened this issue Oct 24, 2024 · 2 comments

Comments

@8ctopus
Copy link
Contributor

8ctopus commented Oct 24, 2024

The following code:

$countryCode = 'GB';

$iso = (new ISO3166())
    ->alpha2($countryCode);

/** @disregard P1013 */
$buyer = (new Person())
    ->setFirstName($firstName)
    ->setLastName($lastName)
    ->setStreet1($street1)
    ->setStreet2($street2)
    ->setZip($zip)
    ->setCity($city)
    ->setCountry($iso['name'])
    ->setEmail($email);

will end up with something like this in an invoice:

John Doe
St. Johns Street
SS69DQ RAYLEIGH
United Kingdom of Great Britain and Northern Ireland

This is not convenient for invoices as it will end up making the buyer's address field way too long as shown in this screenshot from a pdf:

image

It's common practice to use the common name as the Wikipedia article intro explains: The United Kingdom of Great Britain and Northern Ireland, commonly known as the United Kingdom (UK).

So the idea is to add the common name when it differs from the official one to the array.

        [
            'name' => 'United Kingdom of Great Britain and Northern Ireland',
            'common' => 'United Kingdom',
            'alpha2' => 'GB',
            'alpha3' => 'GBR',
            'numeric' => '826',
            'currency' => [
                'GBP',
            ],
        ],

If you agree to this update, I will happily provide a PR.

@alcohol
Copy link
Owner

alcohol commented Oct 24, 2024

I'm actually not sure if I want to maintain this library much longer. Packages such as symfony/intl are much more complete.

@8ctopus
Copy link
Contributor Author

8ctopus commented Oct 24, 2024

@alcohol With 28M downloads and counting that would be a shame. I'm happy to help you with maintenance if you want. You can review my github repositories and see if I'm a fit. Please let me know if I should create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants