Download the PHP package wwwd3v/name-parser-and-anonymizer without Composer
On this page you can find all versions of the php package wwwd3v/name-parser-and-anonymizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wwwd3v/name-parser-and-anonymizer
More information about wwwd3v/name-parser-and-anonymizer
Files in wwwd3v/name-parser-and-anonymizer
Package name-parser-and-anonymizer
Short Description An easy to use name parser with advanced and configurable anonymization.
License MIT
Informations about the package name-parser-and-anonymizer
Name Parser And Anonymizer
An easy to use name parser with advanced and configurable anonymization options.
Inspired by the European Union's GDPR, this library is very useful for performing mandatory personal data anonymization.
Getting Started
Prerequisites
- PHP 7.2+
- Composer
Installing
Simply install the composer package:
Then, at some point in your code, 'new up' a NameParserAndAnonymizer
class instance:
Parsing and anonymizing names
Simple names
It is trivial to parse a simple name:
Anonymizing names is then very simple:
Compound names
Middle names are parsed out and grouped in an array:
As a part of the anonymization process, the middle names are dropped:
Optionally, you can decide to keep
or anonymize
the middle names (rather than to discard
them):
Edge cases
Excessive whitespace
All the excessive whitespace is automatically removed. The resulting string representation of a parsed name always consists of names divided by a single space character:
Running the tests
Simply run the local phpunit:
Contributing
Just open an issue. We will decide on the implementation details and polish up the pull request together.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- European Union