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(3y ago)0221MITPHPPHP &gt;=7.4

Since May 17Pushed 3y agoCompare

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

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 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity50

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

1457d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6aac82b92100438501756aab68d05fe45243631c8901ac45f75b07cef378ef04?d=identicon)[webfux](/maintainers/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

[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[typo3/html-sanitizer

HTML sanitizer aiming to provide XSS-safe markup based on explicitly allowed tags, attributes and values.

279.6M2](/packages/typo3-html-sanitizer)[j-ben87/parsley-bundle

Convert Symfony constraints into data-attributes for client-side validation with Parsley.

1432.7k](/packages/j-ben87-parsley-bundle)

PHPackages © 2026

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