PHPackages                             oihana/php-masking - 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. oihana/php-masking

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

oihana/php-masking
==================

Lightweight, framework-agnostic PHP data-masking toolkit: anonymize and redact document fields with composable maskers (email, phone, credit card, dates, ZIP, decimals, X-ify…) for dumps, fixtures and test data.

1.0.0(1mo ago)03091MPL-2.0PHPPHP &gt;=8.4CI passing

Since Jun 14Pushed 1mo agoCompare

[ Source](https://github.com/BcommeBois/oihana-php-masking)[ Packagist](https://packagist.org/packages/oihana/php-masking)[ Docs](https://github.com/BcommeBois/oihana-php-masking)[ RSS](/packages/oihana-php-masking/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (1)

Oihana PHP - Masking
====================

[](#oihana-php---masking)

[![Oihana PHP Masking](https://raw.githubusercontent.com/BcommeBois/oihana-php-masking/main/assets/images/oihana-php-masking-logo-inline-512x160.png)](https://raw.githubusercontent.com/BcommeBois/oihana-php-masking/main/assets/images/oihana-php-masking-logo-inline-512x160.png)

A lightweight, framework-agnostic PHP toolkit to **anonymize and redact** the fields of your documents.

[![Latest Version](https://camo.githubusercontent.com/46125f1a3a42976ac80ee54aa3d95c71bae104e33b5f91ff21334ff8758e4383/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6968616e612f7068702d6d61736b696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oihana/php-masking)
[![Total Downloads](https://camo.githubusercontent.com/cba8d38cef9801a24795ca46807308774bbf07087758a38d8090ba2aedf78262/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6968616e612f7068702d6d61736b696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oihana/php-masking)
[![License](https://camo.githubusercontent.com/00b3aa295287d8ab89ab4f967acb53a4df17de69be9b96d7533ed59b155958b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f6968616e612f7068702d6d61736b696e672e7376673f7374796c653d666c61742d737175617265)](LICENSE)

📚 Documentation
---------------

[](#-documentation)

User guides (FR + EN), with narrative explanations, examples and recipes:

🇬🇧 **[English documentation](wiki/en/README.md)**🇫🇷 **[Documentation française](wiki/fr/README.md)**Getting started, the masking rules, the maskers catalogue, testing.Démarrage, les règles de masquage, le catalogue des maskers, tests.Auto-generated API reference (phpDocumentor):
👉

🚀 Features
----------

[](#-features)

- 🎭 **10 composable maskers** — `email`, `phone`, `creditCard` (Luhn-valid), `datetime`, `decimal`, `integer`, `zip`, `random`, `randomString`, `xifyFront`.
- 🗂️ **Document engine** — apply a list of path-based rules to a whole document, descending into nested objects and arrays.
- 🧭 **Expressive path DSL** — target a leaf by name, exact dotted path, name-at-any-depth (`.name`), wildcard (`*`) or a backtick-quoted literal key.
- 🛡️ **Identity-safe, your way** — pass the attributes to protect from masking; fully data-store agnostic (no field name is hardcoded).
- 🧱 **Standalone functions, no framework** — autoloaded via `composer.autoload.files`, strongly-typed enums instead of *magic strings*.
- 🧪 **100% unit-tested**.

💡 Designed to be lightweight, testable and compatible with any PHP 8.4+ project — dumps, fixtures, test data, GDPR/PII redaction.

📦 Installation
--------------

[](#-installation)

> **Requires [PHP 8.4+](https://php.net/releases/)**

Install via [Composer](https://getcomposer.org):

```
composer require oihana/php-masking
```

⚡ Quick start
-------------

[](#-quick-start)

```
