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

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

temkaa/validator
================

A simple validator implementation

v0.0.7(1y ago)02[5 issues](https://github.com/TemKaa1337/validator/issues)MITPHPPHP ^8.3

Since Jan 21Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (8)Used By (0)

### A PSR Container compatible Validator implementation.

[](#a-psr-container-compatible-validator-implementation)

### Installation

[](#installation)

```
composer require temkaa/validator

```

This package provides the following constraints:
------------------------------------------------

[](#this-package-provides-the-following-constraints)

### \#\[Count\]

[](#count)

Checks whether the specific value as exactly given count.

### \#\[GreaterThan\]

[](#greaterthan)

Checks whether the specific value is greater than expected.

### \#\[Initialized\]

[](#initialized)

Checks whether the specific property of object is initialized with any value.

### \#\[Length\]

[](#length)

Checks whether the specific value is in specified length range.

### \#\[LessThan\]

[](#lessthan)

Checks whether the specific value is less than expected.

### \#\[Negative\]

[](#negative)

Checks whether the specific value is negative (strictly less than 0).

### \#\[NotBlank\]

[](#notblank)

Checks whether the specific value is not blank (empty array/blank string/is not initialized).

### \#\[Positive\]

[](#positive)

Checks whether the specific value is positive (strictly greater than 0).

### \#\[Range\]

[](#range)

The same as Length but for `int` and `float`.

### \#\[Regex\]

[](#regex)

Checks whether the specific value matches given regexp expression.

### \#\[Cascade\]

[](#cascade)

If your object contains other object as property which you want to validate or array|iterable of objects you can place this attribute and validator will validate this object by its own constraints or array of objects.

### Usage:

[](#usage)

```
