Skip to content

Commit 3bd9736

Browse files
committed
add distinct format method for hal schema factory
1 parent 69bc767 commit 3bd9736

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Hal/JsonSchema/SchemaFactory.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public function __construct(SchemaFactoryInterface $schemaFactory)
5050
{
5151
$this->schemaFactory = $schemaFactory;
5252

53-
if (method_exists($schemaFactory, 'addDistinctFormat')) {
54-
$schemaFactory->addDistinctFormat('jsonhal');
55-
}
53+
$this->addDistinctFormat('jsonhal');
5654
}
5755

5856
/**
@@ -129,4 +127,11 @@ public function buildSchema(string $className, string $format = 'jsonhal', strin
129127

130128
return $schema;
131129
}
130+
131+
public function addDistinctFormat(string $format): void
132+
{
133+
if (method_exists($this->schemaFactory, 'addDistinctFormat')) {
134+
$this->schemaFactory->addDistinctFormat($format);
135+
}
136+
}
132137
}

0 commit comments

Comments
 (0)