Download the PHP package lemmon/validator without Composer
On this page you can find all versions of the php package lemmon/validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lemmon/validator
More information about lemmon/validator
Files in lemmon/validator
Package validator
Short Description A lightweight, fluent validation library for PHP.
License MIT
Homepage https://github.com/lemmon/validator-php
Informations about the package validator
Lemmon Validator
Lemmon Validator is a PHP library with no third-party Composer dependencies for validating and
transforming scalar values, indexed arrays, and nested schemas for associative arrays or stdClass
objects through a fluent API. It combines form-safe coercion, ordered pipelines, and structured errors
for exception and non-exception workflows.
[!NOTE] Lemmon Validator is pre-1.0 and under active development. Minor releases may contain breaking changes; review the changelog before upgrading.
Installation
Requirements: PHP 8.3 or higher with the mbstring extension
Quick Start
Validators accept null by default. Use required() when a value must be present.
Features
- No third-party Composer dependencies — the runtime depends only on PHP and
mbstring - Strict runtime type validation for strings, integers, floats, booleans, indexed arrays,
associative arrays, and
stdClassobjects; conversions are opt-in throughcoerce() - Form-safe optional fields — validators accept
nullunlessrequired(); numeric, boolean, and container coercion turns an empty string intonull, while strings can opt in withnullifyEmpty() - Predictable processing — pipeline steps execute in chain order, then
default()andrequired()resolve the final value - Composable schemas — validate nested data, omit undeclared fields by default, or retain them
explicitly with
passthrough() - Structured errors — stable codes, dotted display paths, exact path segments, messages, and parameters support programmatic handling, i18n, path filtering, and JSON serialization
- Extensible rules — use PHP callables with
transform(),pipe(), andsatisfies(), or compose validators with logical combinators
Philosophy
Lemmon Validator focuses on core validation and predictable schema behavior rather than reimplementing every specialized rule. Its transformation and custom-validation methods accept ordinary PHP callables, so application-specific behavior can be composed without framework integrations or custom validator subclasses.
Documentation
Getting Started
- Installation & Setup
- Basic Usage
- Core Concepts
Validation Guides
- String Validation — Email, URL, patterns, length constraints
- Numeric Validation — Integers, floats, ranges, constraints
- Array Validation — Indexed arrays and item validation
- Object & Schema Validation — Complex nested structures
- Custom Validation — User-defined functions and business logic
- Error Handling — Working with validation errors
Factory Reference
- Validator Factory
Examples
- Form Validation
For AI Agents
llms.txt— Technical specification with API signatures, parameters, and core behavior
Security
Please report suspected vulnerabilities privately by following the Security Policy. Do not disclose security issues in the public issue tracker.
Contributing
Contributions are welcome. Read the Contributing Guide, or open an issue to report a bug or propose an improvement.
License
Lemmon Validator is licensed under the MIT License.
All versions of validator with dependencies
ext-mbstring Version *