| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function create($schemaAlias, $data = null, array $options = []) |
||
| 27 | { |
||
| 28 | /** @var SchemaInterface $schema */ |
||
| 29 | $schema = $this->schemaRegistry->get($schemaAlias); |
||
| 30 | |||
| 31 | if ($schema instanceof SchemaFormOptionsInterface) { |
||
| 32 | $options = array_merge($schema->getOptions(), $options); |
||
| 33 | } |
||
| 34 | |||
| 35 | $builder = $this->formFactory->createBuilder( |
||
| 36 | FormType::class, |
||
| 37 | $data, |
||
| 38 | array_merge_recursive( |
||
| 39 | [ |
||
| 40 | 'data_class' => null, |
||
| 41 | ], |
||
| 42 | $options |
||
| 43 | ) |
||
| 44 | ); |
||
| 45 | |||
| 46 | $schema->buildForm($builder); |
||
| 47 | |||
| 48 | return $builder->getForm(); |
||
| 49 | } |
||
| 51 |