FakerPHP / Faker

Faker is a PHP library that generates fake data for you
https://fakerphp.github.io
Other
3.49k stars 331 forks source link

NZ Provider has no e.164 number format #671

Closed securit closed 10 months ago

securit commented 1 year ago

Summary

The src/Faker/Provider/en_NZ/PhoneNumber.php does not contain an e.164 format array or international format strings in the protected static $formats array.

protected static $e164Formats = [
        '+64##########',
    ];

Versions

Version
fakerphp/faker 1.23.0

Self-enclosed code snippet for reproduction

see src/Faker/Provider/en_NZ/PhoneNumber.php

Expected output

protected static $formats = [
     // National format
    '0{{areaCode}}{{beginningNumber}}######',
    '0{{areaCode}} {{beginningNumber}}######',
    '0{{areaCode}} {{beginningNumber}}## ####',

    // Optional parenthesis
    '(0{{areaCode}}){{beginningNumber}}######',
    '(0{{areaCode}}){{beginningNumber}}## ####',
    '(0{{areaCode}}) {{beginningNumber}}######',
    '(0{{areaCode}}) {{beginningNumber}}## ####',

    // International format drops the 0
    '+64{{areaCode}}{{beginningNumber}}######',
    '+64 {{areaCode}} {{beginningNumber}}## ####',
    '+64 {{areaCode}} {{beginningNumber}}######',
    '+64 ({{areaCode}}) {{beginningNumber}}## ####',
    '+64 ({{areaCode}}) {{beginningNumber}}######',
    '+64({{areaCode}}){{beginningNumber}}## ####',
    '+64({{areaCode}}){{beginningNumber}}######',
    '+64({{areaCode}}) {{beginningNumber}}## ####',
    '+64({{areaCode}}) {{beginningNumber}}######',
];

/**
 * An array of en_NZ landline area codes
 *
 * @var array
 */
protected static $areaCodes = [
    '2', '3', '4', '6', '7', '9',
];

protected static $e164Formats = [
    '+64##########',
];

Actual output

see src/Faker/Provider/en_NZ/PhoneNumber.php

pimjansen commented 1 year ago

Feel free to raise a PR with the valid format and link to some specific reference data to verify the format

securit commented 1 year ago

The New Zealand numbering plan is administered by The Ministry of Business and innovation via The Number Administration Deed (https://www.nad.org.nz https://www.nad.org.nz/)

The rules for number allocation are here https://www.nad.org.nz/assets/ResourceLinks/NAD-Rules-v7.1.pdf

The New Zealand numbering plan is found here https://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000990002PDFE.pdf

On 13/07/2023, at 6:54 PM, Pim Jansen @.***> wrote:

Feel free to raise a PR with the valid format and link to some specific reference data to verify the format

— Reply to this email directly, view it on GitHub https://github.com/FakerPHP/Faker/issues/671#issuecomment-1633668479, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJE5JJ35SQZGWBV35F6SDXP6LT5ANCNFSM6AAAAAA2IDLE7A. You are receiving this because you authored the thread.

securit commented 1 year ago

This repository does not permit the creation of new PRs because

This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

On 13/07/2023, at 7:28 PM, SecurIT @.***> wrote:

The New Zealand numbering plan is administered by The Ministry of Business and innovation via The Number Administration Deed (https://www.nad.org.nz https://www.nad.org.nz/)

The rules for number allocation are here https://www.nad.org.nz/assets/ResourceLinks/NAD-Rules-v7.1.pdf

The New Zealand numbering plan is found here https://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000990002PDFE.pdf

On 13/07/2023, at 6:54 PM, Pim Jansen @.***> wrote:

Feel free to raise a PR with the valid format and link to some specific reference data to verify the format

— Reply to this email directly, view it on GitHub https://github.com/FakerPHP/Faker/issues/671#issuecomment-1633668479, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJE5JJ35SQZGWBV35F6SDXP6LT5ANCNFSM6AAAAAA2IDLE7A. You are receiving this because you authored the thread.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.

securit commented 11 months ago

Hey stale bot. Dont shoot the messenger!

localheinz commented 10 months ago

@securit

We may consider adding such a feature in the future, but the current plans for 2.0.0 indicate that providers for specific locales will be removed from fakerphp/faker.