PHPackages                             predaddy/predaddy-symfony-validator - 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. predaddy/predaddy-symfony-validator

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

predaddy/predaddy-symfony-validator
===================================

Symfony validation component for predaddy

46PHP

Since Nov 9Pushed 11y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

predaddy-symfony-validator
==========================

[](#predaddy-symfony-validator)

[![Latest Stable Version](https://camo.githubusercontent.com/817959861f4e7b5991129692203e6366e09b572248e7c1aea8d3fd1954c21c77/68747470733a2f2f706f7365722e707567782e6f72672f70726564616464792f70726564616464792d73796d666f6e792d76616c696461746f722f762f737461626c652e706e67)](https://packagist.org/packages/predaddy/predaddy-symfony-validator)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a612a3add4b5d7230303c7169260149241f0f170e234554651e4f22819685666/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f737a6a616e692f70726564616464792d73796d666f6e792d76616c696461746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/szjani/predaddy-symfony-validator/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/40c9fd3aeb3040dd68152ee7485043834e7ec9c19ba5cb24231a471a43808d15/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f36653939313862652d373765322d343965622d623963322d3361323631333566636335632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/6e9918be-77e2-49eb-b9c2-3a26135fcc5c)[![Gitter chat](https://camo.githubusercontent.com/164a1a215d1e030b099c828277ee7f2c4f85ca12d124a9ca9268ee01951f2a2f/68747470733a2f2f6261646765732e6769747465722e696d2f737a6a616e692f70726564616464792e706e67)](https://gitter.im/szjani/predaddy)

master[![Build Status](https://camo.githubusercontent.com/d858470389d245555f87eb1aa54dec6fc39f19793d1878a1c377d0362c15fdfd/68747470733a2f2f7472617669732d63692e6f72672f737a6a616e692f70726564616464792d73796d666f6e792d76616c696461746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/szjani/predaddy-symfony-validator)[![Coverage Status](https://camo.githubusercontent.com/2df8e5c1eae091f0751c0531f6c89a546e4f612128047be72a898bb2493a3663/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f737a6a616e692f70726564616464792d73796d666f6e792d76616c696461746f722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/szjani/predaddy-symfony-validator?branch=master)The `ValidationInterceptor` provided by this library helps validating messages posted to [predaddy](https://github.com/szjani/predaddy) `MessageBus`. It is based on [Symfony Validator](https://github.com/symfony/Validator) component.

Usage
-----

[](#usage)

```
$bus = SimpleMessageBus::builder()
    ->withInterceptors([new ValidatorInterceptor()])
    ->build();
```

```
class CreateUser
{
    /**
     * @Assert\Length(min = 3)
     * @Assert\NotBlank
     */
    private $name;

    /**
     * @Assert\Email
     * @Assert\NotBlank
     */
    private $email;

    public function __construct($name, $email)
    {
        $this->name = $name;
        $this->email = $email;
    }

    /**
     * @Assert\True(message = "The user should have a Google Mail account")
     */
    public function isGmailUser()
    {
        return false !== strpos($this->email, '@gmail.com');
    }

    public function __toString()
    {
        return Objects::toStringHelper($this)
            ->add('name', $this->name)
            ->add('email', $this->email)
            ->toString();
    }
}
```

```
try {
    $bus->post(new CreateUser('John Doe', 'john@example.com'));
} catch (ValidationException $e) {
    $e->getViolationList();
}
```

If you use annotation constraints, do not forget to register its namespace:

```
AnnotationRegistry::registerAutoloadNamespace('Symfony\Component\Validator\Constraint', 'path/to/symfony/library/validator');
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/faa30d54ade49d7bd9505065e383614a5ec2302ccc5e985412b749234955e6ea?d=identicon)[szjani](/maintainers/szjani)

### Embed Badge

![Health badge](/badges/predaddy-predaddy-symfony-validator/health.svg)

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

###  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)
