1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Spiechu\SymfonyCommonsBundle\Service\SchemaValidator; |
||
6 | |||
7 | class XmlSchemaValidatorFactory extends AbstractSchemaValidatorFactory implements SchemaValidatorFactoryInterface |
||
8 | { |
||
9 | /** |
||
10 | * {@inheritdoc} |
||
11 | */ |
||
12 | 2 | public function getValidator(string $id): SchemaValidatorInterface |
|
13 | { |
||
14 | 2 | $this->assertHasSchema($id); |
|
15 | |||
16 | 2 | if (!$this->registeredSchemas[$id] instanceof XmlSchemaValidator) { |
|
17 | 2 | $this->registeredSchemas[$id] = new XmlSchemaValidator($this->fileLocator->locate($this->registeredSchemas[$id])); |
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
18 | } |
||
19 | |||
20 | 2 | return $this->registeredSchemas[$id]; |
|
21 | } |
||
22 | } |
||
23 |