PHPackages                             myschoolmanagement/assert-constraint - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. myschoolmanagement/assert-constraint

ActiveLibrary[Testing &amp; Quality](/categories/testing)

myschoolmanagement/assert-constraint
====================================

Symfony validator constraints using beberlei/assert

2.02(3y ago)1791MITPHPPHP &gt;=7.2CI failing

Since Apr 21Pushed 1y ago8 watchersCompare

[ Source](https://github.com/MySchoolManagement/assert-constraint)[ Packagist](https://packagist.org/packages/myschoolmanagement/assert-constraint)[ RSS](/packages/myschoolmanagement-assert-constraint/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (15)Used By (0)

[Assert](https://github.com/beberlei/assert) bridge for Symfony
===============================================================

[](#assert-bridge-for-symfony)

[![Latest Stable Version](https://camo.githubusercontent.com/344bfced7e6e0daef6b577419cbd7695322045a23035c8648e2d868591534bd9/68747470733a2f2f706f7365722e707567782e6f72672f6d797363686f6f6c6d616e6167656d656e742f6173736572742d636f6e73747261696e742f762f737461626c65)](https://packagist.org/packages/myschoolmanagement/assert-constraint) [![Total Downloads](https://camo.githubusercontent.com/74a153d43b73799c638176e41b1423fabc7f2b522e5457a215b20ef1b9c7024e/68747470733a2f2f706f7365722e707567782e6f72672f6d797363686f6f6c6d616e6167656d656e742f6173736572742d636f6e73747261696e742f646f776e6c6f616473)](https://packagist.org/packages/myschoolmanagement/assert-constraint) [![Latest Unstable Version](https://camo.githubusercontent.com/b0f14b17d9a7fdf845359daed959f35476da03a8d62fa60e9adba63dce5722e7/68747470733a2f2f706f7365722e707567782e6f72672f6d797363686f6f6c6d616e6167656d656e742f6173736572742d636f6e73747261696e742f762f756e737461626c65)](https://packagist.org/packages/myschoolmanagement/assert-constraint) [![License](https://camo.githubusercontent.com/5bc2a2a2bf9df71f2a975cdc50de2967c1a5f5ab7c5ed4d02c29e1c1b7ecc834/68747470733a2f2f706f7365722e707567782e6f72672f6d797363686f6f6c6d616e6167656d656e742f6173736572742d636f6e73747261696e742f6c6963656e7365)](https://packagist.org/packages/myschoolmanagement/assert-constraint)

This is a simple bridge for using [beberlei/assert](https://github.com/beberlei/assert) assertions as constraints for the [Symfony Validator](https://github.com/symfony/validator) component.

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

[](#installation)

Using Composer:

```
composer require myschoolmanagement/assert-constraint
```

Configuration
=============

[](#configuration)

If you are using your own `Assertion` class or your own `Exception` class then you must configure these by setting `AssertionConstraint\AssertionValidator::$assertClass` and `AssertionConstraint\AssertionValidator::$assertExceptionClass`. These are both static properties.

Generating new constraints
==========================

[](#generating-new-constraints)

There is a helper for generating the constraint classes in `bin`. This is also copied to `vendor/bin`.

### Prototype

[](#prototype)

```
Usage: generate-constraints.php
```

### Example Usage:

[](#example-usage)

```
php vendor/bin/generate-constraints.php vendor/beberlei/assert/lib/Assert/Assertion.php Assert\\Assertion MyBundle\\Constraint src/MyBundle/Constraint
```

This will detect all the assertions on the `Assert\Assertion` class and output constraint files in `src/MyBundle/Constraint` in the `MyBundle\Constraint` namespace.

The generator will give best effort to detect the assertion parameters and add those to the constraint class so they can be configured through the annotation.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 91.3% 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 ~252 days

Recently: every ~441 days

Total

14

Last Release

394d ago

Major Versions

0.4.1 → 1.0.02019-04-23

1.0.0 → 2.0.02020-06-10

PHP version history (2 changes)0.1.0PHP &gt;=5.5

1.0.0PHP &gt;=7.2

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/760e4653c26faf737d8a87e92400e601feeda37ca5041cea630913c981bc5867?d=identicon)[seb2411](/maintainers/seb2411)

---

Top Contributors

[![iainmckay](https://avatars.githubusercontent.com/u/1223726?v=4)](https://github.com/iainmckay "iainmckay (21 commits)")[![capriolo](https://avatars.githubusercontent.com/u/6237479?v=4)](https://github.com/capriolo "capriolo (1 commits)")[![seb2411](https://avatars.githubusercontent.com/u/1470048?v=4)](https://github.com/seb2411 "seb2411 (1 commits)")

---

Tags

symfonyvalidationassertassertion

### Embed Badge

![Health badge](/badges/myschoolmanagement-assert-constraint/health.svg)

```
[![Health](https://phpackages.com/badges/myschoolmanagement-assert-constraint/health.svg)](https://phpackages.com/packages/myschoolmanagement-assert-constraint)
```

###  Alternatives

[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M571](/packages/beberlei-assert)[osteel/openapi-httpfoundation-testing

Validate HttpFoundation requests and responses against OpenAPI (3+) definitions

1201.9M6](/packages/osteel-openapi-httpfoundation-testing)[elliotchance/concise

Concise is test framework for using plain English and minimal code, built on PHPUnit.

45223.8k4](/packages/elliotchance-concise)[nilportugues/assert

A simple and elegant assertion and guard methods library for input validation.

1066.0k7](/packages/nilportugues-assert)[respect/assertion

The power of Respect\\Validation into an assertion library

2828.0k](/packages/respect-assertion)

PHPackages © 2026

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