1 | <?php |
||
13 | class JsonSchemaValidatorFactory |
||
14 | { |
||
15 | /** |
||
16 | * @var FileLocatorInterface |
||
17 | */ |
||
18 | protected $fileLocator; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $registeredSchemas; |
||
24 | |||
25 | 1 | public function __construct(FileLocatorInterface $fileLocator) |
|
30 | |||
31 | /** |
||
32 | * @throws \RuntimeException When schema with provided $id is already registered |
||
33 | */ |
||
34 | 1 | public function registerSchema(string $id, string $schemaResourceLocation): self |
|
44 | |||
45 | 1 | public function hasSchema(string $id): bool |
|
49 | |||
50 | /** |
||
51 | * @throws FileLocatorFileNotFoundException |
||
52 | * @throws \RuntimeException |
||
53 | * @throws \InvalidArgumentException |
||
54 | */ |
||
55 | 1 | public function getValidator(string $id): JsonSchemaValidator |
|
67 | |||
68 | /** |
||
69 | * @throws FileLocatorFileNotFoundException |
||
70 | * @throws \InvalidArgumentException |
||
71 | */ |
||
72 | 1 | protected function createSchema(string $id): \stdClass |
|
86 | } |
||
87 |