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

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

revenuewire/validator
=====================

RW Helpers

v1.1.14(6y ago)01.7k↓84.4%[1 PRs](https://github.com/revenuewire/validator/pulls)Apache-2.0PHPCI passing

Since Oct 18Pushed 4mo ago7 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (20)Used By (0)

[![Build Status](https://camo.githubusercontent.com/3eb495f4aeb1b6a31594efde89f9a0461bc5c6a0ae8db9f7df7318e3c90b025f/68747470733a2f2f7472617669732d63692e6f72672f726576656e7565776972652f76616c696461746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/revenuewire/validator)[![Coverage Status](https://camo.githubusercontent.com/9134989d31354a6c8ca658eb9c155595babc9c26ce411a80ba19760d9a11ee40/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f726576656e7565776972652f76616c696461746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/revenuewire/validator?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/2dc6e92f212c359d7bbb898970a1561731aa76f2f5bc7d1a8f92f9d0098cd909/68747470733a2f2f706f7365722e707567782e6f72672f726576656e7565776972652f76616c696461746f722f762f737461626c65)](https://packagist.org/packages/revenuewire/validator)[![License](https://camo.githubusercontent.com/28ed484907449f9227dc143e79d4daf59cae0110b2d8820ca14a1ded9652b10f/68747470733a2f2f706f7365722e707567782e6f72672f726576656e7565776972652f76616c696461746f722f6c6963656e7365)](https://packagist.org/packages/revenuewire/validator)[![composer.lock](https://camo.githubusercontent.com/d1c0431d1d95add4feb99c816f3714938ea70236083cc056c1a0c84234ce389e/68747470733a2f2f706f7365722e707567782e6f72672f726576656e7565776972652f76616c696461746f722f636f6d706f7365726c6f636b)](https://packagist.org/packages/revenuewire/validator)

Quick Start
===========

[](#quick-start)

Install
-------

[](#install)

```
composer require revenuewire/validator
```

Usages
------

[](#usages)

### Simple Example

[](#simple-example)

```
//example of testing my age
$validator = new \RW\Validator();
$result = $validator->validateAge(20, "myAge", ["min" => 18, "max" => 99]);
var_dump($result); //true

//same validator, but using birthday
$validator = new \RW\Validator();
$result = $validator->validateAge("1987-01-08", "myAge", ["min" => 18, "max" => 99]);
var_dump($result); //true

$validator = new \RW\Validator();
$result = $validator->validateAge(16, "myAge", ["min" => 18, "max" => 99]);
var_dump($result); //false

/**
*  [
*     "key" => "myAge",
*     "error" => "myAge must be greater than 18.",
*     "contexts" => [
*        "min" => 18, "max" => 99
*     ]
*  ]
*/
var_dump($validator->getValidateResult());
```

Options
-------

[](#options)

OptionsCommentsmaxIf it is string validation, use strlen().minIf it is string validation, use strlen().allowedValuesAn array of items allowed for a given datavalidExceptionsAn array of characters that always consider valid regardless the type check. For examples, if the validException is set to be \["\_", "-"\], and combine with alnum, you will have validate against alpha-numeric with exception of underscore and dashalnumOnly alpha-numeric are valid.alphaOnly alphabets are valid.upperOnly upper case alphabets are valid.lowerOnly lower case alphabets are valid.dateFormatcheck the date format to matchcountryFormat\[ alpha2, alpha3, numeric \] check the country data with alpha2 (default for country validation)

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance52

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~43 days

Recently: every ~124 days

Total

16

Last Release

2217d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49867?v=4)[Shuan Wang](/maintainers/swang)[@swang](https://github.com/swang)

---

Top Contributors

[![cosmostail](https://avatars.githubusercontent.com/u/2172362?v=4)](https://github.com/cosmostail "cosmostail (1 commits)")[![yourGuy](https://avatars.githubusercontent.com/u/6990064?v=4)](https://github.com/yourGuy "yourGuy (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[toplan/laravel-sms

A mobile phone number validation solution based on laravel

83580.2k2](/packages/toplan-laravel-sms)[drupal/coder

Coder is a library to review Drupal code.

3046.8M629](/packages/drupal-coder)[ph-7/eu-vat-validator

A simple and clean PHP class that validates EU VAT numbers against the central ec.europa.eu database (using the official europa API).

97510.7k1](/packages/ph-7-eu-vat-validator)[hyperf/validation

hyperf validation

122.2M213](/packages/hyperf-validation)[udokmeci/yii2-phone-validator

Modern Yii2 Phone validator wrapper on top of PhoneNumberUtil library also used by Android devices

36227.5k1](/packages/udokmeci-yii2-phone-validator)[snowcap/vat-validation

EU VAT number validation

10112.3k](/packages/snowcap-vat-validation)

PHPackages © 2026

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