Package Data | |
---|---|
Maintainer Username: | lumenpink |
Maintainer Contact: | hi@lumen.pink (Lumen Pink) |
Package Create Date: | 2024-01-15 |
Package Last Update: | 2024-01-17 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:03:31 |
Package Statistics | |
---|---|
Total Downloads: | 6 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Common types for Brazilian Documents and Numbers (only CPF for now)
Install it usingo composer
composer require lumenpink/typesbr
use Lumenpink/Typesbr/Cpf
# Create new CPF
$cpf = new Cpf('000.000.001-91') // it accepts with or without mask or leading zeroes
// it throwns an InvalidArgumentException if invalid
# Return only digits
$cpf->digits(); // returns 00000000191
# Or the formatted (masked) version
$Cpf->formated(); // returns 000.000.001-91
# Return the type of document
$Cpf->type(); // returns 'cpf'
# Use it as primitive type on a function
function foo (Cpf $cpf) {
do_something_with_this_shining_new_and_valid_cpf($cpf)
}
We love the PEST Suite by Nuno Maduro
To ruyn the tests just type:
vendor/bin/pest
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.