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

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

cxj/validator
=============

functional programming parameter validation

0.0.4(5y ago)360[1 issues](https://github.com/cxj/validator/issues)GPL-3.0-onlyPHPPHP &gt;=7.4

Since Jun 3Pushed 3y ago3 watchersCompare

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

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Validator
=========

[](#validator)

[![Latest stable release](https://camo.githubusercontent.com/743ad45098f6f993d50fe2e87b9d844df8ef21abf7e5f7b845be4491385b4d32/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63786a2f76616c696461746f722e7376673f6c6162656c3d737461626c65)](https://packagist.org/packages/cxj/validator)[![Software license](https://camo.githubusercontent.com/34d2f67d92ae096b8c8f3b24beca8178912941bb922deccac3fc97c8f7dda408/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c2d696e666f726d6174696f6e616c2e737667)](LICENSE)[![Total downloads](https://camo.githubusercontent.com/047af3d446ccc83c338d59297cc521c74269adad38d8d1bbb66c62640542816a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63786a2f76616c696461746f722e7376673f636f6c6f723d627269676874677265656e)](https://packagist.org/packages/cxj/validator)[![StyleCI](https://camo.githubusercontent.com/0e7d36179053cf91e79ffd208bf7ffcb405b255826e9585443ea0cf684aee37f/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3236383938323738322f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/268982782?branch=master)[![Total stars](https://camo.githubusercontent.com/4e9eca7c06afb71d1619e74623bb5eb05b693d1f76d919e90c24b2dd1f55c7ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f63786a2f76616c696461746f722e7376673f636f6c6f723d627269676874677265656e)](https://github.com/cxj/validator)

This library contains efficient [functional programming](https://en.wikipedia.org/wiki/Functional_programming) (FP) routines to test the input and output parameters of your methods. With these validations, you can greatly reduce the amount of coding needed to write a safe implementation.

About
-----

[](#about)

This library is inspired by Larry Garfield's [book](https://leanpub.com/thinking-functionally-in-php) *Thinking Functionally in PHP* and builds upon Benjamin Eberlei's [assert package](https://github.com/beberlei/assert), and the [revised version](https://github.com/webmozart/assert) by Bernhard Schussek

Authors
-------

[](#authors)

- [Chris Johnson](https://github.com/cxj)

Contribute
----------

[](#contribute)

Contributions to the package are always welcome!

- Report any bugs or issues you find in the [issue tracker](https://github.com/cxj/validator/issues).
- You can get the source code at the package's [Git repository](https://github.com/cxj/validator).

License
-------

[](#license)

All contents of this package are licensed under the [GPL v3](https://github.com/cxj/validator/blob/master/LICENSE).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.8% 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 ~0 days

Total

4

Last Release

2174d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/50b6a3c2702ebb4b00d037d1dea201f293e38e347078dd5dd9bfff970bc02095?d=identicon)[cxj](/maintainers/cxj)

---

Top Contributors

[![cxj](https://avatars.githubusercontent.com/u/446131?v=4)](https://github.com/cxj "cxj (44 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/cxj-validator/health.svg)](https://phpackages.com/packages/cxj-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)
