IValidator
in
Core validator interface for the Neuron validation system.
This interface defines the contract that all validators must implement within the Neuron validation framework. It provides a consistent API for validating data across different types and validation rules, enabling composable and reusable validation logic throughout applications.
Key features:
- Simple boolean validation result for easy integration
- Support for any data type through mixed parameter
- Foundation for complex validation rule composition
- Consistent API across 20+ built-in validators
- Extensible for custom validation implementations
Common validator implementations:
- Format validators: IsEmail, IsUrl, IsPhoneNumber, IsJson
- Type validators: IsString, IsInteger, IsArray, IsBoolean
- Range validators: IsNumberWithinRange, IsStringLength
- Pattern validators: IsRegExPattern, IsName
- Business validators: IsEin, IsUpc, IsCurrency
Tags
Table of Contents
Methods
- isValid() : bool
- Determines if the provided value meets the validity criteria.
Methods
isValid()
Determines if the provided value meets the validity criteria.
public
isValid(mixed $value) : bool
Parameters
- $value : mixed
-
The value to be validated.
Return values
bool —Returns true if the value is valid, otherwise false.