PHPackages                             phossa2/validate - 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. phossa2/validate

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

phossa2/validate
================

A PHP validation proxy to various validate libraries.

2.0.0(9y ago)05MITPHPPHP ~5.4|~7.0

Since Sep 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/phossa2/validate)[ Packagist](https://packagist.org/packages/phossa2/validate)[ Docs](https://github.com/phossa2/validate)[ RSS](/packages/phossa2-validate/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

phossa2/validate
================

[](#phossa2validate)

[![Build Status](https://camo.githubusercontent.com/8f407832bf7acb231417c0cfa700c389b280eaf5c8e54c06cb7c35a2cd249202/68747470733a2f2f7472617669732d63692e6f72672f70686f737361322f76616c69646174652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phossa2/validate)[![Code Quality](https://camo.githubusercontent.com/92ad40d05c13708ab1a8e389bc34af1c3e4e1ce12416d630471c1d23a76c4eb2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70686f737361322f76616c69646174652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phossa2/validate/)[![Code Climate](https://camo.githubusercontent.com/c526ca1ab55320aa39c25243bf17e1e0c90a289c8b9de0c99e0f35898807dac2/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f70686f737361322f76616c69646174652f6261646765732f6770612e737667)](https://codeclimate.com/github/phossa2/validate)[![PHP 7 ready](https://camo.githubusercontent.com/14b0bfb15a05604af71180cb1f6e7ce6f2b42b71065914bdaec695aa0b6709e0/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f70686f737361322f76616c69646174652f6d61737465722f62616467652e737667)](https://travis-ci.org/phossa2/validate)[![HHVM](https://camo.githubusercontent.com/ae50894d7a59185e503f38d219a00ab6c167dbb74163123e72c0301f99d6020e/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f70686f737361322f76616c69646174652e7376673f7374796c653d666c6174)](http://hhvm.h4cc.de/package/phossa2/validate)[![Latest Stable Version](https://camo.githubusercontent.com/06619188572d8b98cc069190deab2635b51701934ee66939df56b80782b74c09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f70686f737361322f76616c69646174652e7376673f7374796c653d666c6174)](https://packagist.org/packages/phossa2/validate)[![License](https://camo.githubusercontent.com/4fc6538ded72843e26a272d300ce4c95da083ce92576e10e4fdd505d579a8125/68747470733a2f2f696d672e736869656c64732e696f2f3a6c6963656e73652d6d69742d626c75652e737667)](http://mit-license.org/)

**phossa2/validate** is a PHP validation proxy to various validate libraries.

It requires PHP 5.4, supports PHP 7.0+ and HHVM. It is compliant with [PSR-1](http://www.php-fig.org/psr/psr-1/ "PSR-1: Basic Coding Standard"), [PSR-2](http://www.php-fig.org/psr/psr-2/ "PSR-2: Coding Style Guide"), [PSR-3](http://www.php-fig.org/psr/psr-3/ "PSR-3: Logger Interface"), [PSR-4](http://www.php-fig.org/psr/psr-4/ "PSR-4: Autoloader"), and the proposed [PSR-5](https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md "PSR-5: PHPDoc").

Installation
------------

[](#installation)

Install via the `composer` utility.

```
composer require "phossa2/validate"
```

or add the following lines to your `composer.json`

```
{
    "require": {
       "phossa2/validate": "^2.0.0"
    }
}
```

Usage
-----

[](#usage)

Create the validate instance,

```
use Phossa2\Validate\Validate;

$v = new Validate();

if (true === $v->validate($_POST, [
    'username' => 'required|alpha_numeric',
    'password' => 'required|max_len,100|min_len,6'
])) {
    // continue
} else {
    $err = $v->getError();
}
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) from more information.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTE](CONTRIBUTE.md) for more information.

Dependencies
------------

[](#dependencies)

- PHP &gt;= 5.4.0
- phossa2/shared &gt;= 2.0.21
- [wixel/gump](https://github.com/Wixel/GUMP) &gt;= 1.4

License
-------

[](#license)

[MIT License](http://mit-license.org/)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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

Unknown

Total

1

Last Release

3565d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19922046?v=4)[Hong Zhang](/maintainers/phossa2)[@phossa2](https://github.com/phossa2)

---

Top Contributors

[![phossa](https://avatars.githubusercontent.com/u/8499165?v=4)](https://github.com/phossa "phossa (11 commits)")[![phossa2](https://avatars.githubusercontent.com/u/19922046?v=4)](https://github.com/phossa2 "phossa2 (1 commits)")

---

Tags

validatephossa

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/phossa2-validate/health.svg)

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

###  Alternatives

[webmozart/assert

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

7.6k930.0M1.6k](/packages/webmozart-assert)[wixel/gump

A fast, extensible &amp; stand-alone PHP input validation class that allows you to validate any data.

1.2k1.4M31](/packages/wixel-gump)[inhere/php-validate

generic data validate, filter library of the php

26089.0k13](/packages/inhere-php-validate)[sadegh19b/laravel-persian-validation

A comprehensive Laravel validation package for Persian text, numbers, dates, and Iranian national identifiers

18598.1k1](/packages/sadegh19b-laravel-persian-validation)[abcaeffchen/sepa-utilities

SepaUtilities provides useful methods for validating and sanitizing inputs used in SEPA files supporting PHP &gt;= 8.1.

312.1M3](/packages/abcaeffchen-sepa-utilities)[awurth/slim-validation

A wrapper around the respect/validation PHP validation library for easier error handling and display

65399.7k9](/packages/awurth-slim-validation)

PHPackages © 2026

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