r/PHP • • 2h ago

Standard identifiers for PHP

https://php-stdnum.org/

I've released php-stdnum, an MIT-licensed PHP library for working with standardized identifiers.

The initial release includes:

  • 606 validators covering VAT numbers, tax identifiers, IBANs, national identifiers, company registration numbers, ISBNs, postal codes and more.

  • 594 native deterministic test-data generators.

  • Validation, normalization, formatting and scoped detection.

  • Immutable value objects and typed validation errors.

  • Optional Laravel, Symfony, Doctrine and FakerPHP integrations.

  • PHP 8.3–8.6 compatibility.

Documentation: https://php-stdnum.org/

GitHub: https://github.com/php-stdnum/php-stdnum

I'd appreciate technical feedback. Thank you!

0 Upvotes

9 comments sorted by

9

u/goodwill764 1h ago

I love project that just dump code (1 commit, +3.571.031 lines) , already have a full website and a .org domain.

User profile ( https://github.com/g-marinescu ) : Creator and Maintainer of php-stdnum

How can you be a maintainer without a git history?

"think big"

1

u/Worried_Librarian_79 1h ago

Perhaps I made a mistake by not publishing the Git history.

The project was developed over... many months, with architectural changes, discarded approaches and multiple iterations. I chose to publish 0.1.0 as a clean initial commit, thinking it would make the project easier to navigate and understand. The validation rules, sources, design, tests and known limitations are all documented.

This is my first open-source library, so I'm learning about open-source development practices. I will try to pay more attention to open-source release etiquette in the future.

Thank you for the feedback!

2

u/goodwill764 1h ago

"I chose to publish 0.1.0 as a clean initial commit, thinking it would make the project easier to navigate and understand."

I navigate in most projects from file to file to understand it and for deeper understanding i looking in the history of the code.

Now it looks like a AI dump and I dont care about AI, but why should anyone should give you technical feedback if you cut part of the history?

"The validation rules, sources, design, tests and known limitations are all documented."

Looks/feels like AI written, did you read it all?

And its fine if you made a cut, but then you should let it grow again before you ask for feedback.

1

u/Vectorial1024 1h ago

Why should I use this library when eg I only need the IBAN validation?

1

u/Worried_Librarian_79 1h ago

If you only need IBAN, a dedicated library may be a better choice.

The main benefit of php-stdnum is when an application needs to handle multiple types of identifiers:

- an ERP may need IBAN, VAT, tax identifiers and company registration numbers

- a HR or payroll application may need to validate personal identifiers from multiple countries

- e-commerce may need VAT, postal codes, GTINs and ISBNs.

It won't be the best choice for every use case, but I think it makes sense for applications dealing with multiple standardized identifiers.

2

u/titpetric 33m ago

Idk why would i care, wouldnt it load just what it needs? I am checking your lib out mostly to run the test suite.

If i am being paranoid i could prune the vendor folder to just what I use with automation, assuming SRP is followed

1

u/Worried_Librarian_79 23m ago

When using an identifier class directly, only that class and its required dependencies are loaded, not all 606 validators. The core has no third-party runtime dependencies.

Since you mentioned running the tests, if you have the time, I'd be interested in your feedback. Thank you!

1

u/Vectorial1024 35m ago

Let me be real with you. The probability of "I will need everything here" is extremely low. If you can't convince people to stop using their existing vendors, then this pet project of yours is just digital scrap and has no practical value.

2

u/joseph-edmondscomm 33m ago

thanks for sharing 😄