PHPackages                             cancio-labs/cpf-value-object - 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. cancio-labs/cpf-value-object

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

cancio-labs/cpf-value-object
============================

A class that represents a CPF (Brazilian ID)

1.0.0(2y ago)01091GPL-3.0-or-laterPHPPHP &gt;=7.4

Since Jun 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/canciolabs/cpf-value-object)[ Packagist](https://packagist.org/packages/cancio-labs/cpf-value-object)[ Docs](https://github.com/canciolabs/cpf-value-object)[ RSS](/packages/cancio-labs-cpf-value-object/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (3)Used By (1)

CPF Value Object
================

[](#cpf-value-object)

This tiny package contains a class that represents a CPF (Brazilian ID).

Requirements
------------

[](#requirements)

PHP 7.4 or greater is required, nothing else.

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

[](#installation)

```
composer require cancio-labs/cpf-value-object

```

How to use it
-------------

[](#how-to-use-it)

```
use CancioLabs\ValueObject\Cpf\Cpf;

$cpf = new Cpf('170.317.330-90'); // or '17031733090'
echo $cpf; // outputs 17031733090
echo $cpf->getRaw(); // outputs 17031733090
echo $cpf->getFormatted(); // outputs 170.317.330-90

```

The CPF class will validate the given string and throw an exception if it's not a valid CPF.

Running Tests
-------------

[](#running-tests)

- From the project root, run: `vendor/bin/phpunit .`

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

732d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65afdceff66eba436390f0041cd197dfef88b72f96a719e11477c315eb797ebb?d=identicon)[nilosoares](/maintainers/nilosoares)

---

Top Contributors

[![nilosoares](https://avatars.githubusercontent.com/u/7283619?v=4)](https://github.com/nilosoares "nilosoares (1 commits)")

---

Tags

cpfphpvalue-objectValue Objectcpfbrasil

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cancio-labs-cpf-value-object/health.svg)

```
[![Health](https://phpackages.com/badges/cancio-labs-cpf-value-object/health.svg)](https://phpackages.com/packages/cancio-labs-cpf-value-object)
```

###  Alternatives

[moneyphp/money

PHP implementation of Fowler's Money pattern

4.8k91.5M522](/packages/moneyphp-money)[ulabox/money

Yet another PHP implementation of the Money value object using BCMath

79242.9k](/packages/ulabox-money)[wgenial/numeroporextenso

Converte numeral em valor por extenso.

4976.9k](/packages/wgenial-numeroporextenso)[adsmurai/currency

A small library to handle currencies and money values

4443.1k](/packages/adsmurai-currency)[gowork/values

PHP primitive types value objects.

3336.9k2](/packages/gowork-values)[money/money

PHP implementation of Fowler's Money pattern

1092.7k1](/packages/money-money)

PHPackages © 2026

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