@@ -35,19 +35,28 @@ public function createForFormType(string $formType, array &$resources = []): Inp
3535
3636 $ inputDefinition = new InputDefinition ();
3737
38+ if (!$ form ->getConfig ()->getCompound ()) {
39+ $ this ->addFormToInputDefinition ($ form ->getName (), $ form , $ inputDefinition );
40+ }
41+
3842 foreach ($ form ->all () as $ name => $ field ) {
39- if (!$ this ->isFormFieldSupported ($ field )) {
40- continue ;
41- }
43+ $ this ->addFormToInputDefinition ($ name , $ field , $ inputDefinition );
44+ }
4245
43- $ type = InputOption::VALUE_REQUIRED ;
44- $ default = $ this ->resolveDefaultValue ($ field );
45- $ description = FormUtil::label ($ field );
46+ return $ inputDefinition ;
47+ }
4648
47- $ inputDefinition ->addOption (new InputOption ($ name , null , $ type , $ description , $ default ));
49+ private function addFormToInputDefinition (string $ name , FormInterface $ form , InputDefinition $ inputDefinition ): void
50+ {
51+ if (!$ this ->isFormFieldSupported ($ form )) {
52+ return ;
4853 }
4954
50- return $ inputDefinition ;
55+ $ type = InputOption::VALUE_REQUIRED ;
56+ $ default = $ this ->resolveDefaultValue ($ form );
57+ $ description = FormUtil::label ($ form );
58+
59+ $ inputDefinition ->addOption (new InputOption ($ name , null , $ type , $ description , $ default ));
5160 }
5261
5362 private function isFormFieldSupported (FormInterface $ field ): bool
0 commit comments