File tree 3 files changed +24
-3
lines changed
3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 24
24
* @author Kévin Dunglas <[email protected] >
25
25
* @author Jachim Coudenys <[email protected] >
26
26
*/
27
- final class SchemaFactory implements SchemaFactoryInterface
27
+ final class SchemaFactory implements SchemaFactoryInterface, SchemaFactoryAwareInterface
28
28
{
29
29
private const HREF_PROP = [
30
30
'href ' => [
@@ -133,4 +133,11 @@ public function addDistinctFormat(string $format): void
133
133
$ this ->schemaFactory ->addDistinctFormat ($ format );
134
134
}
135
135
}
136
+
137
+ public function setSchemaFactory (SchemaFactoryInterface $ schemaFactory ): void
138
+ {
139
+ if ($ this ->schemaFactory instanceof SchemaFactoryAwareInterface) {
140
+ $ this ->schemaFactory ->setSchemaFactory ($ schemaFactory );
141
+ }
142
+ }
136
143
}
Original file line number Diff line number Diff line change 25
25
*
26
26
* @author Kévin Dunglas <[email protected] >
27
27
*/
28
- final class SchemaFactory implements SchemaFactoryInterface
28
+ final class SchemaFactory implements SchemaFactoryInterface, SchemaFactoryAwareInterface
29
29
{
30
30
private const BASE_PROP = [
31
31
'readOnly ' => true ,
@@ -190,4 +190,11 @@ public function addDistinctFormat(string $format): void
190
190
$ this ->schemaFactory ->addDistinctFormat ($ format );
191
191
}
192
192
}
193
+
194
+ public function setSchemaFactory (SchemaFactoryInterface $ schemaFactory ): void
195
+ {
196
+ if ($ this ->schemaFactory instanceof SchemaFactoryAwareInterface) {
197
+ $ this ->schemaFactory ->setSchemaFactory ($ schemaFactory );
198
+ }
199
+ }
193
200
}
Original file line number Diff line number Diff line change 9
9
use ApiPlatform \JsonSchema \SchemaFactoryInterface ;
10
10
use ApiPlatform \Metadata \Operation ;
11
11
12
- final class SchemaFactory implements SchemaFactoryInterface
12
+ final class SchemaFactory implements SchemaFactoryInterface, SchemaFactoryAwareInterface
13
13
{
14
14
public function __construct (private SchemaFactoryInterface $ schemaFactory )
15
15
{
@@ -38,4 +38,11 @@ public function addDistinctFormat(string $format): void
38
38
$ this ->schemaFactory ->addDistinctFormat ($ format );
39
39
}
40
40
}
41
+
42
+ public function setSchemaFactory (SchemaFactoryInterface $ schemaFactory ): void
43
+ {
44
+ if ($ this ->schemaFactory instanceof SchemaFactoryAwareInterface) {
45
+ $ this ->schemaFactory ->setSchemaFactory ($ schemaFactory );
46
+ }
47
+ }
41
48
}
You can’t perform that action at this time.
0 commit comments