final class JsonSchemaFile

Validates a document against a JSON Schema read from a file.

Methods§

public function validate(mixed $data, string $schema, string $file): void

Validates a document.

Parameters

$datamixedThe decoded document
$schemastringThe schema file
$filestringThe document file, used in error messages

Throws

InvalidInputException When the schema cannot be read or is neither an object nor a Boolean, or the document breaks it
JsonException When the schema is not JSON
Test cases 6
Called from 2
Calls 11

Test cases 21§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 6
Other tests reaching this symbol 15

Relations§

Instantiated in 1
Method calls 2