| Total Complexity | 4 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class SimpleFieldFactory extends FieldFactory |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * |
||
| 15 | */ |
||
| 16 | public function __construct(array $options = []) |
||
| 17 | { |
||
| 18 | $field = $options['form_field_factory'] ?? []; |
||
| 19 | $manager = $options['data_manager_factory'] ?? []; |
||
| 20 | $controller = $options['controller'] ?? null; |
||
| 21 | |||
| 22 | $this->formFieldFactory = $this->createFormFieldFactory($field); |
||
| 23 | $this->dataManagerFactory = $this->createDataManagerFactory($manager); |
||
| 24 | |||
| 25 | if (isset($controller)) { |
||
| 26 | $this->controller = $controller; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * |
||
| 32 | */ |
||
| 33 | protected function createFormFieldFactory(array $options): FormFieldResolverFactoryInterface |
||
| 34 | { |
||
| 35 | $namespaces = $options['namespaces'] ?? []; |
||
| 36 | $fields = $options['fields'] ?? []; |
||
| 37 | |||
| 38 | return new FormFieldFactory($namespaces, $fields); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * |
||
| 43 | */ |
||
| 44 | protected function createDataManagerFactory(array $options): FieldDataManagerResolverFactoryInterface |
||
| 50 | } |
||
| 51 | } |
||
| 52 |