@@ -21,25 +21,25 @@ class FormGenerator
2121 private $ formFactory ;
2222
2323 /** @var FormConfigurationModifierInterface[][] */
24- private $ formConfigurationModifiers = array () ;
24+ private $ formConfigurationModifiers = [] ;
2525
2626 /** @var FormFieldResolverInterface[][] */
27- private $ formFieldResolvers = array () ;
27+ private $ formFieldResolvers = [] ;
2828
2929 /** @var FormViewProviderInterface[][] */
30- private $ formViewProviders = array () ;
30+ private $ formViewProviders = [] ;
3131
3232 /** @var bool */
3333 private $ needsSorting = false ;
3434
3535 /** @var FormConfigurationModifierInterface[] */
36- private $ sortedFormConfigurationModifiers = array () ;
36+ private $ sortedFormConfigurationModifiers = [] ;
3737
3838 /** @var FormFieldResolverInterface[] */
39- private $ sortedFormFieldResolvers = array () ;
39+ private $ sortedFormFieldResolvers = [] ;
4040
4141 /** @var FormViewProviderInterface[] */
42- private $ sortedFormViewProviders = array () ;
42+ private $ sortedFormViewProviders = [] ;
4343
4444 public function __construct (FormFactoryInterface $ formFactory )
4545 {
@@ -91,7 +91,7 @@ public function addFormViewProvider(FormViewProviderInterface $provider, $priori
9191 * @param array $context
9292 * @return FormBuilderInterface
9393 */
94- public function createFormBuilder ($ model , $ form = 'default ' , $ context = array () )
94+ public function createFormBuilder ($ model , $ form = 'default ' , $ context = [] )
9595 {
9696 $ fb = $ this ->formFactory ->createBuilder (FieldTypeMapper::map ('form ' ), $ model );
9797
@@ -108,7 +108,7 @@ public function createFormBuilder($model, $form = 'default', $context = array())
108108 * @param array $context
109109 * @return FormBuilderInterface
110110 */
111- public function createNamedFormBuilder ($ name , $ model , $ form = 'default ' , $ context = array () )
111+ public function createNamedFormBuilder ($ name , $ model , $ form = 'default ' , $ context = [] )
112112 {
113113 $ fb = $ this ->formFactory ->createNamedBuilder ($ name , FieldTypeMapper::map ('form ' ), $ model );
114114
@@ -124,7 +124,7 @@ public function createNamedFormBuilder($name, $model, $form = 'default', $contex
124124 * @param string $form view to generate
125125 * @param array $context
126126 */
127- public function populateFormBuilder (FormBuilderInterface $ fb , $ model , $ form = 'default ' , $ context = array () )
127+ public function populateFormBuilder (FormBuilderInterface $ fb , $ model , $ form = 'default ' , $ context = [] )
128128 {
129129 if ($ this ->needsSorting ) {
130130 $ this ->sortRegisteredServices ();
@@ -169,9 +169,9 @@ public function populateFormBuilder(FormBuilderInterface $fb, $model, $form = 'd
169169 * @param array $fields
170170 * @return array
171171 */
172- private function getFieldsConfiguration ($ model , $ fields = array () )
172+ private function getFieldsConfiguration ($ model , $ fields = [] )
173173 {
174- $ configuration = $ properties = array () ;
174+ $ configuration = $ properties = [] ;
175175 $ ro = new \ReflectionObject ($ model );
176176 if (empty ($ fields )) {
177177 $ properties = $ ro ->getProperties ();
@@ -219,7 +219,7 @@ private function getFields($model, $form)
219219 }
220220 }
221221 if ($ formAnnotation === null ) {
222- $ formAnnotation = new Annotations \Form (array () );
222+ $ formAnnotation = new Annotations \Form ([] );
223223 }
224224 return $ formAnnotation ->getForm ($ form );
225225 }
@@ -232,12 +232,12 @@ private function getFields($model, $form)
232232 */
233233 private function normalizeFields ($ _fields )
234234 {
235- $ fields = array () ;
235+ $ fields = [] ;
236236 foreach ($ _fields as $ key => $ value ) {
237237 if (is_array ($ value )) {
238238 $ fields [$ key ] = $ value ;
239239 } else {
240- $ fields [$ value ] = array () ;
240+ $ fields [$ value ] = [] ;
241241 }
242242 }
243243 return $ fields ;
0 commit comments