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

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

terrazza/validator
==================

Terrazza Component Validator

1.0.2(4y ago)0221MITPHPPHP &gt;=7.4

Since May 17Pushed 4y agoCompare

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

READMEChangelog (3)Dependencies (4)Versions (4)Used By (1)

Terrazza/Validator
==================

[](#terrazzavalidator)

This component validates/approves content against schemas

*Object/Classes*
----------------

[](#objectclasses)

1. [ObjectValueSchema](#object-schema)
2. [ObjectValidator](#object-validator)

### ObjectValueSchema

[](#objectvalueschema)

Properties:

- name (string, required)
- type (string, required)
    - number
    - integer
    - double
    - array
    - boolean
    - string
    - object
    - oneOf (require setChildSchemas)
- required (bool, default=false)
- nullable (bool, default=false)
- patterns (string, optional)
    *only used for type: string*
- format (string, optional)
    *only used for type: string*
- minLength (int, optional)
    *only used for type: number, integer, double*
- maxLength (int, optional)
    *only used for type: number, integer, double*
- minItems (int, optional)
    *only used for type: array*
- maxItems (int, optional)
    *only used for type: array*
- minRange (float, optional)
    *only used for type: number, integer, double*
- maxRange (float, optional)
    *only used for type: number, integer, double*
- multipleOf (float, optional)
    *only used for type: number, integer, double*
- enum (scalar, optional)
    *only used for type: number, integer, double*
- childSchemas (arrayOf ObjectValueSchema, optional)

#### method: isMultipleType

[](#method-ismultipletype)

verifies if the type is one of

- oneOf

### ObjectValidator

[](#objectvalidator)

#### method: isValid

[](#method-isvalid)

calls method::validate but covered in a try/catch.
In case of catch the method returns false. Otherwise, the method returns true.

#### method: validate

[](#method-validate)

Validate the content against

- contentType
- validateArray
- validateString
- validateNumber
- validateFormat
- validateEnum
- validateMultipleTypes (e.g. oneOf)

#### method: getEncodedValue

[](#method-getencodedvalue)

Method try to solve some content : schema mismatches that could be solved.
In case of being able to solve a mismatch, the method

- set the type of the schema to the converted one
- returns the converted value

*Examples*

- expected type: integer, given "12"
- expected type: boolean, given "yes"

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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 ~2 days

Total

3

Last Release

1502d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/175504887?v=4)[webfux](/maintainers/webfux)[@webfux](https://github.com/webfux)

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k373.5M3.3k](/packages/symfony-cache)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6544.0M13](/packages/aporat-store-receipt-validator)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)

PHPackages © 2026

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