PHPackages                             lumenpink/typesbr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lumenpink/typesbr

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lumenpink/typesbr
=================

Common types for Brazilian Documents and Numbers (Only CPF for now)

0.0.3(2y ago)07MITPHP

Since Jan 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lumenpink/typesbr)[ Packagist](https://packagist.org/packages/lumenpink/typesbr)[ RSS](/packages/lumenpink-typesbr/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

[![TypesBR](https://github.com/lumenpink/typesbr/actions/workflows/github-actions.yml/badge.svg)](https://github.com/lumenpink/typesbr/actions/workflows/github-actions.yml)

Lumenpink/Typesbr
=================

[](#lumenpinktypesbr)

Common types for Brazilian Documents and Numbers (only CPF for now)

Installation
------------

[](#installation)

Install it usingo composer

```
composer require lumenpink/typesbr
```

Usage
-----

[](#usage)

```
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)
}
```

Testing
-------

[](#testing)

We love the [PEST Suite](https://pestphp.com) by Nuno Maduro

To ruyn the tests just type:

```
vendor/bin/pest
```

Contributing
------------

[](#contributing)

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.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

850d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21f61b25fbda60e006aab8aafa1429285cffc8e63c19186f91bb095f7471cb03?d=identicon)[lumenpink](/maintainers/lumenpink)

---

Top Contributors

[![lumenpink](https://avatars.githubusercontent.com/u/614844?v=4)](https://github.com/lumenpink "lumenpink (13 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/lumenpink-typesbr/health.svg)

```
[![Health](https://phpackages.com/badges/lumenpink-typesbr/health.svg)](https://phpackages.com/packages/lumenpink-typesbr)
```

###  Alternatives

[bennettstone/magicmin

MagicMin is a PHP based javascript and stylesheet minification and merging class designed to generate minified, merged, and automatically updating files to simplify the process of minified file usage and updating when going between production and development environments.

495.4k](/packages/bennettstone-magicmin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
