PHPackages                             gryfoss/twig-anonymize - 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. gryfoss/twig-anonymize

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

gryfoss/twig-anonymize
======================

Basic anonymize filter which leaves first and last letter and replaces rest with asterisks.

v1.0.0(8mo ago)01MITPHPCI passing

Since Aug 14Pushed 8mo agoCompare

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

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

Twig Anonymize
==============

[](#twig-anonymize)

[![Tests](https://github.com/gryfoss/twig-anonymize/actions/workflows/tests.yml/badge.svg)](https://github.com/praetoriantechnology/twig-anonymize/actions/workflows/tests.yml)

Basic Twig Anonymize extension which allows you to anonymize texts in your twig frontend. It keeps first and last letter (if string longer than 2) and replaces the rest with symbols (asterisks by default). . If you have a variable called `mytext` then you can anonymize it by typing:

```
{{ mytext|anonymize }}
```

Filter has few options:

- keepLength: determines if original lenght of the text should be left intact or should it minify the hidden part.
- replacementChar: character to be used in for the replacement. Defaults to \*.

For example:

```
{{ mytext|anonymize(false, '!') }}
```

will not keep original length (replace with 3 symbols) and use '!' as the replacement char.

Warning: replacement length is always at least 3 symbols long, no matter the `keepLength` setting.

Installation
============

[](#installation)

Install using composer:

```
composer require gryfoss/twig-anonymize
```

Since this is not a bundle for Symfony or any other framework but just a simple filter you may need to tell your framework how to look for the filter.

In Symfony, in your `services.yaml`, add under `services`:

```
    gryfoss.twig.anonymize_extension:
        class: GryfOSS\Twig\Extension\AnonymizeExtension
        tags:
            - { name: twig.extension }
```

Contributing
============

[](#contributing)

We welcome contributions from everyone! Whether you're fixing bugs, adding new features, or improving documentation, your help is appreciated.

How to contribute:
------------------

[](#how-to-contribute)

- **🐛 Report issues**: Found a bug? [Open an issue](https://github.com/praetoriantechnology/twig-anonymize/issues/new) to let us know
- **💡 Feature requests**: Have an idea for improvement? [Create a feature request](https://github.com/praetoriantechnology/twig-anonymize/issues/new)
- **🔧 Pull requests**: Ready to contribute code? [Submit a pull request](https://github.com/praetoriantechnology/twig-anonymize/pulls)
- **📖 Documentation**: Help improve the documentation by submitting updates

Development setup:
------------------

[](#development-setup)

1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/twig-anonymize.git`
3. Install dependencies: `composer install`
4. Run tests: `composer test-all`
5. Make your changes
6. Ensure 100% test coverage: `composer check-coverage`
7. Submit a pull request

All contributions must maintain **100% test coverage** and pass all quality checks. Our automated CI/CD pipeline will verify this when you submit your pull request.

Thank you for contributing! 🎉

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance62

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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

Unknown

Total

1

Last Release

268d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b76a5fac115d24d698d09cc939a6922bf309732ae61d0f2f215ae9e7397658ea?d=identicon)[ideaconnect](/maintainers/ideaconnect)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gryfoss-twig-anonymize/health.svg)

```
[![Health](https://phpackages.com/badges/gryfoss-twig-anonymize/health.svg)](https://phpackages.com/packages/gryfoss-twig-anonymize)
```

###  Alternatives

[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

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