API reference / Quittio \ Core \ Validation
InvoiceValidator
final class in quittio/core
Quittio\Core\Validation\InvoiceValidator · Source
Runs all configured validation drivers and merges their results.
Methods#
| Method | Description |
|---|---|
->__construct() | |
->drivers() | |
->validate() | Runs every driver that supports() the subject, in the order added, and merges their results into one. |
->withDriver() | Returns a copy that runs $driver after the drivers added before. |
__construct()#
public function __construct(iterable<ValidationDriver> $drivers = [])| Parameter | Type | Description |
|---|---|---|
$drivers | iterable<ValidationDriver> = [] |
drivers()#
public function drivers(): list<ValidationDriver>- Returns
list<ValidationDriver>
validate()#
public function validate(ValidationSubject $subject): ValidationResultRuns every driver that supports() the subject, in the order added, and merges their results into one.
| Parameter | Type | Description |
|---|---|---|
$subject | ValidationSubject |
- Returns
ValidationResult
withDriver()#
public function withDriver(ValidationDriver $driver): selfReturns a copy that runs $driver after the drivers added before.
| Parameter | Type | Description |
|---|---|---|
$driver | ValidationDriver |
- Returns
self