PHPackages                             alister/reserved-names-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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. alister/reserved-names-bundle

AbandonedArchivedSymfony-bundle[Validation &amp; Sanitization](/categories/validation)

alister/reserved-names-bundle
=============================

This bundle checks against a list of reserved names, &amp; some variants

v2.1.0(6y ago)22051[1 PRs](https://github.com/alister/ReservedNamesBundle/pulls)MITPHP

Since Nov 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/alister/ReservedNamesBundle)[ Packagist](https://packagist.org/packages/alister/reserved-names-bundle)[ RSS](/packages/alister-reserved-names-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (9)Versions (23)Used By (0)

ReservedNamesBundle - alister/reserved-names-bundle
===================================================

[](#reservednamesbundle---alisterreserved-names-bundle)

A bundled service to clean, and check, a given username against an (extensible) list of reserved words/usernames.

Note: This DOES NOT validate usernames. That should happen (and potentially disallow names) before getting to this stage.

Installation and use
====================

[](#installation-and-use)

1. Add to app/AppKernel.php

    ```
    $bundles = array(
        new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
        // ... many others

        new Alister\ReservedNamesBundle\AlisterReservedNamesBundle(),
    );
    ```
2. Add to app/config/config.yml

    ```
    alister_reserved_names:
        names:
            # These keys will be lower-cased
            - myname
            - myothername
            - alister
            - private
    ```
3. Use

    ```
    $username = 'myname_123';
    $reserved = $this->container->get('alister_reserved_names.check');
    if ($reserved->isReserved($username)) {
        echo "{$username} is reserved";
    }
    ```
4. Services provided:

- alister\_reserved\_names.check
    - Check username does not match a reserved name, before or after calling @cleanusername
    - @see Alister\\ReservedNamesBundle\\Services\\ReservedNames
    - The code also strips off trailing 's', and then additional noise characters (digits, -, \_) for a final test against the reserved names
- alister\_reserved\_names.cleanusername
    - remove 'noise characters' around the given username
    - EG: myname\_123 becomes myname
    - @see Alister\\ReservedNamesBundle\\Services\\CleanUserNames

Included tests
--------------

[](#included-tests)

Testing is done with the classes directly, and also via a container, to test the service initialisation. This also allows a check for the 'local reservations' - extra names that can be defined in the local application. The container-based test includes a micro-application to build the container, and so run the full test. [How to create a test setup for a local test of the service](http://blog.kevingomez.fr/2013/01/09/functional-testing-standalone-symfony2-bundles/).

@todo
-----

[](#todo)

Make a validator (from existing code) and put into this bundle, with tests and examples See:

Badges
------

[](#badges)

[![Build Status](https://camo.githubusercontent.com/90b3861a4fdaf41750e039667a14055c22b08cc5ffa6ad50877c57a79d1af657/68747470733a2f2f7472617669732d63692e6f72672f616c69737465722f52657365727665644e616d657342756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alister/ReservedNamesBundle) [![SensioLabsInsight](https://camo.githubusercontent.com/7eeab80389091f0e99ef0b4c849517860ab34f213cdb4612db15b5891f1305f7/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f38626536623163622d663438642d343434372d623962342d3638326635343961613430632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/8be6b1cb-f48d-4447-b9b4-682f549aa40c) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/d9f81d183a02839c1df409c0fdf709ae72d4a85837dd33ac95bf9b340caf36d2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c69737465722f52657365727665644e616d657342756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alister/ReservedNamesBundle/?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/9ddf1efd75d275955562c84294331b6c1ac386c7803f6fde3604b1bae71be834/68747470733a2f2f706f7365722e707567782e6f72672f616c69737465722f72657365727665642d6e616d65732d62756e646c652f762f737461626c652e737667)](https://packagist.org/packages/alister/reserved-names-bundle) [![Total Downloads](https://camo.githubusercontent.com/475a3234be1e58f56cac01b555a35572b128518135ef64a348c4e2761856cd10/68747470733a2f2f706f7365722e707567782e6f72672f616c69737465722f72657365727665642d6e616d65732d62756e646c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/alister/reserved-names-bundle) [![Latest Unstable Version](https://camo.githubusercontent.com/0fa2277b3f8a0761fdaea6fa05a6d91067691a159b6fb3b37bc37d4b5691e9e1/68747470733a2f2f706f7365722e707567782e6f72672f616c69737465722f72657365727665642d6e616d65732d62756e646c652f762f756e737461626c652e737667)](https://packagist.org/packages/alister/reserved-names-bundle) [![License](https://camo.githubusercontent.com/c6cf24b4b5bcd359e1d23b90e33d0d739e46afb8ada545578f4ba709ceebd118/68747470733a2f2f706f7365722e707567782e6f72672f616c69737465722f72657365727665642d6e616d65732d62756e646c652f6c6963656e73652e737667)](https://packagist.org/packages/alister/reserved-names-bundle)

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 97.2% 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

Every ~95 days

Recently: every ~181 days

Total

20

Last Release

2388d ago

Major Versions

1.5.1 → v2.0.02018-12-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fcd33e037f41d017ef6dbc2c1df7f5110ace7e2ba70a8358aa0611ff87dc6bc?d=identicon)[alister](/maintainers/alister)

---

Top Contributors

[![alister](https://avatars.githubusercontent.com/u/173165?v=4)](https://github.com/alister "alister (70 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

bundlephpsymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/alister-reserved-names-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/alister-reserved-names-bundle/health.svg)](https://phpackages.com/packages/alister-reserved-names-bundle)
```

###  Alternatives

[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[cuyz/valinor-bundle

Symfony integration of `cuyz/valinor` — a library that helps to map any input into a strongly-typed value object structure.

51215.0k2](/packages/cuyz-valinor-bundle)[isometriks/spam-bundle

Provides spam protection for Symfony forms

46200.6k1](/packages/isometriks-spam-bundle)[digitalrevolution/symfony-request-validation

Automatic request validation for symfony

1296.0k](/packages/digitalrevolution-symfony-request-validation)

PHPackages © 2026

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