Skip to content

Commit 6578c8b

Browse files
authored
Merge pull request #3417 from arnedesmedt/enableDecoratingSchemaFactory
Don't typehint the SchemaFactory decorator by its implementation, but by its interface
2 parents a548e16 + a23a67c commit 6578c8b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Hydra/JsonSchema/SchemaFactory.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ final class SchemaFactory implements SchemaFactoryInterface
3838

3939
private $schemaFactory;
4040

41-
public function __construct(BaseSchemaFactory $schemaFactory)
41+
public function __construct(SchemaFactoryInterface $schemaFactory)
4242
{
4343
$this->schemaFactory = $schemaFactory;
44-
$schemaFactory->addDistinctFormat('jsonld');
44+
45+
if ($schemaFactory instanceof BaseSchemaFactory) {
46+
$schemaFactory->addDistinctFormat('jsonld');
47+
}
4548
}
4649

4750
/**

0 commit comments

Comments
 (0)