PHPackages                             dhii/validation-interface - 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. dhii/validation-interface

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

dhii/validation-interface
=========================

A base interface for validators

v0.2(7y ago)0139.4k↓28.3%8MITPHPPHP ^5.3 | ^7.0CI failing

Since Mar 10Pushed 5y ago3 watchersCompare

[ Source](https://github.com/Dhii/validation-interface)[ Packagist](https://packagist.org/packages/dhii/validation-interface)[ RSS](/packages/dhii-validation-interface/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (7)Dependencies (7)Versions (9)Used By (8)

Dhii - Validation - Interface
=============================

[](#dhii---validation---interface)

[![Build Status](https://camo.githubusercontent.com/b3a74591e74d9522432dea633a73be4fbede993432c0a9b42d0d7d580c37f932/68747470733a2f2f7472617669732d63692e6f72672f446869692f76616c69646174696f6e2d696e746572666163652e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/Dhii/validation-interface)[![Code Climate](https://camo.githubusercontent.com/76d697f737dd1324f963bbb628dffd782c4e7a3e02106e1a0e2532ceb012675c/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f446869692f76616c69646174696f6e2d696e746572666163652f6261646765732f6770612e737667)](https://codeclimate.com/github/Dhii/validation-interface)[![Latest Stable Version](https://camo.githubusercontent.com/6632f760eb6c984c4cd8b0e7846a1994418ccb2bdf55c886be7ba1cea871c887/68747470733a2f2f706f7365722e707567782e6f72672f646869692f76616c69646174696f6e2d696e746572666163652f76657273696f6e)](https://packagist.org/packages/dhii/validation-interface)

Simple interface for most basic validator implementations.

Details
-------

[](#details)

This package aims to standardize validators, so as to make consuming code compatible with a wide variety of validator implementations. Validation is such a common task that being able to validate in an interoperable way is extremely useful. Interfaces in this package aim to fix that by providing a common validation entry point on one side, and standards-compliant validation error exceptions on the other. This allow developers to take advantage of exception "bubbling" and handle validation errors where they think best, as well as to retrieve a list of human-readable validation error messages without knowledge of the validator internals, or prior reference to the validator object. Also, reporting validation failure as an exception is very convenient for cases where it is only possible to continue if a validation subject is valid.

### Interfaces

[](#interfaces)

- [`ValidatorInterface`](src/ValidatorInterface.php) - The central interface of the standard. Provides validation entry point (trigger) as `validate()`. Validators MUST implement this interface.
- [`ValidationFailedExceptionInterface`](src/Exception/ValidationFailedExceptionInterface.php) - Occurs when subject fails validation, and reports the failed subject, and the validator that validated the subject, as well as a list of validation error messages.
- [`ValidationExceptionInterface`](src/Exception/ValidationExceptionInterface.php) - Represents an error related to a validator.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.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 ~234 days

Recently: every ~261 days

Total

7

Last Release

1950d ago

PHP version history (3 changes)v0.1PHP ^5.3 | ^7.0

v0.3.0-alpha1PHP ^7.1

v0.3.0-alpha2PHP ^7.1 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1894e91b32c9f80d8f30a42d360af6983a507f1cf2c621b7c9a0a0de14e011c5?d=identicon)[XedinUnknown](/maintainers/XedinUnknown)

---

Top Contributors

[![XedinUnknown](https://avatars.githubusercontent.com/u/1428973?v=4)](https://github.com/XedinUnknown "XedinUnknown (127 commits)")[![mecha](https://avatars.githubusercontent.com/u/5425482?v=4)](https://github.com/mecha "mecha (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dhii-validation-interface/health.svg)

```
[![Health](https://phpackages.com/badges/dhii-validation-interface/health.svg)](https://phpackages.com/packages/dhii-validation-interface)
```

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