| 1 | <?php |
||
| 9 | abstract class AbstractSchemaValidatorFactory |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var FileLocatorInterface |
||
| 13 | */ |
||
| 14 | protected $fileLocator; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | protected $registeredSchemas; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param FileLocatorInterface $fileLocator |
||
| 23 | */ |
||
| 24 | 12 | public function __construct(FileLocatorInterface $fileLocator) |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @param string $id |
||
| 33 | * @param string $schemaResourceLocation |
||
| 34 | * |
||
| 35 | * @throws \RuntimeException When schema with provided $id is already registered |
||
| 36 | * |
||
| 37 | * @return self |
||
| 38 | */ |
||
| 39 | 3 | public function registerSchema(string $id, string $schemaResourceLocation): self |
|
| 49 | |||
| 50 | /** |
||
| 51 | * @param string $id |
||
| 52 | * |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | 3 | public function hasSchema(string $id): bool |
|
| 59 | |||
| 60 | /** |
||
| 61 | * @param string $id |
||
| 62 | * |
||
| 63 | * @throws \RuntimeException When schema with id "%s" is not registered |
||
| 64 | */ |
||
| 65 | 3 | protected function assertHasSchema(string $id): void |
|
| 71 | } |
||
| 72 |