PHPackages                             dbout/symfony-constraints - 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. dbout/symfony-constraints

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

dbout/symfony-constraints
=========================

Symfony validation constraints

14191PHP

Since Sep 12Pushed 5y agoCompare

[ Source](https://github.com/dimitriBouteille/symfony-constraints)[ Packagist](https://packagist.org/packages/dbout/symfony-constraints)[ RSS](/packages/dbout-symfony-constraints/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Symfony Constraints
===================

[](#symfony-constraints)

Contient un ensemble de contraintes de validation pour Symfony 4.

### Installation

[](#installation)

```
composer require dbout/symfony-constraints
```

### Contraintes

[](#contraintes)

- `Latitude` Permet de valider une latitude. La latitude doit être comprise en -90deg et 90deg.

    ```
      /**
       * @Dbout\SfConstraints\Validator\Constraints\Latitude()
       */
      private $latitude;

    ```
- `Longitude` Permet de valider une longitude. La longitude doit être comprise en -180deg et 180deg.

    ```
      /**
       * @Dbout\SfConstraints\Validator\Constraints\Longitude()
       */
      private $longitude;

    ```
- `NotHtml` Permet de valider une chaine ne contenant pas de code html.

    ```
      /**
       * @Dbout\SfConstraints\Validator\Constraints\NotHtml()
       */
      private $description;

    ```
- `Password` Permet de valider un mot de passe.

    ```
      /**
       * @Dbout\SfConstraints\Validator\Constraints\Password()
       */
      private $plainPassword;

    ```
- `Phone` Permet de valider un numéro de téléphone au format français.

    ```
      /**
       * @Dbout\SfConstraints\Validator\Constraints\Phone()
       */
      private $phone;

    ```
- `Username` Permet de valider un pseudo qui doit être compris entre 3 et 25 caractères et ne contenir que des letters, des chiffres ou \_.

    ```
      /**
       * @Dbout\SfConstraints\Validator\Constraints\Username(message="Le pseudo doit être compris entre 3 et 25 caractères et non doit contenir aucun caractères spécial")
       */
      private $username;

    ```
- `PostalCode` Permet de valider un code postal au format français

    ```
      /**
       * @Dbout\SfConstraints\Validator\Constraints\PostalCode()
       */
      private $postalCode;

    ```
- `UniqueEntity` Permet de valider l'unicité d'une entitée selon une propriéte. Cette contrainte est similaire à la contraite `UniqueEntity` de Doctrine, à la seule différence que cette contrainte peut-être vérifier à l'extérieur d'un formulaire par le service `ValidatorInterface`.

    ```
       /**
        * @Dbout\SfConstraints\Validator\Constraints\UniqueEntity(message="Un compte existe déjà avec cette adresse email.")
        */
       private $email;

    ```

    L'utilisation de cette contrainte nécessite l'injection du service `@doctrine.orm.entity_manager`.

    ```
     services :

          ....

          Dbout\SfConstraints\Validator\Constraints\UniqueEntityValidator:
             arguments: ['@doctrine.orm.entity_manager']
             tags:
             - { name: validator.constraint_validator }

    ```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e5be30a5fa3cbb2c1ec8b80f81d752a6700dbca5a9ab419a508293e68fbde7c?d=identicon)[dimitriBouteille](/maintainers/dimitriBouteille)

---

Top Contributors

[![dimitriBouteille](https://avatars.githubusercontent.com/u/34821762?v=4)](https://github.com/dimitriBouteille "dimitriBouteille (13 commits)")

---

Tags

constraintsphp7symfonysymfony-servicesymfony4validator

### Embed Badge

![Health badge](/badges/dbout-symfony-constraints/health.svg)

```
[![Health](https://phpackages.com/badges/dbout-symfony-constraints/health.svg)](https://phpackages.com/packages/dbout-symfony-constraints)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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