API reference / Quittio \ Core \ Validation
ValidationDriver
interface in quittio/core
Quittio\Core\Validation\ValidationDriver · Source
A validation driver checks one or more levels (PHP rules, XSD, KoSIT, veraPDF, …).
Methods#
| Method | Description |
|---|---|
->levels() | |
->name() | Short name of the driver, e.g. "php", "xsd", "kosit" or "verapdf". |
->supports() | Whether the driver can run for the subject (e.g. XML drivers need generated XML). |
->validate() | Checks the subject and returns the findings with the levels that were checked. Called only when supports() returned true for the subject. |
levels()#
public function levels(): list<ValidationLevel>- Returns
list<ValidationLevel>
name()#
public function name(): stringShort name of the driver, e.g. "php", "xsd", "kosit" or "verapdf".
- Returns
string
supports()#
public function supports(ValidationSubject $subject): boolWhether the driver can run for the subject (e.g. XML drivers need generated XML).
| Parameter | Type | Description |
|---|---|---|
$subject | ValidationSubject |
- Returns
bool
validate()#
public function validate(ValidationSubject $subject): ValidationResultChecks the subject and returns the findings with the levels that were checked. Called only when supports() returned true for the subject.
| Parameter | Type | Description |
|---|---|---|
$subject | ValidationSubject |
- Returns
ValidationResult