PHPackages                             nowo-tech/anonymize-bundle - 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. [Database &amp; ORM](/categories/database)
4. /
5. nowo-tech/anonymize-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

nowo-tech/anonymize-bundle
==========================

Symfony bundle for anonymizing database records using Doctrine attributes and Faker generators. Perfect for test data generation, GDPR compliance, and data masking in development environments.

v1.0.17(1mo ago)1814↓46.9%MITPHPPHP &gt;=8.1 &lt;8.6CI passing

Since Jan 19Pushed 2mo agoCompare

[ Source](https://github.com/nowo-tech/AnonymizeBundle)[ Packagist](https://packagist.org/packages/nowo-tech/anonymize-bundle)[ Docs](https://github.com/nowo-tech/anonymize-bundle)[ RSS](/packages/nowo-tech-anonymize-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (29)Versions (46)Used By (0)

Anonymize Bundle
================

[](#anonymize-bundle)

[![CI](https://github.com/nowo-tech/AnonymizeBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/nowo-tech/AnonymizeBundle/actions/workflows/ci.yml) [![Packagist Version](https://camo.githubusercontent.com/5551d9de4d920085cff420d15646ab69c47f20055cdaaf46ba320400ef89b5bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f776f2d746563682f616e6f6e796d697a652d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/nowo-tech/anonymize-bundle) [![Packagist Downloads](https://camo.githubusercontent.com/5469c300cafca5e62adeb2a0d41097a7f6f9662fbad2af33fa7fa40e298fe449/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f776f2d746563682f616e6f6e796d697a652d62756e646c652e737667)](https://packagist.org/packages/nowo-tech/anonymize-bundle) [![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![PHP](https://camo.githubusercontent.com/8e58b490725ac49cc8e463c473173681b324c9d92d7854275a785db013ca3de7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f6c6f676f3d706870)](https://php.net) [![Symfony](https://camo.githubusercontent.com/71fcd26d8ba51b55b3881a7adb433250b257eaf74ebaaeca9965db5bdd1646ac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d362e3125324225323025374325323037253230253743253230382d3030303030303f6c6f676f3d73796d666f6e79)](https://symfony.com) [![GitHub stars](https://camo.githubusercontent.com/f5e32e1191c992f0fa817abf446bd2dcd00bdba080c0291d65ce6d4a49232818/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f776f2d746563682f616e6f6e796d697a652d62756e646c652e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nowo-tech/AnonymizeBundle)

> ⭐ **Found this useful?** [Install from Packagist](https://packagist.org/packages/nowo-tech/anonymize-bundle) · Give it a **star** on [GitHub](https://github.com/nowo-tech/AnonymizeBundle) so more developers can find it.

**Symfony bundle for database anonymization, test data generation, and GDPR compliance.** Anonymize database records using Doctrine attributes and Faker generators. Perfect for development environments, testing, data masking, and privacy compliance.

> 📋 **Compatible with Symfony 6.1+, 7.x, and 8.x** - This bundle requires Symfony 6.1 or higher (Symfony 6.0 is not supported).

Table of contents
-----------------

[](#table-of-contents)

- [What is this?](#what-is-this)
- [Quick Search Terms](#quick-search-terms)
- [Features](#features)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Requirements](#requirements)
- [Configuration](#configuration)
- [Commands](#commands)
- [Faker Types](#faker-types)
- [Documentation](#documentation)
- [Testing](#testing)
- [License](#license)
- [Contributing](#contributing)
- [Roadmap](#roadmap)
- [Author](#author)

What is this?
-------------

[](#what-is-this)

This bundle helps you **anonymize sensitive data** in your Symfony applications for:

- 🧪 **Test data generation** - Create realistic anonymized test datasets
- 🔒 **GDPR compliance** - Anonymize personal data for development/testing
- 🎭 **Data masking** - Replace sensitive information with fake but realistic data
- 🚀 **Development safety** - Work with anonymized data instead of real user data
- 📊 **Database anonymization** - Anonymize entire databases or specific entities

> ⚠️ **Important**: This bundle is **development-only** and should **never** be installed or used in production environments. The bundle includes built-in protection to prevent execution in production.

Quick Search Terms
------------------

[](#quick-search-terms)

Looking for: **database anonymization**, **test data generator**, **GDPR compliance**, **data masking**, **Symfony anonymize**, **Doctrine anonymization**, **Faker bundle**, **privacy tools**, **PII anonymization**, **data privacy**, **test fixtures**, **development tools**? You've found the right bundle!

Features
--------

[](#features)

- ✅ Attribute-based anonymization configuration
- ✅ Support for multiple Doctrine connections
- ✅ Multiple faker types (39 total: email, name, surname, age, phone, IBAN, credit card, address, date, username, url, company, masking, password, ip\_address, mac\_address, uuid, hash, coordinate, color, boolean, numeric, file, json, text, enum, country, language, hash\_preserve, shuffle, constant, dni\_cif, name\_fallback, html, pattern\_based, copy, null, utm, custom service)
- ✅ **FakerType enum** for type-safe faker selection (recommended) - IDE autocompletion and compile-time validation
- ✅ String-based faker types still supported (backward compatible)
- ✅ Weight-based anonymization order
- ✅ Pattern-based inclusion/exclusion filters
- ✅ Support for MySQL and PostgreSQL (MongoDB infrastructure ready in demos, ODM support coming soon)
- ✅ Batch processing for large datasets
- ✅ Dry-run mode for testing
- ✅ Anonymization tracking with `AnonymizableTrait` and `anonymized` column
- ✅ Pre-flight checks: Comprehensive validation before execution
- ✅ Progress bars: Visual progress indicators with real-time updates
- ✅ Enhanced environment protection: Multiple safety layers
- ✅ Debug and verbose modes: Detailed output for debugging
- ✅ Interactive mode: Step-by-step confirmations for safer anonymization
- ✅ Enhanced reporting: Export statistics to JSON/CSV with success rates
- ✅ Database export: Export databases to files with optional compression
- ✅ Configurable output directories: Customize where statistics and exports are saved
- ✅ Table truncation: Empty tables before anonymization with configurable execution order (for polymorphic entities, only rows of that discriminator are deleted)
- ✅ Custom entity anonymizer: Delegate anonymization to a service per entity via `anonymizeService` (`EntityAnonymizerServiceInterface`)
- ✅ **FrankenPHP** — Compatible with FrankenPHP (including worker mode); demos run with FrankenPHP and Caddy (see [demo/README.md](demo/README.md))

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

[](#installation)

> ⚠️ **Important**: This bundle is **development-only**. Always install it as a dev dependency.

```
composer require nowo-tech/anonymize-bundle --dev
```

Then, register the bundle in your `config/bundles.php` **only for dev and test environments**:

```
