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

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

medusa/validation
=================

Validation Objects for common Use-Cases

0.9.2(5y ago)011MITPHPPHP &gt;=7.4

Since May 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/medusaphp/validation)[ Packagist](https://packagist.org/packages/medusa/validation)[ RSS](/packages/medusa-validation/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Medusa Validations
==================

[](#medusa-validations)

Goals
-----

[](#goals)

This library is created to provide a common interface for simple scalar value validations in an OOP way.

Examples
--------

[](#examples)

Lets have a look at some examples of how to use these Validations, at first we will see how so use it to validate an value.

```
use Medusa\Validation\HashValidation;use Medusa\Validation\Result\ResultInterface;

$val = new HashValidation(32);  // validate for hashes with a length of 32
/** @var ResultInterface $res */
$res = $val->validate('asdf');
```

that way you can use most of the provides Validation classes. As next step let's see how to work with results in the most simple way.

```
use Medusa\Validation\Result\ResultInterface;
/** @var ResultInterface $res */
if ($res->isValid()) {
    echo 'yeah - its a valid hash-32';
} else {
    echo 'oh no someethin went wrong...';
    echo $res->getReason();
}
```

for further information in a technical perspective you can also have a look at ReturnCodes.

```
use Medusa\Validation\HashValidation;
use Medusa\Validation\Result\ResultInterface;
/** @var ResultInterface $res */
if ($res->isValid()) {
    echo 'fine again :)';
} else {
    // 'oh no - not again';
    if ($res->getReturnCode() === HashValidation::INVALID_CHARACTER_OUT_OF_BOUNDS) {
        // ok give advice what went wrong
    }
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity44

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.

###  Release Activity

Cadence

Every ~2 days

Total

3

Last Release

1825d ago

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ronanguilloux/isocodes

PHP library - Validators for standards from ISO, International Finance, Public Administrations, GS1, Book and Music Industries, Phone numbers &amp; Zipcodes for many countries

8013.3M23](/packages/ronanguilloux-isocodes)[borales/yii2-phone-input

Yii2 International telephone numbers - Asset Bundle, Behavior, Validator, Widget

1341.6M6](/packages/borales-yii2-phone-input)[ipub/phone

Phone helper &amp; validator for Nette Framework

1285.3k6](/packages/ipub-phone)[yii2mod/yii2-validators

Collection of useful validators for Yii Framework 2.0

1816.8k](/packages/yii2mod-yii2-validators)

PHPackages © 2026

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