PHPackages                             gabrielanhaia/masknizzer - 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. gabrielanhaia/masknizzer

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

gabrielanhaia/masknizzer
========================

Masknizzer is a package for the application of masks in fields.

36PHP

Since Jul 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/gabrielanhaia/masknizzer)[ Packagist](https://packagist.org/packages/gabrielanhaia/masknizzer)[ RSS](/packages/gabrielanhaia-masknizzer/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Masknizzer
==========

[](#masknizzer)

Masking fields has never been so easy!

Installation (Instalação)
=========================

[](#installation-instalação)

Installation by composer (Instalação pelo composer):

```
composer require gabrielanhaia/masknizzer
```

or add the dependency on your **composer.json** and: (ou adicione a denpendência em seu **composer.json** e:)

```
composer install
```

Use (Uso)
=========

[](#use-uso)

\####1 - Creating a new mask (Criando uma nova máscara):

You can use '\\Masknizzer\\EnumMasks' already has several formats or (É possível usar os formatos de máscara padrão em '\\Masknizzer\\EnumMasks' ou)

```
use Eloquent\Enumeration\AbstractEnumeration;

class CustomEnumMasks extends AbstractEnumeration
{
    /** @var string POSTAL_CODE Mask Brazilian postcode. / Máscara para código postal(CEP) Brasileiro. */
    const POSTAL_CODE = '#####-###';

    /** @var string PHONE_NUMBER Mask for 10-digit phone with area code. /
     *                           Máscara para telefone de 10 dígitos junto com código de região.
     */
    const PHONE_NUMBER_10 = '(##) ####-####';

    /** @var string PHONE_NUMBER Mask for 11-digit phone with area code. /
     *                           Máscara para telefone de 10 dígitos junto com código de região.
     */
    const PHONE_NUMBER_11 = '(##) ####-#####';
}
```

*Note: The masks should extender 'Eloquent\\Enumeration\\AbstractEnumeration' and follow the pattern of the mask defined in '\\Masknizzer\\EnumMasks'.*

*Observação: As máscaras customizadas devem extender de 'Eloquent\\Enumeration\\AbstractEnumeration' e as constantes devem seguir o padrão de '\\Masknizzer\\EnumMasks'.*

\####2 - Building a type of object masks (Construindo um objeto do tipo das máscaras):

```
use Masknizzer\EnumMasks;
use Masknizzer\MaskFactory;

$maskFieldPostalCode = MaskFactory::factory(EnumMasks::POSTAL_CODE(), 12345678);
```

or pass an Enum array as the first parameter , the function itself will decide which mask to use according to the number of characters of the field passed in the second parameter.

ou passe uma lista de Enum no primeiro parâmetro da factory, a própria classe irá decidir de acordo com o número de caracteres do campo qual máscara irá usar.

```
$maskGroupPhoneNumber = [
    EnumMasks::PHONE_NUMBER_10(),
    EnumMasks::PHONE_NUMBER_11()
];

$maskFieldPhoneNumbers = MaskFactory::factory($maskGroupPhoneNumber, 51123456789);
```

\###3 - Processing the mask in field (Processando a máscara no campo):

```
$maskedField = $maskFieldPostalCode->mask();
```

In the example the result is (No exemplo o resultado será): **12345-678**

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/70de9e48cd27f693c91e0b91c3afd82adf08d817cd5128a8b8b43f4431d6f7b4?d=identicon)[gabrielanhaia](/maintainers/gabrielanhaia)

---

Top Contributors

[![gabrielanhaia](https://avatars.githubusercontent.com/u/15172908?v=4)](https://github.com/gabrielanhaia "gabrielanhaia (28 commits)")

### Embed Badge

![Health badge](/badges/gabrielanhaia-masknizzer/health.svg)

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

PHPackages © 2026

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