Validation
extends Base
in package
Exception thrown when data validation fails with detailed error information.
This exception is used throughout the framework to indicate validation failures for user input, configuration data, API parameters, or any other data that must meet specific criteria. It extends the base exception to include detailed error information that can be used for user feedback or debugging.
Key features:
- Stores array of specific validation errors
- Provides structured error access via public property
- Supports multiple validation failures in a single exception
- Integrates with the framework's validation system
- Enables detailed error reporting and user feedback
Common validation scenarios:
- Form input validation (required fields, format validation)
- API parameter validation (data types, ranges, patterns)
- Configuration file validation (required settings, valid values)
- DTO validation (object property constraints)
- Business rule validation (complex domain constraints)
Tags
Table of Contents
Properties
- $errors : array<string|int, mixed>
Methods
- __construct() : mixed
Properties
$errors
public
array<string|int, mixed>
$errors
Methods
__construct()
public
__construct(string $name, array<string|int, mixed> $errors) : mixed
Parameters
- $name : string
- $errors : array<string|int, mixed>