alexeevdv / indonesia-personal-id
1.0.1
2018-05-06 13:52 UTC
Requires (Dev)
- codeception/codeception: ~2.4.1
- squizlabs/php_codesniffer: ~3.2.3
This package is auto-updated.
Last update: 2024-10-29 05:28:27 UTC
README
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require alexeevdv/indonesia-personal-id "~1.0.0"
or add
"alexeevdv/indonesia-personal-id": "~1.0.0"
to the require
section of your composer.json
file.
Usage
Validator
use alexeevdv\personalid\indonesia\Validator; $validator = new Validator; $isValid = $validator->validate('NIK_TO_BE_VALIDATED');
Parser
use alexeevdv\personalid\indonesia\Parser; $parser = new Parser; // Returns identity instance $identity = $parser->parse('NIK_TO_BE_PARSED'); echo $identity->birthDate()->format('Y-m-d');
Builder
use alexeevdv\personalid\indonesia\Builder; $builder = new Builder; $randomNik = $builder->random(); // Generates NIK from identity instance $nikFromIdentity = $builder->fromIdentity($identity);
Identity
You can find full methods list in \alexeevdv\personalid\indonesia\Identity