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

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

stantabcorp/validator
=====================

A PHP Validation library

1.3.0(2y ago)01.7kMITPHPPHP &gt;=8.1

Since Mar 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/stantabcorp/validator)[ Packagist](https://packagist.org/packages/stantabcorp/validator)[ RSS](/packages/stantabcorp-validator/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

Validator
=========

[](#validator)

A simple PHP validation library

[![PHP Composer](https://github.com/stantabcorp/validator/actions/workflows/php.yml/badge.svg?branch=main)](https://github.com/stantabcorp/validator/actions/workflows/php.yml)

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

[](#installation)

```
composer require stantabcorp/validator
```

Using the library
-----------------

[](#using-the-library)

```
$validator = new \Stantabcorp\Validator\Validator(["array" => ["to" => "validate"]]); // Init the library providing an array to validate.
$validator->required("array.to"); // Test if the key `to` in the array `array` is present.
$validator->array("array"); // Test if the key `array` is an array.

$validator->isValid(); // Return a boolean is the array is valid or not.

$validator->getErrors(); // Return a list of string containing the error messages.
```

### Custom validation

[](#custom-validation)

```
$validator->customValidation("array", function (\Stantabcorp\Validator\CustomValidator $customValidator) {
    $customValidator->getKey(); // The key (`array` in this case)
    $customValidator->getValue(); // The associated value

    // Mark the kay as invalid and add an error message.
    $customValidator->addError("This is an error message");
});
```

Testing
-------

[](#testing)

```
composer run-script test
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~116 days

Recently: every ~132 days

Total

8

Last Release

752d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4

1.2.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5327e23311a2e1157e38b676f316ba80ec836408b23a342dec4c0851ea91c19a?d=identicon)[stantabcorp](/maintainers/stantabcorp)

---

Top Contributors

[![thibaultjunin](https://avatars.githubusercontent.com/u/12583049?v=4)](https://github.com/thibaultjunin "thibaultjunin (19 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

318123.0k1](/packages/cognesy-instructor-php)[brandembassy/slim-nette-extension

19201.2k](/packages/brandembassy-slim-nette-extension)[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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